Security
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Direct login of root is not working

 
Highlighted
Occasional Advisor

Direct login of root is not working

Hi All,

I am unable to login as root user from putty directly(SSH), but console login is working.

In /opt/ssh/etc/sshd_config PermitRootLogin yes is existing(uncommented).

In our server /etc/securetty file is not available.

whenever i try to login as root from putty as shown below

login as: root

Password prompt is not coming and after some time a pop-up is display with message "Server unexpectedly closed network connection"

please find the attachment.

Please suggest me the necessary actions to be taken.

Thanks in advance.

 

 

10 REPLIES 10
Highlighted
Acclaimed Contributor

Re: Direct login of root is not working

you did not tell your OS, but for most linux style OS this is the default because of security.
logon as a user and do su.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Highlighted
Occasional Advisor

Re: Direct login of root is not working

I am using HP-UX 11.31 64bit machine.
Highlighted
Honored Contributor

Re: Direct login of root is not working

> I am unable to login as root user from putty directly(SSH), but
> console login is working.

   What is your console?

> I am using HP-UX 11.31 64bit machine.

      uname -a
      ssh -V

> In /opt/ssh/etc/sshd_config PermitRootLogin yes is
> existing(uncommented).

   Mine is still commented, so that should be ok.

> In our server /etc/securetty file is not available.

   Not an HP-UX feature, so far as I know.

rux# uname -a
HP-UX rux B.11.31 U ia64 1678555272 unlimited-user license

rux# man securetty
No manual entry for securetty.

rux# ssh -V     # (My software is old.)
OpenSSH_5.2p1+sftpfilecontrol-v1.3-hpn13v5, OpenSSL 0.9.8k 25 Mar 2009
HP-UX Secure Shell-A.05.20.015, HP-UX Secure Shell version

> whenever i try to login as root from putty as shown below
> [...]

   Can you enable some SSH diagnostics in PuTTY?  If not, then try a
terminal with a command-line SSH client, and add "-v" (or "-vv", or
"-vvv", as needed).  For example:

rux# ssh -v -l root rux
OpenSSH_5.2p1+sftpfilecontrol-v1.3-hpn13v5, OpenSSL 0.9.8k 25 Mar 2009
[...]

   Are you getting any interesting messages in the system log file
("/var/adm/syslog/syslog.log"?)?

   Can you get in as "root" using "rsh" or Telnet?  Is there a fatal
problem in the "root" user shell start-up scriptlets ("~/.profile",
...)?

Highlighted
Occasional Advisor

Re: Direct login of root is not working

Thanks for the reply steven

# uname -a
HP-UX ruby B.11.31 U ia64 2107105684 unlimited-user license

#ssh -V
OpenSSH_5.9p1+sftpfilecontrol-v1.3-hpn13v12, OpenSSL 0.9.8y 5 Feb 2013
HP-UX Secure Shell-A.05.90.011, HP-UX Secure Shell version

# ssh -v -l root ruby
the above i have tried 3 times

try-1: the above command i had run in same ruby server and the below output at the end as

Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ruby' (ECDSA) to the list of known hosts.
debug1: ssh_ecdsa_verify: signature correct
debug1: calling multi thread cipher
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: calling multi thread cipher
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
Write failed: Broken pipe

Try:2- from same ruby server again i had tried the same command


debug1: Host 'ruby' is known and matches the ECDSA host key.
debug1: Found key in /.ssh/known_hosts:10
debug1: ssh_ecdsa_verify: signature correct
debug1: calling multi thread cipher
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: calling multi thread cipher
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
Connection closed by <ip address of ruby>

Try 3:- From different server i have tried ssh -v -l root <ip address of ruby>

debug1: ssh_ecdsa_verify: signature correct
debug1: calling multi thread cipher
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: calling multi thread cipher
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
Connection closed by <ip of ruby>

# man securetty
No manual entry for securetty.

i have tried using 'telnet' , 'rlogin' and 'ssh' but nothing worked.

 

Highlighted
Honored Contributor

Re: Direct login of root is not working

>>i have tried using 'telnet' , 'rlogin' and 'ssh' but nothing worked.

What kind of failures did you get with telnet and rlogin?  If you cannot login as root directly with ANY protocol then there are other issues.

Has this ever worked?  Did it just start failing?  What changed?

Do you have anything wierd in your /etc/profile, ~/.profile or whatever other login files you use?

 

>># man securetty
>>No manual entry for securetty.

That is true, but /etc/securetty still works.  If you have the word 'console' on the /etc/securetty file then you will only be able to login with root directly from the console.

 

Highlighted
Honored Contributor

Re: Direct login of root is not working

> That is true, but /etc/securetty still works. [...]

   Perhaps, but I don't have one, and I have no trouble logging in as
"root" using Telnet, rsh, or ssh.

rux# ls -l /etc/securetty
/etc/securetty not found

I assume that "In our server /etc/securetty file is not available."
means that Chandra441 also doesn't have one.  But, as usual, showing
actual commands with their actual output can be more helpful than vague
descriptions or interpretations.

> [...]
> Connection closed by <ip of ruby>

>    Are you getting any interesting messages in the system log file
> ("/var/adm/syslog/syslog.log"?)?

   Still wondering.

> i have tried using 'telnet' , 'rlogin' and 'ssh' but nothing worked.

   Any actual error messages from other attempts?  "doesn't work" is not
a useful problem description.

Highlighted
Occasional Advisor

Re: Direct login of root is not working

@Patrick Wallek

When i try to login using root atleast i am getting username prompt but no password prompt.

After entering username as root its getting struck there and after sometime time out error pop-up is displaying.

For telnet or rlogin not even username prompt i can see.

Otherthan console login no other logins are working.

 

Previously everything was fine.

At the time of Annual shutdown after restarting machines i am facing this issues.

My /etc/profile is normal like other machines which are working.

the /etc/securetty file is not existing in our machine.

If this is causing the error please provide instructions how to create /etc/securetty file

Highlighted
Occasional Advisor

Re: Direct login of root is not working

@Steven Schweda

when ever i try to login using ssh in /var/adm/syslog/syslog.log i can see the below data

May 31 01:45:28 ruby sshd[9141]: SSH: Server;Ltype: Version;Remote: 135.254.237.5-49205;Protocol: 2.0;Client: PuTTY_Release_0.69
May 31 01:45:28 ruby sshd[9141]: SSH: Server;Ltype: Kex;Remote: 135.254.237.5-49205;Enc: aes256-ctr;MAC: hmac-sha2-256;Comp: none [preauth]
May 31 01:45:38 ruby sshd[9141]: SSH: Server;Ltype: Authname;Remote: 135.254.237.5-49205;Name: root [preauth]

now rlogin is working for ruby machine

ssh is  not working

root@ruby:/ # ps -ef | grep sshd
root 10343 6733 0 01:51:31 ? 0:00 sshd: [accepted]
root 6733 1 0 May 28 ? 0:00 /opt/ssh/sbin/sshd
root 10630 9318 0 01:53:25 pts/0 0:00 grep sshd
sshd 10344 10343 0 01:51:31 ? 0:00 sshd: [net]
root@ruby:/ #

 

when ever i try to use telnet i am getting error like server closed unexpectedly.

 

Highlighted
Frequent Visitor

Re: Direct login of root is not working

Even though this is an old thread, I have had the same issue, just to find out it was a problem with the DNS entries defined in /etc/resolv.conf. Once I corrected that, the server was able to take ssh logins from root and/or any other username.