Su: /bin/bash: Permission denied

  

Customer oracle suddenly crashed, due to business startup, the customer subconsciously restarted the server, the system is up, ready to switch to the oracle user to start the database, Can not be su switch, it is really on the fire, described as follows: under the root user, su to a normal user oracle, get the following error:

[root@localhost ~]# su - oraclesu: Warning: cannot change directory to /home/oracle: Permission deniedsu: /bin/bash: Permission denied

And oracle user can't log in directly, the same error occurs.

This is a very strange question. What caused it? The ideas are as follows: 1, program execution permission problem 2, program dependent shared library permissions issue 3, directory permissions issue 4, root space problem.

Check /bin/bash, the permissions are correct, check the /home/oracle permissions correctly, check /lib/ld-***.so, the permissions are correct.

Continue debugging, check /etc/passwd, set oracle home to /tmp, set /tmp to 777, this permission should be the most relaxed.

And su has the same error.

That is the oracle user can not access 777 permissions /tmp.

Where is the problem?

At last, through the star command, I saw the problem at all, [root@localhost~]#stat /output is as follows: because you can't see ls. File: “/”Size: 1024 Blocks: 2 IO Block: 1024 Directory Device: 803h/2051d Inode: 2 Links: 22Access: (0666/drw-rw-rw-) Uid: ( 0/root) Gid: ( 0/root)Access: 2007-12-01 22:28:48.000000000 +0800Modify: 2007-12-01 22:28:34.000000000 +0800Change: 2007-12-01 23:17:35.000000000 +0800

The problem came out, the permissions here are wrong, and the loss of X permissions is caused.

[root@localhost ~]#chmod 755 /

After the modification, the problem disappears.

The method of generating the above problem: the first one, chmod 666 /, can cause.

Or, the second, chmod 700 /lib/ld-xxxx.so, can also cause su to fail.

If you are interested, you can try it yourself.

/Loss of permissions has the same effect on various daemons running on their own users.

Copyright © Windows knowledge All Rights Reserved