LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 10-19-2002, 08:54 AM   #1
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Rep: Reputation: 30
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
 
Old 10-19-2002, 10:06 AM   #2
lfslinux
LFS Maintainer
 
Registered: Jan 2002
Location: Canmore, Alberta, Canada
Distribution: Linux From Scratch
Posts: 372

Rep: Reputation: 30
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.
 
Old 10-19-2002, 02:23 PM   #3
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Original Poster
Rep: Reputation: 30
Permissions on / are correct at 755. Anything else to check?
 
Old 10-19-2002, 02:50 PM   #4
lfslinux
LFS Maintainer
 
Registered: Jan 2002
Location: Canmore, Alberta, Canada
Distribution: Linux From Scratch
Posts: 372

Rep: Reputation: 30
How about the /home directory itself?
 
Old 10-19-2002, 07:33 PM   #5
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Original Poster
Rep: Reputation: 30
/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.

Last edited by peeples; 10-19-2002 at 07:38 PM.
 
Old 10-19-2002, 07:54 PM   #6
lfslinux
LFS Maintainer
 
Registered: Jan 2002
Location: Canmore, Alberta, Canada
Distribution: Linux From Scratch
Posts: 372

Rep: Reputation: 30
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
 
Old 10-19-2002, 09:16 PM   #7
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Original Poster
Rep: Reputation: 30
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
 
Old 10-19-2002, 09:53 PM   #8
lfslinux
LFS Maintainer
 
Registered: Jan 2002
Location: Canmore, Alberta, Canada
Distribution: Linux From Scratch
Posts: 372

Rep: Reputation: 30
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?
 
Old 10-20-2002, 09:43 AM   #9
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Original Poster
Rep: Reputation: 30
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
peeplesn8YWXGhsP/2o:506:506eeples:/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?

Last edited by peeples; 10-20-2002 at 09:45 AM.
 
Old 10-21-2002, 08:20 PM   #10
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Original Poster
Rep: Reputation: 30
Still having this problem. Cannot find answers on IRC. Please help...
 
Old 10-21-2002, 08:49 PM   #11
lfslinux
LFS Maintainer
 
Registered: Jan 2002
Location: Canmore, Alberta, Canada
Distribution: Linux From Scratch
Posts: 372

Rep: Reputation: 30
Boot LFS run "/bin/mount" and show the line that represents your root partition.
 
Old 10-22-2002, 05:41 PM   #12
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Original Poster
Rep: Reputation: 30
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
 
Old 10-22-2002, 06:19 PM   #13
lfslinux
LFS Maintainer
 
Registered: Jan 2002
Location: Canmore, Alberta, Canada
Distribution: Linux From Scratch
Posts: 372

Rep: Reputation: 30
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?
 
Old 10-22-2002, 07:17 PM   #14
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Original Poster
Rep: Reputation: 30
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
 
Old 10-23-2002, 01:46 PM   #15
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/bin/.: Permission denied aizkorri Programming 9 03-17-2010 01:33 PM
su: /bin/bash: Permission denied dwarf007 Linux - General 10 01-20-2006 04:32 PM
Problem Cannot execute /bin/bash: Permission denied xeo Linux - Software 2 10-13-2004 10:55 PM
Cannot execute /bin/bash: Permission denied Hegemon Linux - General 4 01-19-2004 04:13 AM
/bin/sh Permission Denied vi0lat0r Linux - Newbie 1 08-26-2003 07:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 01:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration