SSH into the XS with a keypair
Here’s how I did it for my Ubuntu desktop client and the XS 0.6.
First, on the XS, uncomment these lines in /etc/ssh/sshd_config and sshd_config.in
Restart the ssh service
Now generate keys on your client machine.
You might have to add -t rsa to that.
Sometimes you’ll have to do this as well, but not on the XO:
On the client machine, set the appropriate permissions in your home directory:
Copy .ssh/id_rsa.pub on the client over to .ssh/authorized_keys on the XS. Make sure it’s all in one line. From the client, this should work, if .ssh/authorized keys already exists on the remote machine.
cat ~/.ssh/id_rsa.pub | ssh -p <port> user@server ‘tee -a .ssh/authorized_keys’
On the XS, set the appropriate permissions in your home directory:
Now you should be able to ssh into the XS without having to supply a password.
To make things even easier, especially if you’re using a nonstandard port and/or your username on the server is different from your username on the client machine, you can put an entry in ~.ssh/config
Here’s an example of my /home/anna/.ssh/config
Host schoolserver
Hostname schoolserver.org
User anna
Port 1985
ServerAliveInterval 30
ServerAliveCountMax 120
If you get an error about bad permissions when you use an ssh config file, simply
So now to ssh, all I have to do is:
To scp, all I have to do is:
scp file.txt schoolserver:/home/anna
In ~.ssh/config, Host can be anything and Hostname can point to an IP. It doesn’t have to be a domain name.