Passwordless ssh for root


 
Thread Tools Search this Thread
Operating Systems Solaris Passwordless ssh for root
# 1  
Old 09-26-2012
Passwordless ssh for root

Hi Experts,

I am trying to setup passwordless ssh for root between two of my solaris servers(say A & B).

I have exchanged the public keys between both servers.

Password less ssh working fine while I try to connect from Server A to Server B.

However it is still asking password while I try to ssh from Server B to Server A.

OS details for both servers:

Code:
 
# uname -a
SunOS prod1 5.10 Generic_144488-05 sun4v sparc sun4v
#
# uname -a
SunOS prod2 5.10 Generic_144488-05 sun4v sparc sun4v
#

PermitRootLogin flag in sshd_config file is set accordingly on both servers.

Code:
 
# grep -i permitroot /etc/ssh/sshd_config
PermitRootLogin without-password
#

Permission for .ssh directory under root on both servers.

Code:
 
# ls -ld .ssh
drwx------   2 root     root         512 Sep 26 21:30 .ssh
#

Permission for authorized_keys file on both servers.

Code:
# ls -ltr authorized_keys
-rw-------   1 root     root         221 Sep 26 21:27 authorized_keys
#

Need your help in identifying why it is asking for password while I am trying to connect from Server B to Server A.
# 2  
Old 09-26-2012
What's the permission of the home directories themselves?
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 09-26-2012
@Corona688 root is not affected by file and directory permissions (unless if on remote file systems which I guess is not the case here)

@sai_2507 Check is PASSREQ is set to no in /etc/default/login.
# 4  
Old 09-26-2012
Quote:
Originally Posted by jlliagre
@Corona688 root is not affected by file and directory permissions (unless if on remote file systems which I guess is not the case here)
Not in general, no. ssh has its own requirements which it enforces, however; and you don't get root until you actually log in!
# 5  
Old 09-27-2012
If you sure you really like to do this ? It less secure andnormally just a su and you are root, but ok , try this:

vi /etc/ssh/sshd_config and set "PermitRootLogin" to "yes".
you hav eit currently under "PermitRootLogin without-password"

Then restart the sshd process.

and test it
# 6  
Old 10-04-2012
Thanks Corona688 and all for your help.

Checked the permission of root direcotory and found root was not owner of root directory on one of the server. I changed the owner to root and now it is working fine... Smilie
# 7  
Old 01-06-2013
FYI on Solaris 11
The default install sets root up as a role. This breaks ssh public key authentication for root as it always prompts for a password and the sshd server (in debug mode) always errors out with "Failed publickey for root from X.X.X.X port XXXX ssh2 debug 1.

The quick solution for the above is to set root back to a "normal" account type by running the following command (this edits the /etc/user_attr file):

Code:
rolemod -K type=normal root

I wasted half a day on this. Hope this helps someone else out there.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Passwordless ssh for different user

Hello Folks, I lost touch in ssh key gen topics. I am in need of ssh to a server without password, kindly help me in configuring. I have two servers, server1 with user name apha & server1 with user name beta. I need to ssh to the server2 from server1 with respective users, Manually i... (3 Replies)
Discussion started by: Thala
3 Replies

2. Shell Programming and Scripting

Ssh passwordless authentication

Hey team I have to enable password less authentication betweeen A to B server and A to C server and A to D server. For this I generated a ssh key on server A using ssh-keygen command and copied the key using ssh-copy-id command to B, C and D server. Everything is working fine as of now but... (5 Replies)
Discussion started by: Sandeep_sandy
5 Replies

3. UNIX for Advanced & Expert Users

Passwordless ssh

Hi I have created a user on a linux server and created a passwordless ssh key. I've echoed the key into the authorized_keys file for the user. I've added a series of forced commands to the key. From my laptop - logged in as myself - I can ssh into the server as that user and the commands... (3 Replies)
Discussion started by: steadyonabix
3 Replies

4. Shell Programming and Scripting

passwordless ssh

My main concern is, i have to login into 300 linux server and all are having same userid and password. I dont want to create any key for each server to login . Is there a way to run the shell script ? (3 Replies)
Discussion started by: Mani2512
3 Replies

5. UNIX for Dummies Questions & Answers

passwordless ssh

hi, i have tried with passwordless shh in google.. i followed the below steps ... user:~> ssh-keygen -t rsa Enter file in which to save the key (/home/cantin/.ssh/id_rsa):key.txt Enter passphrase (empty for no passphrase): Enter same passphrase again: till this step i... (0 Replies)
Discussion started by: arunmanas
0 Replies

6. AIX

passwordless ssh for non-root user???

hi all I have a problem to set up the password ssh login for a non-root user. what I want to do is that non-root user in host A logs into host B without password prompted. what I did listed as the following steps. 1. genarate a pair of keys from host A. ssy-keygen -t rsa -N "" -f... (9 Replies)
Discussion started by: rs6000er
9 Replies

7. Shell Programming and Scripting

ssh passwordless

Hi, I want to login to a remote server and sftp files without password prompting. So, I created private-public key pair as follows: user1@server1.com .ssh]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/user1/.ssh/id_rsa): Enter... (7 Replies)
Discussion started by: dips_ag
7 Replies

8. HP-UX

Help on passwordless ssh...

Hi, Can someone help me on ssh-keygen usage...? I used ssh-keygen after which "id.pub" file was generated in system1's > .ssh directory... I copied the same into the remote system system2 > .ssh directory as "authorized_keys" file. Now i tried ssh connection from system 1 to system... (7 Replies)
Discussion started by: EmbedUX
7 Replies

9. AIX

Passwordless root authentication via SSH

Hello, I would like to issue a couple of commands as root on a remote machine without having to enter the root password. I used "ssh-keygen -t rsa" to generate the encryption keys, copied the public key to the remote machine, etc. I also tried playing around with the sshd_config file and... (3 Replies)
Discussion started by: sphericon
3 Replies

10. AIX

Passwordless authentication via SSH

I am trying to implement passwordless authentication via ssh2. I have used the well documented technique of generating a key pair with a blank passphrase on my client machine, and installing the public key on the destination server (AIX 5.3) in the user's .ssh2 directory. I have used this technique... (1 Reply)
Discussion started by: RegX
1 Replies
Login or Register to Ask a Question