LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-10-2004, 05:43 PM   #1
Nightfrost
Member
 
Registered: Jun 2004
Location: Sweden
Distribution: ArchLinux
Posts: 201

Rep: Reputation: 30
root gets permission denied


I've encountered this weird problem a couple of times now; I get persmission denied as root.

First time was when I was attemtping to run a self-extracting file, downloaded from java's page. And this time is when trying to make a gentoo installation on a different partition. I need to chroot like so:

Code:
chroot /mnt/gentoo /bin/bash
and I get permission denied with respect to /bin/bash.

Does anyone know what the reason is? It's not really a big deal but it would spare me a few detours, so to speak.

Cheers.
 
Old 11-10-2004, 05:55 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
does the /bin/bash (inside the chroot) have +x permission set?
 
Old 11-10-2004, 05:59 PM   #3
Nightfrost
Member
 
Registered: Jun 2004
Location: Sweden
Distribution: ArchLinux
Posts: 201

Original Poster
Rep: Reputation: 30
thanks for the reply.

Yep; I ran a chmod +x on it. (I'm sure it's executable as default, though)...
 
Old 11-10-2004, 07:35 PM   #4
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Hmm.. that is strange.

Can you (kind of)chroot into your current system?
eg.
Code:
chroot / /bin/bash
If so you can, then to debug this problem you could try first building a minimal copy of your root directory (leave out atleast /usr and /home) and see if that works. If it still works, try replacing some of it with a copy from your gentoo tree. Continue untill it stops working and take one step back. Where are you now?
 
Old 11-10-2004, 08:16 PM   #5
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
This has happened to me a few times recently and every time it's been because I tried to run a non-existent program or one that was faulty in some way. Seems a strange error message under the circumstances, but that's what I got.
 
Old 11-10-2004, 09:03 PM   #6
zuralin
Member
 
Registered: Sep 2003
Distribution: Debian testing/unstable
Posts: 225

Rep: Reputation: 30
what about just
# chroot /mnt/gentoo

Just out of curiosity, because it defaults to /bin/sh which should point to /bin/bash
 
Old 11-11-2004, 03:45 AM   #7
Nightfrost
Member
 
Registered: Jun 2004
Location: Sweden
Distribution: ArchLinux
Posts: 201

Original Poster
Rep: Reputation: 30
Quote:
Can you (kind of)chroot into your current system?
eg.
yep, I could chroot to /; I'll try to do the debugging as soon as I find the time (at least I think I got how you mean). Thanks.

Quote:
what about just
# chroot /mnt/gentoo

Just out of curiosity, because it defaults to /bin/sh which should point to /bin/bash
Tried this, and you're right it defaults to /bin/bash, and returns a permission denied...

I have flawlessly been going through this whole procedure a few months ago, under a different debian installation. One of the main differences between this debian setup and the former (if my memory gives) is the kernel - I have a customized one now which is probably somewhat unstable. I wouldn't think the kernel would have anything to do with it, but I'll reboot with a standard kernel to try it out. I'll report my results afterwards.
 
Old 11-11-2004, 03:51 AM   #8
Nightfrost
Member
 
Registered: Jun 2004
Location: Sweden
Distribution: ArchLinux
Posts: 201

Original Poster
Rep: Reputation: 30
OK; I knew it was a far shot ...and it didn't work...
 
Old 11-11-2004, 08:05 AM   #9
zuralin
Member
 
Registered: Sep 2003
Distribution: Debian testing/unstable
Posts: 225

Rep: Reputation: 30
Could you show us:
# ls -l /mnt | grep gentoo
 
Old 11-11-2004, 04:11 PM   #10
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
ok.

One -- possibly quicker -- way to debug that:
try running
Code:
apt-get install debootstrap
mkdir testroot
debootstrap sid ./testroot http://ftp.se.debian.org/debian/
chroot ./testroot
Does that work?

(Those commands builds debian chroot environment from sid packages, instead than from the running system, as I suggested earlier. This takes some time to download, but doesn't require that much human effort.)
 
Old 11-11-2004, 04:58 PM   #11
Nightfrost
Member
 
Registered: Jun 2004
Location: Sweden
Distribution: ArchLinux
Posts: 201

Original Poster
Rep: Reputation: 30
Quote:
Could you show us:
# ls -l /mnt | grep gentoo
Here are all the steps

Code:
home:/home/nightfrost# mount /mnt/gentoo
home:/home/nightfrost# mount -t proc none /mnt/gentoo/proc
home:/home/nightfrost# chroot /mnt/gentoo /bin/bash
chroot: cannot run command `/bin/bash': Permission denied
home:/home/nightfrost# ls -l /mnt | grep gentoo
drwxr-xr-x  18 root root 456 2004-07-11 19:30 gentoo
home:/home/nightfrost#
Quote:
ok.

One -- possibly quicker -- way to debug that:
try running

code:

apt-get install debootstrap
mkdir testroot
debootstrap sid ./testroot http://ftp.se.debian.org/debian/
chroot ./testroot


Does that work?

(Those commands builds debian chroot environment from sid packages, instead than from the running system, as I suggested earlier. This takes some time to download, but doesn't require that much human effort.)
Thanks a lot for the suggestion; but I've decided the whole debugging-thing takes too much of my time right now (so much school work right now it's amazing )... I'll do that as soon as I have some spare time...
 
Old 11-12-2004, 01:14 PM   #12
zuralin
Member
 
Registered: Sep 2003
Distribution: Debian testing/unstable
Posts: 225

Rep: Reputation: 30
Actually, how about if you mount /mnt/gentoo/proc AFTER you chroot /mnt/gentoo.
 
Old 11-15-2004, 11:09 AM   #13
Nightfrost
Member
 
Registered: Jun 2004
Location: Sweden
Distribution: ArchLinux
Posts: 201

Original Poster
Rep: Reputation: 30
Quote:
Actually, how about if you mount /mnt/gentoo/proc AFTER you chroot /mnt/gentoo.
Sorry; no work. I'm starting to wonder if there's any way possible for root to lose some of it's permissions - I mean possible at all. If that is so; what could cause it?
 
Old 11-15-2004, 11:25 AM   #14
zuralin
Member
 
Registered: Sep 2003
Distribution: Debian testing/unstable
Posts: 225

Rep: Reputation: 30
For starters, the uid and gid wouldn't be 0.
 
Old 11-15-2004, 11:30 AM   #15
Nightfrost
Member
 
Registered: Jun 2004
Location: Sweden
Distribution: ArchLinux
Posts: 201

Original Poster
Rep: Reputation: 30
uid is 0.
# groups

returns

# root

...so I guess gid is 0 too..
 
  


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
permission denied as root Foosed Slackware 6 06-06-2005 01:38 AM
permission denied when root? TaNeK Linux - Software 8 02-01-2005 01:39 PM
Permission denied as root Cynric Linux - General 4 08-15-2004 12:47 PM
Even as root, Permission Denied RevX Linux - Software 7 04-25-2004 12:10 AM
permission denied even as root awolff01 Linux - Software 8 02-28-2003 08:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration