Contents[Show]

1. Intro

Ssh is a very commonly used program for connecting to remote computers over a secure channel.

The ssh daemon, sshd, should be running on the remote computer, usually on port 22.

The local computer should have the ssh client installed, ssh.

The config files are usually foud in /etc/ssh.

Client config file is /etc/ssh_config.
Daemon config file is /etc/sshd_config.

 

2. The problem

You're trying to ssh to a remote computer and keep getting asked for a password, even though you did copied your public key to the remote computer. You don't see any error message.

First try this to get more verbose information when connecting.

# ssh -vv This email address is being protected from spambots. You need JavaScript enabled to view it....
Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: KEYRING:persistent:0)
...

 

The problem is likely to be a permission issue with the hidden .ssh folder in your home folder.

Typically you want these settings:

.ssh folder should have permissions 700 (drwx------)
Public key (.pub file) should have permissions 644 (-rw-r--r--)
Private key (id_rsa) should have permissions 600 (-rw-------)
Additionally your home folder should generally not have write access by other groups or the world, 755 is prudent to use. (drwxr-xr-x)

Use these command to set the permissions.

# cd /home/sorin
# chmod 700 .ssh
# chmod 644 ./ssh/id_rsa.pub
# chmod 600 ./ssh/id_rsa

For good measure, set this as well.
# chmod 755 /home/sorin

 

Having set the permissions on the .ssh folder, you should be able to properly connect to the remote computer with no questions asked.

 

3. Sources

https://superuser.com/questions/215504/permissions-on-private-key-in-ssh-folder

https://www.linode.com/community/questions/11373/solved-ssh-permission-denied-publickeygssapi-keyexgssapi-with-micpassword