Run ssh-keygen on your local machine with the -t dsa option. This will produce a ~/.ssh/id_dsa.pub file. Then scp this file to the remote machine (using a target name of id_dsa.pub.<hostname> to indicate from which host this is would be a good idea to keep things straight. example: "scp user@host .ssh/id_dsa.pub id_dsa.pub.spring"
Then ssh into the remote machine. Now you need to add the public key to your .ssh/authorized_keys file on the remote machine:
example: cat id_dsa.pub.spring >>.ssh/authorized_keys
You also need to check the /etc/ssh/sshd_config of the target machine.
Here are the uncommented entries of mine:
Code:
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
The sshd_config file should be well commented. The above comment tells you how to use PAM for account and session checks but not for authentication.
Also make sure to disable root logins, only allow protocol 2, and if only a few users can ssh in, use the "AllowUsers <username1> <username2>" line to disallow all other connection attempts. Many people also change the port used. Doing so will reduce the number of script kiddie attacks dramatically.
Code:
Protocol 2
PermitRootLogin no
PasswordAuthentication no
UsePAM yes
AllowUsers jschiwal
You could avoid repeated scp commands by using sftp instead and running an ftp batch file, which you could construct on the fly as well.
example:
Code:
find ~/Documents/pics/ -type f -name "*.jpg" -mtime 1 >ftpbatch
sed -i 's/^/put /' ftpbatch
sftp -b ftpbatch fountainhead@crossbow:Documents/