System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

The console ttyS0 do not allow login with correct password and username root in Cetnos 6.3

chuiking
Occasional Contributor

The console ttyS0 do not allow login with correct password and username root in Cetnos 6.3

Hi,

 I install Centos 6.3 in to G7 server . I config the console port .That is ttyS0 .

 

I add below file /etc/init/serial-ttyS0.conf  with below content .

[code]

# This service maintains a getty on /dev/ttyS1.
start on stopped rc RUNLEVEL=[2345]
stop on starting runlevel [016]
respawn
exec /sbin/agetty /dev/ttyS0 19200 vt100

 

[\code]

 

add ttyS0 in /etc/security/securetty

 

So, the getty ttyS0 can be up after reboot.

 

From console , I can get login prompt  "login:"  and I type username "root" , password " password".

I cannot login .

In /var/log/secure ,  I can see below

[code]

Nov 20 14:00:46 localhost login: pam_unix(login:auth): authentication failure; logname= uid=0 euid=0 tty=ttyS0 ruser= rhost=  user=root
Nov 20 14:00:48 localhost login: FAILED LOGIN 1 FROM (null) FOR root, Authentication failure

 

[\code]

 

in /etc/pam.d/login file ,

there is below line for "auth"...

 

auth       required     pam_sepermit.so
auth       include       system-auth

 

 

So, from my understand , the pam_sepermit is check the /etc/securetty and see ttyS0 is in it or not .

Then system-auth check the /etc/password in linux .

Why I cannot login with console ttyS0  ???

 

I can use ssh to the same box and login as root with the same password .

In the /var/log/secure , you can see

[code]

Nov 20 14:13:46 localhost runuser: pam_unix(runuser:session): session opened for user uuidd by (uid=0)
Nov 20 14:13:46 localhost runuser: pam_unix(runuser:session): session closed for user uuidd
Nov 20 14:13:58 localhost sshd[3414]: Accepted password for root from 10.1.4.40 port 7591 ssh2
Nov 20 14:13:58 localhost sshd[3414]: pam_unix(sshd:session): session opened for user root by (uid=0)

 

[/code]

 

So, if use ssh to login , it will call the runser and sshd file in /etc/pam.d/ ...

 

But if I only comment out the line with system-auth in /etc/pam.d/login file ...

I can login console without type password in ttyS0 ...

 

So, what setting I need to do ....

 

I can login to system using montior and usb keyboard .That is using tty1 ...it is ok ...

 

Please advice what is missing in ttyS0 ????

 

Thank