I have 2 shell accounts ont 2 different hosts:
- shell A: shell I want to login using a SSH key (server-A.com)
- shell B: shell I'm using to login to A without a password but using SSH key (server-B.com)
I emailed the server-A.com sysadmin who gave me the bellow tutorial URLs.
I've done the following:
- Created a private/public SSH key on server-A.com using
ssh-keygen -t rsa -C username@server-A.comand put the private key on server-B.com in
- I ran
chmod 700 ~/.ssh/and
chmod 600 ~/.ssh/server-B.com
I added server-A.com public key to to
$ cat ~/.ssh/server-B.com.pub >> ~/.ssh/authorized_keys # on server-B.com
/etc/ssh/ssh_configwhich contained the following (other # comment lines not printed)
# PasswordAuthentication yes SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes
From shell B:
$ ssh-keygen -f "/home/username/.ssh/known_hosts" -R server-A.com
NOTE: I followed the tutorials on https://kb.iu.edu/d/aews and https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/create-with-openssh/.
What went wrong?