Operating System - HP-UX
1830210 Members
2167 Online
109999 Solutions
New Discussion

Problem in SSH with root user.!!!

 
Vishal Ranjan
Occasional Advisor

Problem in SSH with root user.!!!

Hi,

Source Server : ukapx044 (say)
Destination Server : ukapx042 (say)

I need to copy '/interfaces' directory (which is owned by root) from source (ukapx044) to the detination server (ukapx042).

I am trying to implement SSH using root, but its not allowing me, see below:

Generation of key-pair at source server (ukapx044)

[ukapx044:root:/home/root/.ssh:] ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/root/.ssh/id_rsa):
/home/root/.ssh/id_rsa already exists.
Overwrite (yes/no)? yes
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/root/.ssh/id_rsa.
Your public key has been saved in /home/root/.ssh/id_rsa.pub.
The key fingerprint is:
57:d7:9f:a3:a9:0a:e7:35:1f:91:b5:6b:fd:50:05:1e root@ukapx044


But when i try to push the public key to the destination server (ukapx042), its gives an error i.e. Permission denied, see below:

[ukapx044:root:/home/root/.ssh:] cat id_rsa.pub | ssh root@ukapx042 'cat - >> /home/root/.ssh/authorized_keys'
root@ukapx042's password:
Permission denied, please try again.


I have checked the permission on $HOME/.ssh on both servers & its 700 already.
I tried pushing the key manually by copy/paste, still it didnt work.

Any ideas?

Regards,
Vishal
5 REPLIES 5
Rasheed Tamton
Honored Contributor

Re: Problem in SSH with root user.!!!

Hi,

Check whether root can login normally (/etc/default/*), etc.

#grep PermitRootLogin /etc/opt/ssh/*config

See whether sshd_config is allowing root access. If it is not you uncomment it and restart the sshd daemon.

Regards,
Rasheed Tamton.



Vishal Ranjan
Occasional Advisor

Re: Problem in SSH with root user.!!!

Hi,

RLOGIN for root is not allowed.

Peter Nikitka
Honored Contributor

Re: Problem in SSH with root user.!!!

Hi,

is /home/root really the HOME directory of root@ukapx042 ?
For the first time, you will have to provide the correct password with this (modified) command:
cat id_rsa.pub | ssh root@ukapx042 'cat >> .ssh/authorized_keys'

I would set the mode of .ssh/authorized_keys to 600 as well.

mfG Peter

The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Rasheed Tamton
Honored Contributor

Re: Problem in SSH with root user.!!!

Hope you might have checked the sshd_config and the /etc/default dir

-Did you try manually like below:

scp /home/root/.ssh/id_rsa.pub ukapx042:/home/root/.ssh/id_rsa.pub.ukapx044
ssh root@ukapx044
cat /home/root/.ssh/id_rsa.pub.ukapx044 >> /home/root/.ssh/authorized_keys

-Let us know the result.

Rgds.
Rasheed Tamton
Honored Contributor

Re: Problem in SSH with root user.!!!

If you are using HPUX Secure Shell, check EnforceSecureTTY option and /etc/securetty.

Rgds.