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


 
Thread Tools Search this Thread
Operating Systems Solaris How can i setup ssh password-less login for particular user?
# 1  
Old 05-26-2015
How can i setup ssh password-less login for particular user?

HI Community.

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

These are the steps I followed:-

I have logged 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:-
Code:
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.

I restarted ssh daemon on client, but it again asking for password 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


Last edited by rbatte1; 05-26-2015 at 01:13 PM.. Reason: Corrected grammer, spelling, case & CODE tags
# 2  
Old 05-26-2015
If I read and understand correctly, you've done it the wrong direction. The keys need to be generated on the client, and the public one needs to be added to the server's .ssh/authorized_keys.
# 3  
Old 05-26-2015
HI

Thanks for the reply.

Actually I am holding one jumpbox which is having root access to all the servers.

What I did is, I have created ssh-keygen on linux and copied id_rsa.pub key to authorized_keys all the client servers and it's working perfectly

is there any changes on Solaris?

Regards,
Ben

Last edited by rbatte1; 05-26-2015 at 01:14 PM.. Reason: Spelling, grammer and ICODE tags
# 4  
Old 05-28-2015
I suspect permission issues, set 600 on authorized_keys and 644 on $HOME and $HOME/.ssh for the user in question night

Regards
Peasant.
# 5  
Old 05-28-2015
Hi

File and folder permissions was ok. File was 600 and folder 700

What i noticed is that night user home directory is set as /log. Will that cause the issue.?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

SSH password less setup asking for password

Hello Experts, when I am trying to connect my target server through sftp after creating ssh password less setup, it is asking for passowrd to connect. to setup this I followed below process: -->generated keys by executing the command "ssh-keygen -t rsa" -->this created my .ssh directory... (9 Replies)
Discussion started by: Devipriya Ch
9 Replies

2. Red Hat

Need to login without password using ssh

I am using redhat 6.4 and i want to login ssh without password kindly guide me (2 Replies)
Discussion started by: kannansoft1985
2 Replies

3. UNIX for Advanced & Expert Users

Setup Samba Server to always ask user and password

How do I setup a Samba server to always ask to user and password, when a windows user, prints your files using a shared printer through a Samba Linux Server (CUPS)? (0 Replies)
Discussion started by: viga
0 Replies

4. Cybersecurity

Ssh password less login with different ID

Hi, I have setup password less ssh connection between Server A and Server B and I am able to connect with User2. But my requirement is, User 1 run a script in Server A to ssh into Server B as User 2 but it is asking password every time I execute. Server A: Login as User 1 and execute sh... (8 Replies)
Discussion started by: sakthi.99it
8 Replies

5. Shell Programming and Scripting

rlogin / ssh login with password

Hello, I need to find a way to connect from server1 to 30 other servers using a single line command in order to run various command from the other 30 servers. I am looking for a single line connection command in which i can provide the server name user name and password and connect to the... (2 Replies)
Discussion started by: LiorAmitai
2 Replies

6. Red Hat

SSH Prompts for Password After Keys Setup Successfully

I setup the keys between 2 servers, but my user account has no password specified for it (never set one up on the account for security reasons). When I try to SSH to the server, SSH prompts for a password that doesn't exist (so I can never connect successfully). Note: 'passwd -d Rynok' removes... (3 Replies)
Discussion started by: Rynok
3 Replies

7. Solaris

SSH Password-less login fails on password expiry.

Hi Gurus I have a few Sol 5.9 servers and i have enabled password less authentication between them for my user ID. Often i have found that when my password has expired,the login fails. Resetting my password reenables the keys. Do i need to do something to avoid this scenario or is this... (2 Replies)
Discussion started by: Renjesh
2 Replies

8. HP-UX

login ssh without password

There is two server, server A and server B. In server A, I would like to login ssh to server B without typing password. (no need for ssh2) Therefore, I do the followings: Server A: >cd ~ >mkdir .ssh >ssh-keygen -t dsa -f .ssh/id_dsa Then copy the file id_dsa.pub to Server B Server B:... (2 Replies)
Discussion started by: alfredo
2 Replies

9. UNIX for Dummies Questions & Answers

setup a logfile for user login/logout ???

Hi everybody, im a newer, i want to setup a logfile to capture information about user login/logout (and some other events ex: a user ftp, run a speacial command) on my system in HP-UX, pls help me. i think only edit file /etc/syslog.conf but i dont know how to do it. Help me. (3 Replies)
Discussion started by: pwd
3 Replies

10. HP-UX

setup a logfile for user login/logout ???

Hi everybody, im a newer, i want to setup a logfile to capture information about user login/logout (and some other events ex: a user ftp, run a speacial command) on my system in HP-UX, pls help me. i think only edit file /etc/syslog.conf but dont know how to do it. Help me. (0 Replies)
Discussion started by: pwd
0 Replies
Login or Register to Ask a Question