The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Modify users password via script? paqman Shell Programming and Scripting 2 08-21-2007 12:22 PM
Have users changed their password annemar UNIX for Dummies Questions & Answers 6 09-20-2006 04:18 AM
How best to extract the users home from /etc/password spaceship Shell Programming and Scripting 4 03-30-2006 07:39 AM
password prompts balag UNIX for Advanced & Expert Users 2 01-05-2006 02:19 PM
scripting password prompts hcclnoodles Shell Programming and Scripting 3 03-21-2005 04:25 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-01-2008
vjkatsun vjkatsun is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 2
SSH prompts password for non identical users

host1 & host2 : Solaris 10 - SPARC server


From host1 able to ssh to host2 as same user with out password prompt. But, when ssh to different user in

host2, it prompts for password

DETAILS
=======

In host1:

1) logged as root
2) ssh-keygen -t dsa -b 1024 (no pass phrase)
3) Ensured that permission for /.ssh is 700 & for id_dsa is 600
4) copied id_dsa.pub to host2 : /.ssh

In host2:

1) logged as root
2) cp /.ssh/id_dsa.pub /.ssh/authorized_keys
3) Ensured that permission for /.ssh is 700 & for authorized_keys is 644


From host1:

1) Login as root
2) ssh host2 - Successfully logs in with OUT asking for the password


In host2

1) created a new userid - abcd - homedir /opt/abcd
2) created /opt/abcd/.ssh - 700
3) copied /.ssh/authorized_keys to /opt/abcd/.ssh/authorized_keys 644


From host1:

1) Login as root
2) ssh abcd@host2 - prompts for password.

What should be done so that, from host1, I can ssh for any user in host2 without getting the password prompt
  #2 (permalink)  
Old 06-01-2008
ripat ripat is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2006
Location: Belgium
Posts: 438
On host 2, edit the /home/user/.ssh/authorized.keys and change the key identity:
ssh-rsa LKJojlKlkjMLjpojMPJmlj etc... == root@host1
to :
ssh-rsa LKJojlKlkjMLjpojMPJmlj etc... == user@host1

On host 1 copy the root private key (id_rsa) to /home/user/.ssh/

If this doesn't work, I guess you will need to create a new pair of key for your user the same way you did for root.
  #3 (permalink)  
Old 06-01-2008
vjkatsun vjkatsun is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 2
Created the keys in host1, while logged in as root & then copied the public key to host2

From host1, initially did

ssh host2 - which worked fine

now,

ssh user2@host2 - prompts for password

In public key it contains root@host1 - which is fine. Coz, am always logged as root in host1 - so no need to change

Not sure how to proceed :-(
  #4 (permalink)  
Old 06-01-2008
ripat ripat is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2006
Location: Belgium
Posts: 438
Quote:
Originally Posted by vjkatsun View Post
In public key it contains root@host1 - which is fine. Coz, am always logged as root in host1 - so no need to change
On host 2, when you try to login as user@host1 sshd will look for a public key belonging to user@host1, not root@host1 even if you invoque ssh user@host2 in a root session on host1. Hence the need to edit the public key indentification in the host2 authorized_keys. Or to create a new pair of keys for user

To trouble shoot:
$ tail -f /var/log/auth.log | grep ssh # adapt to the log name or UID specific to your *nix box

and report errors when trying to connect.

Last edited by ripat; 06-01-2008 at 01:51 PM.. Reason: Add: trouble shoot
  #5 (permalink)  
Old 06-01-2008
ramen_noodle ramen_noodle is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 251
sshd is generally pretty verbal about key exchange issues and can be made more so(-d). Check /var/log/messages or wherever you are logging sshd to or run in the the fg with -D. ssh -v{3} is your friend.

I've seen a similar problem where the key permissions were too open. OpenSSH may not like world readable permissions for your private key.
  #6 (permalink)  
Old 06-02-2008
ripat ripat is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2006
Location: Belgium
Posts: 438
Quote:
Originally Posted by ramen_noodle View Post
I've seen a similar problem where the key permissions were too open. OpenSSH may not like world readable permissions for your private key.
True. That's indeed a possible cause of connection problems. Check and change the permission as follows:

target /home/user directory 766
target /home/user/.ssh directory 700
target /home/user/.ssh/authorized_keys file 600
Closed Thread

Bookmarks

Tags
solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0