Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

How can i setup ssh password-less login for particular user?

$
0
0
HI Community.

i was trying to create ssh password less authentication for one user called "night" and it's not working for me.

this is the steps i followd.

i have loged into the server and issued
ssh-ketgen -t rsa

Code:

bash-3.2$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/log/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /log/.ssh/id_rsa.
Your public key has been saved in /log/.ssh/id_rsa.pub.
The key fingerprint is:
fa:b8:21:8e:67:c1:d1:9b:ed:88:9d:c9:fd:2a:ef:f1 night@test

bash-3.2$ ls
id_rsa      id_rsa.pub  known_hosts
after that i have copied this key to client machine

cat id_rsa.pub | ssh night@192.168.1.2 'cat >> .ssh/authorized_keys && echo "Copied"'

and changed permission of authorized_keys to 600 and .ssh folder to 700

restarted ssh daemon on client.

but it again asking for passowrd when i am trying to connect as night user.

please help me to fix this issue

Regards,
Ben

---------- Post updated at 01:49 AM ---------- Previous update was at 01:45 AM ----------

here is the debug output

Code:

debug1: Host '192.16.1.12' is known and matches the RSA host key.
debug1: Found key in /log/.ssh/known_hosts:5
debug1: bits set: 1571/3191
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug1: newkeys: mode 1
debug1: set_newkeys: setting new keys for 'out' mode
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: set_newkeys: setting new keys for 'in' mode
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug2: service_accept: ssh-userauth
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Next authentication method: gssapi-keyex
debug2: we did not send a packet, disable method
debug1: Next authentication method: gssapi-with-mic
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug2: we did not send a packet, disable method
debug1: Next authentication method: publickey
debug1: Trying private key: /log/.ssh/identity
debug1: Trying public key: /log/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Trying private key: /log/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1


Viewing all articles
Browse latest Browse all 16232

Trending Articles