Logging in as root get "/bin/bash: Permission denied"
root@172.29.0.21's password:
Last login: Sun Jun 8 23:28:06 2008 /bin/bash: Permission denied Connection to 172.29.0.21 closed. I tried ssh, and direct console same results. All the permissions look ok... not to mention I'm logging in as root. Doesn't root have full access to everything? I can access the file system by mounting it and chroot to the mount. Any ideas what it's looking for? |
This could be a number of reasons,..
1. home folder deleted 2. wrong password ... I would suggest booting into single user mode and checking what is causing the error |
Quote:
According to the /var/log/secure it's logging in fine. The /root folder exists with 750 and the password I did an passwd to change it. So it's definitely not that. Went to single user mode and I'm sitting at a sh-3.1# prompt. What do I check from here? Any other suggestions? |
Is Root Login Via SSH enabled? There is an option to disable root Login via SSH so if this is set the root login fails and you can only login as normal user and then su to root.
/etc/ssh/sshd_config and set "PermitRootLogin" to "yes". |
What does 'ls -l /bin/bash' output?
Forrest |
Quote:
Enabled or not it wouldn't explain why I can't even log in on the console. ls -l /bin/bash -rwxr-xr-x 1 root root 722684 Jan 5 2007 /bin/bash |
OK, it might be your .login, .profile, or .bashrc file is having an error. Try moving the root home directory out of the way and creating a new one that is empty and see if you can log in.
HTH Forrest |
Quote:
mv root root-bk mkdir root still same problem. |
You can check also the libraries on which the /bin/bash executable depends:
Code:
ldd /bin/bash |
Quote:
Checked all the libraries listed and all they're symbolic links. Permissions are either 0755 or 0777 |
Stop looking I found it ;)
found it. Booting the kernel with selinux=0 solved my problem.
I always forget about that stupid selinux. Most times programs say denied by firewall. selinux tends to just silently block things... (where's the beading my head against a wall emoticon... ) One of these days I'll remember to check it first. *ARRRRR!* Thanks for all the quick responses... |
OK, then perhaps it is a permission with one of the libraries that bash is calling. The command 'ldd /bin/bash' will tell you which libraries it is using. Some of them are links that point to other links, but eventually they all point to a real file. Look at the permissions of the real files. On my system they are all 755 root:root.
Note: The file linux-gate.so isn't really a file, it is a virtual dynamically shared object (DSO) that is part of the kernel. HTH Forrest |
I guess I shouldn't hit submit on a post I was working on 45 minutes ago but had to put off due to working on other things without refreshing it to see if someone else already answered the question. :p
Oh well, at least you figured it out. Forrest |
selinux?
@MikeyCarter, did you figure out what exact triggered SELINUX? I know this was a six years old post, but I am seeing exact same symptom on Fedora 20 after an update.
Thanks. |
Quote:
|
All times are GMT -5. The time now is 11:22 AM. |