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 [email protected]
and put the private key on server-B.com in~/.ssh/server-B.com
- I ran
chmod 700 ~/.ssh/
andchmod 600 ~/.ssh/server-B.com
I added server-A.com public key to to
~/.ssh/authorized_keys
on server-B.com$ cat ~/.ssh/server-B.com.pub >> ~/.ssh/authorized_keys # on server-B.com
I've checked
~/.ssh/config
(no) and/etc/ssh/ssh_config
which 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?
ssh
commands with the-vvv
option will provide a lot of debugging information that can narrow down the problem.