cannot execute /bin/bash: Permission Denied
I'm probably gonna feel like a real noob when someone tells me how to fix this, but, here goes...
I've had LFS up and running for a week now. Been snooping around and looking at how the system is set up. Decided to actually start using it, so I figured I'd better set up a user account. Well, after I got it set up, Tried to login with it. Got the "cannot execute /bin/sh: Permission Denied" thing. Well I checked permissions on both the /bin/sh link (777) and /bin/bash (755). So I said to myself, why is it using sh? Looked in the passwd file, found that and changed it to /bin/bash. Checked for a /home/peeples directory, it wasn't there, so I added it via root account and chown peeples: peeples. Since it was a new directory it was empty, so I copied .bash* from my base distro into this new directory. Tried to login with user again, got "cannot execute /bin/bash: Permission Denied". Since it changed from /bin/sh to bin/bash, I now know that it's reading the passwd file correctly. I double-checked ownership of my home directory, everything is correct. When I looked in /bin everything is root:root, all links are 777, and all other files are 755, that's right, isn't it? How can I get my user account running? TIA |
Check the permissions on the / directory. If it's not set to something like 755 the normal users aren't able to get to their home directories or any other directories, no matter if /bin itself has proper permissions. / is the first directory accessed and it needs to be 755 too.
So run ls -ld / and see what it reports and fix accordingly if something is out of the ordinary. |
Permissions on / are correct at 755. Anything else to check?
|
How about the /home directory itself?
|
/home is owned by root:root (755). What next?
BTW, the permissions and ownership don't change, right? Because instead of rebooting into my LFS to check this stuff, I've just mounted the partition under /lfs in my base distro. Then I just cd to the parent directory and type ls -la. If I have to reboot it's no problem, I just don't want to waste your time if I'm giving you wrong answers... Thanks. |
It might be a factor, depending on how your partitions are mounted according to the $LFS/etc/fstab file
Best is to actually boot into LFS and give the outputs of these commands: ls -ld / /home /home/youruser It should give output similar to this: gerard@lorien:~$ ls -ld / /home /home/gerard drwxr-xr-x 16 root root 360 Oct 15 12:36 / drwxr-xr-x 9 root root 192 Oct 16 15:03 /home drwxr-x--- 55 gerard gerard 4016 Oct 19 18:19 /home/gerard |
Ok, I booted into lfs. Logged in as root. then typed:
ls -ld / /home /home/peeples > test This is what was in the test file: drwxr-xr-x 19 root root 4096 Oct 19 14:45 / drwxr-xr-x 3 root root 4096 Oct 19 08:12 /home drwxr-xr-x 2 peeples peeples 4096 Oct 19 14:49 /home/peeples |
Uhmmm /me scratches his head
Why are we checking the /home/peeples directory again when the error shows /bin/bash Permission Denied Run this ls -ld /bin Does it have a mode of 755 too? |
Booted back into LFS.
ls -ld /bin gives root:root at 755 Went into /etc/passwd again. This is its contents: root:U/7pZokqZN8v6:0:0:root:/root:/bin/bash peeples:Dn8YWXGhsP/2o:506:506:peeples:/home/peeples:/bin/bash (except change the smilies back to their text equivilents) Also looked in /etc/group. This is its contents: root:x:0: bin:x:1: sys:x:2: kmem:x:3: tty:x:4: tape:x:5: daemon:x:6: floppy:x:7: disk:x:8: lp:x:9: dialout:x:10: audio:x:11: peeples:x:506: What next? |
Still having this problem. Cannot find answers on IRC. Please help...
|
Boot LFS run "/bin/mount" and show the line that represents your root partition.
|
The results of /bin/mount are as follows:
rootfs on / type rootfs (rw) /dev/root on / type ext2 (rw) proc on /proc type proc (rw) /dev/hda2 on /redhat type ext3 (rw) denny |
I admit, I've no idea. The mount options are right and the permission on all paths involved are right too.
Can you login as root? If so, login as root, then sun this: "su - peeples" make sure you type that - as it means that the session will be a login session. Do you get errors? |
Rebooted to LFS. Logged in as root. Typed "su - peeples" and got:
No mail. cannot execute /bin/bash: Permission Denied and it kicked me back to login: prompt. I logged back in as root, added a new user peeps, made a password for that account, and made a home directory owned by peeps at 755. Tried logging in with that account and recieved: Last login at blah, blah, blah No mail. cannot execute /bin/bash: Permission Denied That was on the first login with peeps account. I don't know where it came up with a prior login time. So, the only account that works is root. Denny |
Have you tried changing your entry in /etc/passwd for any given user from /bin/bash to /bin/sh just to see if you get another response, or any other shell?
Just trying to toss out suggestions as well Cool |
All times are GMT -5. The time now is 12:22 PM. |