On Apr 25, 7:29 pm, "Mr. Chow Wing Siu" <
wsc...@Comp.HKBU.Edu.HK>
wrote:
You really only need one type of key - rsa.
ssh-keygen -t rsa
If you want dsa also:
ssh-keygen -t dsa
In both cases you will be asked for a passphrase (password) or enter
for none.
A blank passphrase is a bad idea. Also, don't use your UNIX login
password as the passphrase.
If you are using central authentication such as NIS or LDAP, copy
~/.ssh/id_rsa.pub to ~/.ssh/authorized_keys.
Then type ssh-add and enter your passphrase when prompted. Then ssh
hostname and you are in with a password.
The ssh key lasts for the duration of the session.
I use the following in my .profile when I log in (actually its in
my .kshrc file)
# Load the ssh agent into memory, send the PID to /dev/null
eval `ssh-agent` > /dev/null
# Now just run ssh-add to load the ssh keys into the same shell
I use the following in .profile when I close the session (log out).
# Kill the ssh agent when the shell exits
trap '
test -n "$SSH_AGENT_PID" && eval `ssh-agent -k` ;
test -n "$SSH_AGENT_PID" && kill $SSH_AGENT_PID
' 0
Have fun. ssh is great.
Ron