Operating System - Linux
1828492 Members
2615 Online
109978 Solutions
New Discussion

Re: Problem login with root

 
Kenneth Leung_2
Frequent Advisor

Problem login with root

I got "password incorrect" when I try to "su" to root or "login" with root at console.

However, when I use the "User Manager" in the X-windows, it prompts me to key in the root password. I tried with the root password I got and it succeeded. Therefore, I guess there may be some setting that blocked me from root login. Can somebody help? Thanks a lot.
6 REPLIES 6
Stuart Browne
Honored Contributor

Re: Problem login with root

I'd start by looking at the contents of '/etc/securetty', and the contents of '/etc/pam.d/su'.

I'm picking that someone has restricted the 'su' access to either only work from securetty's, or only from specific users.
One long-haired git at your service...
Mobeen_1
Esteemed Contributor

Re: Problem login with root

I think you would need to take a look at the file /etc/securetty to see if some one has blocked su to root for specific users. If there is such a thing, remove the same and try again, you should be fine.

If you are unable to figure out, list the contents of /etc/securetty and we would be able to help you determine the changes that need to be made

rgds
Mobeen
Kenneth Leung_2
Frequent Advisor

Re: Problem login with root

Hello,

The problem is someone has set the "/etc/securetty" with read-only to root......

Re: Problem login with root

Don't you need to be in the same group as root (wheel) to su ??
Stuart Browne
Honored Contributor

Re: Problem login with root

Jeah-christophe,

That is not a default on any distribution I'm aware of. It can be easily set up using PAM however (put in:

auth sufficient /lib/security/pam_wheel.so trust use_uid

But on most dist's I've seen, it's commented out by default).
One long-haired git at your service...
Roberto Polli
Trusted Contributor

Re: Problem login with root

For su, this /etc/pam.d/su works for me


#%PAM-1.0
auth sufficient /lib/security/pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient /lib/security/pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required /lib/security/pam_wheel.so use_uid
auth required /lib/security/pam_stack.so service=system-auth
account required /lib/security/pam_stack.so service=system-auth
password required /lib/security/pam_stack.so service=system-auth
session required /lib/security/pam_stack.so service=system-auth
session optional /lib/security/pam_xauth.so

anyway you should read pam manual to keep your box secure
Let Me Know,
Peace, R.