Operating System - HP-UX
1834953 Members
2433 Online
110071 Solutions
New Discussion

Re: SSh authorization not working

 
s.raju
Advisor

SSh authorization not working

Hi friends,

I generaate ssh key in both dsa and rsa but after exported to destination server.

it is not working it giving permission deny.

NOTE: the home directory on destination server is datamover

and in source i m using diffrent id to generate ssh key..


Pls someone help me how to login without password in destination server....
4 REPLIES 4
Steven Schweda
Honored Contributor

Re: SSh authorization not working

> it is not working it giving permission deny.

Actual commands? Actual error messages?
Descriptions of the systems involved?

> NOTE: the home directory on destination
> server is datamover

I don't understand this.

> and in source i m using diffrent id to
> generate ssh key..

I don't understand this.

There are _very_ many old threads in this
forum related to SSH configuration. Perhaps
you should look at some of them.
Jannik
Honored Contributor

Re: SSh authorization not working

dir rights should be:
drwx------ .ssh

The rights on the file should be:
-rw-r--r-- authorized_keys

It doesn't matter if it is the same or another user.
If you are user1 og client and you wants to change to user2 on system2 and you private key is called key_server_2.

# ssh -i key_server_2 -l user2 system2

Info:
-i identity_file Selects a file from which the identity (private key) for RSA or DSA authentication is read
-l login_name

And it will work :-)
jaton
s.raju
Advisor

Re: SSh authorization not working

Jannik,

Thx for ur response but my query is

users home directory in storage box for another user is same server i am able to login without password whose home directory is local FS.

so i need to confirm if user Home directory is in auto_fs i.e in storage box does it effect his login...
Matti_Kurkela
Honored Contributor

Re: SSh authorization not working

Autofs is usually used to mount and unmount NFS shares automatically, and NFS certainly can have an effect to file permissions. But not for ordinary users: the usual effect is that the root permissions of the NFS client are null and void on the NFS-mounted filesystems: effectively, the "root" user is treated as the "nobody" user when accessing a NFS-mounted filesystem.

This can make it impossible for sshd (which must run as root to be able to assign incoming sessions to correct user accounts) to read the authorized_keys file if the permissions are too tight.

In this case, the permissions of the user's home directory, the .ssh subdirectory and the authorized_keys file must allow everyone to read the authorized_keys file.

Writing to those files and directories must still be prohibited: otherwise sshd detects there is a possibility that another user is attempting to sabotage the security of this user.

So, the permissions for the NFS-based home directories: (question marks will indicate permissions sshd does not care about, and you can choose them as you wish)

For the home directory of the user: drwx?-x?-x (i.e. chmod 711, 751 or 755)

For the .ssh subdirectory:
drwx?-x?-x (i.e. chmod 711, 751 or 755)

For the authorized_keys file:
-rw-r--r-- (chmod 644)

The private key files must always be protected -rw------- (chmod 600).

MK
MK