...
On a Unix system file permissions should automatically be set to protect your key files from other accounts. If you are on a Windows machine, make sure to store your private key on a protected location. Usually this would be your Windows desktop or home directory.
...
Place Public Key
...
on Server
Ubuntu Shortcut
If you happen to using a Linux client there is a shortcut to copying the public key to the getting everything up and running on the server,
Code Block | ||
---|---|---|
| ||
ssh-copy-id username@remotehost |
It accomplishes in one command,
...
Copy Over Key
Since I happen to be using Mac OS X I do this manually,
Code Block | ||
---|---|---|
| ||
scp ... |
Setup .ssh Directory
Log into the server using your existing authentication method,
First check in your home folder that you have a .ssh directory and an authorized_keys. If you had used your account to access another server through ssh the files may have been created for you. Otherwise, perform the following steps,
Code Block | ||
---|---|---|
| ||
mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
|
The key no pun intended part of this procedure is to have your public key added to the authorized_keys file,
Code Block | ||
---|---|---|
| ||
cat ~/id_dsa.pub >> ~/.ssh/authorized_keys2
|
Disable Password Authentication
...