Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180
Rep:
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?
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.
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180
Original Poster
Rep:
/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...
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180
Original Poster
Rep:
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.