Getting SSH Access
You will need to open a root terminal on the server and a native terminal on your Linux/Mac. Consult the documentation from your service provider on getting initial root access.
Then run this command in your mac/linux terminal as the local user you will be using to run ssh:
mkdir -p ~/.ssh; if [ ! -f ~/.ssh/id_ed25519 ]; then ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519 >/dev/null; fi; echo "Your public key:"; cat ~/.ssh/id_ed25519.pub
It will generate an ssh key if you do not have one and then print your public key like such:
ssh-ed25519 AAAAB3NzaC1yc2EAAAADAQABAAABgQCs/Ms7uHKsjcUycxL8ThaZ5BvwjAK5SXx6Rzd8 user@Hostname.local
Then in the server root terminal, run this to add your key to the user account:
sw ssh import
It will ask for the key, include everything from “ssh-rsa” through “user@Hostname.local”. It will then ask which user to add it to. You can add the same key to multiple server users and you can add keys from multiple devices to the same server user.
To test the new credentials, run this in your local terminal, replacing “root” with the appropriate server user:
ssh root@example.com
You can press Ctrl + D to exit the SSH session or enter the command “exit”.