'ssh connect Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

I have a pair of keys to epadmin on machine A. I copied them on machine B in home folder of epadmin via scp in folder .ssh

command for access : ssh [email protected]

[epadmin@3A1D .ssh]$ ls -la
total 24
drwxrwxr-x 2 epadmin epadmin 4096 May 12 14:41 .
drwx------ 6 epadmin epadmin 4096 May 12 14:40 ..
-rw-r--r-- 1 epadmin epadmin  438 May 12 14:41 config
-rw------- 1 epadmin epadmin 1671 May 12 14:41 id_rsa_auto_epmc
-rw-r--r-- 1 epadmin epadmin  407 May 12 14:41 id_rsa_auto_epmc.pub
-rw-r--r-- 1 epadmin epadmin 2818 May 12 14:41 known_hosts

Here is a piece of -vvv(Verbose) log

debug1: Next authentication method: publickey
debug1: Trying private key: /home/epadmin/.ssh/identity
debug3: no such identity: /home/epadmin/.ssh/identity
debug1: Trying private key: /home/epadmin/.ssh/id_rsa
debug3: no such identity: /home/epadmin/.ssh/id_rsa
debug1: Trying private key: /home/epadmin/.ssh/id_dsa
debug3: no such identity: /home/epadmin/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug3: packet_send2: adding 64 (len 52 padlen 12 extra_pad 64)

I can't login without password

Piece of sshd_config. I have tried to uncomment RSAAut and paste no to password auth. There were no changes

# Authentication:
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile     .ssh/authorized_keys
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no


Solution 1:[1]

Your question should be on server fault. It's a basic trouble or I should say two :

  • on the server side : when you upload your keys on epadmin in your .ssh directory, you have to rename your id_rsa_auto_epmc.pub file in authorized_keys
  • on the client side : you use a non-default key name for your private key so you have to specify the path to your key by using -i option : ssh -i ~/id_rsa_auto_epmc

No changes is needed to default sshd_config file for key authentification. For your question, it should be better to put the ssh command line you use.

Solution 2:[2]

Solution in terminal for error

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

ssh-keygen -f " ~/.ssh/known_hosts" -R xx.xx.xxx.xxx

xx - ip host

Solution 3:[3]

?one your dir .ssh should be 0700 and the .ssh dir and his son documents's author and group is yours

?the authorized_keys should be 0600 or 0644

?maybe you copy the public authorkey content to authorized_keys isn't run, now you can try copy the authorkey to the remote host your dir .ssh and rename authorized_keys , yeah you can try it! poor English my be run

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kranteg
Solution 2 neubert
Solution 3 phphlx