0

ssh password less connection is not working from abc@server1 to xyz@server2 , i generated keys with RSA and copied id_rsa.pub from server1 to server2. still its not working

Generated keys with below

cd 
ssh-keygen -t rsa 
ssh-keygen -t rsa1 
ssh-keygen -t dsa 

scp id_rsa.pub xyz@server2 :/.ssh/authorized_keys

then trying to do ssh from server1 as abc user to

xyz@server2

Its still asking pwd

------ to server3 its working -------------

debug1: Authentications that can continue: publickey,password,keyboard-interactive debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:RuHlMx/4SvyHbc6If32cdbAzW8p1ogG1zvIGYxULr3E /qcm/svprd/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to server3 ([172.10.10.10]:22). 

------ to server2 not working-------------

debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more informationNo Kerberos credentials available 
  • Please provide detail of how you copied the public key across. You can’t just SCP the file over and expect. It to work, for instance. – bxm Nov 12 '19 at 19:23
  • Please edit your question to describe exactly how you set up the key, what ssh command you're running, and what happens when you run it. Please include the exact error messages that you're getting. – Kenster Nov 12 '19 at 19:37
  • Cd ssh-keygen -t rsa ssh-keygen -t dsa cd .ssh – sssss Nov 12 '19 at 19:38
  • generated keys using Cd ssh-keygen -t rsa ssh-keygen -t rsa1 ssh-keygen -t dsa – sssss Nov 12 '19 at 19:38
  • Please try to copy public key using ssh-copy-id command not scp – mrc02_kr Nov 12 '19 at 19:50
0

If you don't have ssh-copy-id, correct scp command is

scp id_rsa.pub xyz@server2:.ssh/authorized_keys

providing

  • .ssh exists in xyz's HOME dir on server2
  • .ssh is 700 (drwx------) (chmod u+rwx,go-rwx .ssh)
  • authorized_keys is 600 (chmod 600 authorized_keys)
  • performed all the above steps, its still asking password – sssss Nov 12 '19 at 21:33
  • Can anyone please help, its critical ans we need it to be worked – sssss Nov 13 '19 at 0:09
  • I could able to fix after changing $HOME permissions to 755 – sssss Nov 13 '19 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.