LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2005, 02:53 PM   #1
larry_linux
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Rep: Reputation: 0
ALL permissions denied for root


I REALLY need help.

I cannot do ANYTHING on my RedHat Enterprise distro.

I do not have permissions for ANYTHING, even as superuser or root.

EXAMPLE:

[admin@localhost ~]$ su -
Password:
[root@localhost root]$ whoami
root
[root@localhost root]$ pwd
/root
[root@localhost root]$ touch x
touch: creating `x': Permission denied <<<<<<< !!!!!!!!!!!!!!!!!

--------------------------------------------------------------------------

[root@localhost root]$ df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda2 32G 2.1G 28G 8% /
/dev/sda1 97M 26M 67M 28% /boot
none 626M 0 626M 0% /dev/shm

--------------------------------------------------------------------------

[root@localhost root]$ mount

/dev/sda2 on / type ext3 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)

--------------------------------------------------------------------------

[root@localhost root]$ set

BASH=/bin/bash
BASH_ENV=/root/.bashrc
BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i386-redhat-linux-gnu")
BASH_VERSION='2.05b.0(1)-release'
COLORS=/etc/DIR_COLORS
COLUMNS=132
DIRSTACK=()
EUID=4294967295
GROUPS=()
G_BROKEN_FILENAMES=1
HISTFILE=/root/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/root
HOSTNAME=localhost.localdomain
HOSTTYPE=i386
IFS=$' \t\n'
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
LANGVAR=en_US.UTF-8
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=49
LOGNAME=root
LS_COLORS='no=00:fi=00:di=01;34:ln=01;36i=40;33:so=01;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi =01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=0 1;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.g z=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01; 35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:'
MACHTYPE=i386-redhat-linux-gnu
MAIL=/var/spool/mail/root
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/root/bin
PIPESTATUS=([0]="0")
PPID=24842
PS1='[\u@\h \W]\$ '
PS2='> '
PS4='+ '
PWD=/root
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SUPPORTED=en_US.UTF-8:en_US:en
TERM=vt100
UID=4294967295
USER=root
USERNAME=root
_=mount

--------------------------------------------------------------------------

[root@localhost root]$ ls -l .*

-rw------- 1 0 root 8220 Sep 1 19:52 .bash_history
-rw-r--r-- 1 0 root 24 Jun 10 2000 .bash_logout
-rw-r--r-- 1 0 root 233 Jun 9 11:00 .bash_profile
-rw-r--r-- 1 0 root 176 Aug 23 1995 .bashrc
-rw-r--r-- 1 0 root 244 Mar 14 15:40 .cshrc
-rw-r--r-- 1 0 root 51 Jul 11 11:38 .fonts.cache-1
-rw-r--r-- 1 0 root 120 Aug 24 2004 .gtkrc
-rw-r--r-- 1 0 root 130 Feb 16 2005 .gtkrc-1.2-gnome2
-rw------- 1 0 root 0 Feb 19 2005 .ICEauthority
-rw------- 1 0 root 0 Feb 16 2005 .recently-used
-rw------- 1 0 root 559 Feb 16 2005 .rhn-applet.conf
-rw-r--r-- 1 0 root 196 Jul 11 2000 .tcshrc
-rw------- 1 0 root 164 Feb 16 2005 .Xauthority
-rw-r--r-- 1 0 root 1126 Aug 23 1995 .Xresources
-rw------- 1 0 root 1112 Feb 16 2005 .xsession-errors

.:
total 36
-rw-r--r-- 1 0 root 1182 Feb 1 2005 anaconda-ks.cfg
-rw-r--r-- 1 0 root 21765 Feb 1 2005 install.log
-rw-r--r-- 1 0 root 4247 Feb 1 2005 install.log.syslog

..:
total 201
drwxr-xr-x 2 0 root 4096 Feb 1 2005 bin
drwxr-xr-x 4 0 root 1024 Feb 1 2005 boot
-rw-r--r-- 1 0 root 561 Mar 4 2005 csh.cshrc
drwxr-xr-x 22 0 root 118784 Feb 19 2005 dev
drwxr-xr-x 64 0 root 8192 Sep 1 18:00 etc
drwxr-xr-x 5 0 root 4096 Jun 17 09:29 home
drwxr-xr-x 2 0 root 4096 Jan 24 2003 initrd
drwxr-xr-x 11 0 root 4096 Feb 1 2005 lib
drwx------ 2 0 root 16384 Feb 1 2005 lost+found
drwxr-xr-x 2 0 root 4096 Nov 11 2004 misc
drwxr-xr-x 4 0 root 4096 Feb 1 2005 mnt
drwxr-xr-x 2 0 root 4096 Jan 24 2003 opt
dr-xr-xr-x 86 0 root 0 Feb 19 2005 proc
drwxr-x--- 14 0 root 4096 Jul 11 13:51 root
drwxr-xr-x 2 0 root 8192 Feb 1 2005 sbin
drwxrwxrwt 9 0 root 4096 Sep 10 11:50 tmp
drwxr-xr-x 17 0 root 4096 Jun 17 09:13 usr
drwxr-xr-x 23 0 root 4096 Feb 1 2005 var
ls: .elinks: Permission denied
ls: .gconf: Permission denied
ls: .gconfd: Permission denied
ls: .gnome: Permission denied
ls: .gnome2: Permission denied
ls: .gnome2_private: Permission denied

.gnome-desktop:
total 12
-rwx------ 1 0 root 128 Feb 16 2005 root's Home
-rw-r--r-- 1 0 root 2789 Feb 16 2005 starthere.desktop
-rwx------ 1 0 root 124 Feb 16 2005 Trash

.gstreamer:
total 4
-rw-r--r-- 1 0 root 104 Feb 1 2005 registry.xml
ls: .metacity: Permission denied
ls: .mozilla: Permission denied

.nautilus:
total 8
-rw-r--r-- 1 0 root 153 Feb 16 2005 first-time-flag
drwx------ 2 0 root 4096 Feb 16 2005 metafiles
ls: .ssh: Permission denied

--------------------------------------------------------------------------
 
Old 09-10-2005, 02:59 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
As best as I can tell, the numeric UID for root has been changed in /etc/passwd. Can you do 'grep root /etc/passwd' and post the output here?
 
Old 09-10-2005, 03:04 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

Your files/dirs seem to be owned by 0 (zero). This should have translated to root. I.e:

drwxr-x--- 20 root root 4096 Sep 2 19:29 root

instead of:

drwxr-x--- 20 0 root 4096 Sep 2 19:29 root

Looks like your root entry got messed up. Check and see if root is present in /etc/passwd. Looks like this:

root:x:0:0:root:/root:/bin/bash

Hope this helps.
 
Old 09-10-2005, 03:06 PM   #4
larry_linux
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Reply: ALL permissions denied for root

Thanks Dave!

[root@localhost root]$ grep root /etc/passwd

root:x:-1:0:root:/root:/bin/bash
operator:x:11:0perator:/root:/sbin/nologin

What's the -1 mean? Is that the proglem? Root does not have permission to alter any files!
So how do I fix that?
 
Old 09-10-2005, 03:16 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
How that ever got changed to -1 is beyond me. But -1 would make a serious mess of things. It's supposed to be 0.
 
Old 09-10-2005, 03:25 PM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

Only way I can come up with to cure this is to:

1) boot from a live/rescue cd,
2) mount /dev/sda2,
3) edit (mountpoint to)/etc/passwd/passwd (change -1 to 0),
4) unmount,
5) reboot.

Hope this gets you going again.
 
Old 09-10-2005, 03:31 PM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
You *MIGHT* be able to boot into single user mode and have it give you UID 0.
 
Old 09-11-2005, 02:20 AM   #8
Mr. Swillis
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 94

Rep: Reputation: 16
When all else fails, boot a knoppix cd and modify files that way.
Go here http://www.knopper.net/knoppix/index-en.html and download a knoppix .iso and burn it.
Pop it in the cd drive and reboot the system. When you arive at the knoppix desktop, it should have already found all your mount points.
Then you may be able to 'vi /mnt/hd(whatever)/etc/passwd' and change that 1 to a 0.

Also, what happens if you become root and type 'passwd root'? If it let's you...try changing the password. That may not do anything,
but it's one of my late night '"sounds crazy enough to work" ideas that may help.
 
Old 09-11-2005, 11:39 AM   #9
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
Changing a password won't change the uid. Knoppix is a good idea, though booting as 'linux single' or 'linux init=/bin/bash' might also work well.
 
Old 09-13-2005, 12:15 AM   #10
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
Knoppix is a good idea, though booting as 'linux single' or 'linux init=/bin/bash' might also work well
Yeah you could also boot off the redhat install CD 1 and go into rescue mode and edit it from there. It saves you the ~700MB download and
in my experience some Knoppix versions seem to have trouble mounting LVM partitions, which are quite common on RHEL installs.
 
  


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
SuExec with Apache: permissions denied bmorel Linux - Software 1 05-25-2005 05:33 AM
Denied Permissions Jeebizz Slackware 4 09-05-2004 03:08 PM
/bin/sh - bad interperator, permissions denied perry Linux - Software 5 11-28-2003 10:14 AM
file permissions on VFAT partition - access denied cevjr Linux - Security 3 09-04-2003 04:50 PM
NFS - can't mount - permissions denied error mchitsquad Mandriva 2 09-01-2003 05:23 PM


All times are GMT -5. The time now is 01:09 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