Operating System - Linux
1820475 Members
2964 Online
109624 Solutions
New Discussion юеВ

Unable to su to root user ,

 
SOLVED
Go to solution
hangyu
Regular Advisor

Unable to su to root user ,

I have change all file permission under /etc to 777 , now can't su to root user , can advise what can i do ? thx

su: cannot set groups: Operation not permitted
3 REPLIES 3
Matti_Kurkela
Honored Contributor
Solution

Re: Unable to su to root user ,

You've probably removed the SUID permission bit from the su command, so it can no longer change an user's identity.

First, try to log in as root from the console. This is probably your only chance to be able to recover from this without downtime.

If that does not help, it would probably be easiest to restore from a Ignite back-up, if you have one. Other options require more manual effort.

Another option would be to boot into a single-user mode and then restore the permissions.

If that does not work, boot from the installation CD-ROM/DVD and run a recovery shell.

Go to itrc.hp.com -> Navigate Knowledge Trees -> HP-UX Software Recovery Handbook. Read at least chapter 4.
MK
Matti_Kurkela
Honored Contributor

Re: Unable to su to root user ,

Oops, HP-UX answer to Linux question.

Let me try again.

Try logging in as root from the console: if it works, check permissions from another host with same Linux version and fix manually. You might want to "chmod 644 /etc/passwd /etc/group" and "chmod 640 /etc/shadow" as soon as possible.

If logging in as root from console does not work, reboot from installation media and select "rescue mode". You can also use Knoppix or any other Live-CD Linux distribution as a rescue tool.

If you have an up-to-date backup, you might want to get a verbose directory listing ("ls -l" style) from the latest backup and use that as a guide to correct permissions.

You may have to make all users change their passwords: anybody with an user account on this host could have made a copy of /etc/shadow and /etc/passwd and might now be trying to crack the password hashes. If you cannot be sure this has not happened, all the password must be regarded as compromised.
MK
Vipulinux
Respected Contributor

Re: Unable to su to root user ,

Hi

You need to see if you have following permission on su, passwd and shadow:
-rwsr-xr-x 1 root root 53024 Jun 20 2005 su
-rw-r--r-- 1 root root 1768 Oct 11 16:28 /etc/passwd

-r-------- 1 root root 1138 Oct 11 16:28 /etc/shadow


Cheers