Operating System - HP-UX
1833873 Members
2144 Online
110063 Solutions
New Discussion

Re: root can't login from console

 
SOLVED
Go to solution
System Unix
Frequent Advisor

root can't login from console

I have an HPUX 11i trusted mode system.I am not able to login to console as root. It gives me an error saying that login incorrect.
I can login as anyother user at console and then su to root, it works.The root login also works from anywhere else.

What to why it is happening and how it could be taken care?
Reuven
23 REPLIES 23
Patrick Wallek
Honored Contributor

Re: root can't login from console

See if you have an /etc/securetty file.

# ll /etc/securetty

If so do:

# cat /etc/securetty

If it has anything besided the word console in it, it is probably incorrect. You usually use this file to allow root access from the console only. The file should look like:

# cat /etc/securetty
console

Michael Tully
Honored Contributor

Re: root can't login from console

Remove the /etc/securetty file
Test it.

re-create new /etc/securetty file with the word console in it.
test

echo "console" >/etc/securetty
Anyone for a Mutiny ?
System Unix
Frequent Advisor

Re: root can't login from console

There is no /etc/securetty file.

Reuven
Steven E. Protter
Exalted Contributor

Re: root can't login from console

A question matrix to help as I will be unavailable for 48 hours.

Can OTHER users log in from the console?

If so, log in as one of them, su - root and report results.

The most likely cause of this problem is when you went trusted root expired, but console login is supposed to work.

You do need a /etc/securetty file in order for anyone to login from the console.

You might need to boot the system into single user mode and follow the instructions above.

Single user mode:

Boot either with powerswitch or root logon that still works, shutdown -ry now

At the 10 second prompt interupt.

bo pri
Y when prompted to interact with the IPL

hpux -is for single user mode.
hpux -lm if you ever need to go into lvm mode.

In single user mode, follow the instructions in the prior post and you should be okay.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
System Unix
Frequent Advisor

Re: root can't login from console

Can OTHER users log in from the console?
>> Yes

If so, log in as one of them, su - root and report results.
>> As earlier mentioned, can login as anyother user and su - as root.
Reuven
System Unix
Frequent Advisor

Re: root can't login from console

?????

Need a solution ? Problem still persists.

TIA
Reuven

Re: root can't login from console

If you have not tried this before.

Login as other user and su to root.
#ps -ef|grep console
#kill -9 "PID of getty process for console"

Now try to login on console as root

System Unix
Frequent Advisor

Re: root can't login from console

Had tried that also.Would not work.
Reuven

Re: root can't login from console

Hi

How are you connecting to console?
Is console directly connected to a terminal or you are using remote console.

This is to make sure if you are using remote console you are connecting to right one.
John Payne_2
Honored Contributor

Re: root can't login from console

Could it be a problem with your root password? Logging in and su-ing are actually doing slightly different things... What happens when you su to root, change your password, and then try to log into the console as root?

Hope it helps

John
Spoon!!!!
System Unix
Frequent Advisor

Re: root can't login from console

Console is connected directly thru serial port. It is an HP dumb terminal.
Reuven
John Poff
Honored Contributor

Re: root can't login from console

Hi,

Just a crazy question for you, but when you login on the console, what does the 'tty' command return?

JP
John Poff
Honored Contributor

Re: root can't login from console

Hi again,

Also, can you telnet to the box and login directly as root, or do you have the same problem there?

You mentioned that this is a trusted system. Has this problem just started recently or has it always been this way? If it just started, how long has this system been trusted?

JP
System Unix
Frequent Advisor

Re: root can't login from console

I can't login from remote machines doing telnet. We are using ssh to log on.

Reuven

Re: root can't login from console

Have you tried resetting root password.

Logon on the system as root by either ssh or su
and reset the root passwd as
#/usr/lbin/modprpw -k root
#/usr/lbin/modprpw -x root

Now try to logon console using new root password.
John Poff
Honored Contributor

Re: root can't login from console

Hi,

Just a couple of suggestions. First, try Michael Tully's advice and go ahead and create an /etc/securetty file with the 'console' entry in it. Since you are running a secure system, you probably will want to restrict root to logging in from the console anyway.

If that doesn't work, I'll repeat my previous question and ask what the 'tty' command returns when you are logged in at the system console.

JP
V. V. Ravi Kumar_1
Respected Contributor
Solution

Re: root can't login from console

hi,
Create a /etc/securetty as suggested. one more thing, have u changed root's password recently, if so check that any @ or # like characters are there in the password. these characters in root's password give's problem. remove them and try.

Regards
Never Say No
Darren Prior
Honored Contributor

Re: root can't login from console

Hi,

Can you post the output of /usr/lbin/getprpw root?

Also, can you post the console line from /tcb/files/ttys, and from /tcb/files/devassign.

I'm hoping that one of these may show some form of locking, or that root is not allowed to use the console.

Furthermore I suggest that you delete /etc/securetty and check whether you can login as root at the console. This file is not required for root console access. If the file does exist and is empty or unreadable then root cannot login directly. Any entry in the file is understood to be a terminal that root may login from.

regards,

Darren
Calm down. It's only ones and zeros...
Paula J Frazer-Campbell
Honored Contributor

Re: root can't login from console

HI

On console login as another user - su to root.

cp /etc/passwd /etc/passback
vi /etc/passwd

Under the root entry insert a line and recreate the root entry but with no password.

Delete the old root entry.

exit and login as root.

if that works then create root password.

If it fails login as user - su to root and copy /etc/passback to /etc/passwd.


Paula
If you can spell SysAdmin then you is one - anon
Darren Prior
Honored Contributor

Re: root can't login from console

Hi Paula,

You may have overlooked that this is a trusted system, so root's entry in /etc/passwd will not have an encrypted password

regards,

Darren.
Calm down. It's only ones and zeros...
Paula J Frazer-Campbell
Honored Contributor

Re: root can't login from console

Daren

Good point - I missed that - oops.


I still think a re-write of the root entry will not go amiss.

When did this stop working and what had been done immediatly prior to it occuring.

Paula

If you can spell SysAdmin then you is one - anon
David_246
Trusted Contributor

Re: root can't login from console

Hi,

Someone just gave a very good point here. If you ssh to the system and then su, you have a different character interpetation than on the console.

So by logging in directly as root on the console can block you from loggin in.

A very good option is to change the password to a password without special characters, and test it on the console then.

Also create a file /etc/securetty by :
echo "console" >/etc/securetty
chmod 400 /etc/securetty

Ones logged in on the console (as normal user or root), please give us the output of the "tty" command

Best Regs David
@yourservice
System Unix
Frequent Advisor

Re: root can't login from console

The problem was a special character in the root password.

Thanks a lot you guys for taking time and analysing the problem. You people are marvellous.

I would like to specially thank VV Ravi Kumar and David for their excellent diagnosis.

Reuven