root access not permitted [SOLVED]

Don´t be shy, Linux is fun! =)
User avatar
skip
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 204
Joined: 27 Oct 2007, 16:00
16
Location: 18th Galaxy

root access not permitted [SOLVED]

Post by skip »

How do i get my root access back? i cant even get in using the login prompt as a normal user but i can access it on console mode(ctrl+alt+F1), i tried as a single user but its the same. everytime i try to get a root access (su) heres what i get.
setgid: operation not permitted
and the output from the login prompt even if i change DE
GDM could not write to your authorization file. This could
mean that you are out of disk space or that your home
directory could not be opened for writing. In any case, it is not
possible to log in. Please contact your system administrator.
heres what happen after losing the permission. check svn of choqok. i put a couple of flash drives, copy/transfer files, change permissions of directories. installed cmake and i know that there still a couple of gigs left so i know that is not yet out of disk space.
Last edited by skip on 08 Jul 2009, 09:29, edited 1 time in total.
Image Image Image

User avatar
remotepwn
Newbie
Newbie
Posts: 7
Joined: 07 Jun 2009, 16:00
14
Contact:

Post by remotepwn »

login console mode (ctrl+alt+F1) and type startx, or init 1 after that type init 5. you should get a graphical environment
If sudo works you can try sudo su - to get a root terminal :wink:

EDIT:
can you post what linux dist you are running?
pm me if you need any thing in perl

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

seems "changing permissions" caused this problem.....if you are able to login as root via terminal (or login as user and su to root) check the file permissions of /etc/password and /etc/shadow

/etc/password should have -rw-r--r-- (644)
/etc/shadow should have -rw-r----- (640)

if not, chmod them....

also check in /etc/fstab if the drive which contains the home directory is mounted with read-write permissions (rw) or read-only (ro)...it should be "rw", if not change it.

User avatar
skip
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 204
Joined: 27 Oct 2007, 16:00
16
Location: 18th Galaxy

Post by skip »

remotepwn: im on debian

bb: Tried on a single user to access root on maintenance and it worked. i change the file permissions of /etc/passwd to 644 and /etc/shadow to 640. i also checked the fstab but i changed the permission of the drive where the root is mounted, from ro to rw. I can edit the fstab, startx runs as well before i change permissions on passwd, shadow and fstab. after that and a reboot. i think it got worse. i cant modify fstab, it says read only file system. startx wont even run. 8O :roll: :x :cry: :lol: :(
Image Image Image

User avatar
computathug
Administrator
Administrator
Posts: 2693
Joined: 29 Mar 2007, 16:00
17
Location: UK
Contact:

Post by computathug »

If startx wont run you can always revert to the backup.

Code: Select all

cd to the right directory for /x11/xorg 
i cant remember what it is and havent time to look, sorry my heads not all there at the mo and then use

cp blahblah blahblah

Sure you get my drift

I will sort my napper out and help more in a few hours when my head clears if you still struggling :wink:
The devil can cite Scripture for his purpose.
-- William Shakespeare, "The Merchant of Venice"
https://tshirt-memes.com

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hm, post the content of fstab.. :-k

User avatar
skip
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 204
Joined: 27 Oct 2007, 16:00
16
Location: 18th Galaxy

Post by skip »

computathug: im not sure, hers the output error when i typed startx

Code: Select all

Fatal server error:
Could not create lock file in /tmp/.tx0-lock
bb: here

Code: Select all

proc     /proc      proc      defaults         0         0
/dev/mapper/Debian-root   /  	ext3  errors=remount-rw  	0 
/dev/sda1 	/boot	ext2 	defaults 	0 2
/dev/mapper/Debian-swap_1	  none 	swap	sw 	0 
/dev/hdb 	  /media/cdrom0  udf,iso9660   user,noauto 	0 0
/dev/sdc1 	/media/disk	vfat 	rw,noauto,user,sync 	0 0
/dev/hdd1 	/media/Windows 	ntfs  rw,auto 	0 0
Image Image Image

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hm, fstab looks ok, but the error you got when trying to start X points to a permission problem.....login as root, cd to / and give tmp 777 permissions with setting the sticky bit:

Code: Select all

chmod 1777 tmp
best check if there are subdirectories in tmp, if yes also chmod 1777 them (don't do chmod -R 1777 because the sticky bit has a different function for directories and files).

if still problems appear post the output of ls -al of the / directory.

:wink:

User avatar
skip
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 204
Joined: 27 Oct 2007, 16:00
16
Location: 18th Galaxy

Post by skip »

This is what i got when i chmod in /tmp directory (on a single user - root on maintenance).

Code: Select all

# chmod 1777 tmp 
chmod: changing permissions of 'tmp': read-only file system
even with /tmp. i got the same error.

Heres the output of ls -al

Code: Select all

drwrwxr-x  21 root root  4096 Jun 17 07:48 ,
drwrwxr-x  21 root root  4096 Jun 17 07:48 ,,
drwrwxr-x   2 root root  4096 Jun  5 09:05 bin
drwrwxr-x   4 root root  1024 Jun  2 14:51 boot
drwr-xr-x  14 root root  3540 Jun 18 17:25 dev
drwrwxr-x 126 root root 12288 Jun 17 07:47 etc
drwrwxr-x   3 root root  4096 Apr 17 11:42 home
lrwrwxrwx   1 root root    28 Jun  2 14:51 initrd.img -> boot/initrd.img-2.6.26-2-686
drwrwxr-x  16 root root 12288 Jun  5 09:07 lib
drwrwxr-x   2 root root 16384 Apr 16 23:56 lost+found
drwrwxr-x   5 root root  4096 Jun 17 07:48 media
drwrwxr-x   2 root root  4096 Dec  4 2000 mnt
drwrwxr-x   2 root root  4096 Apr 16 23:57 opt
dr-r-xr-x  58 root root     0 Jun 18 17:25 proc
drwrwxr-x  24 root root  4096 Jun 17 07:48 root
drwrwxr-x   2 root root 12288 Jun  5 09:07 sbin
drwrwxr-x   2 root root  4096 Sep 16 2000 selinux
drwrwxr-x   3 root root  4096 Apr 17 02:34 srv
drwr-xr-x  11 root root     0 Jun 18 17:25 sys
drwrwxr-x  21 root root  4096 Jun 17 07:49 tmp
drwrwxr-x  11 root root  4096 Apr 17 02:26 usr
drwrwxr-x  15 root root  4096 Jun  5 09:26 var
lrwrwxrwx   1 root root    25 Jun  2 14:51 vmliuz -> boot/vmlinuz-2.6.26-2-686
Image Image Image

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hmm....I begin to think this might be a hardware problem with the HDD, to check it run a file system check:

Code: Select all

shutdown -rF now
this will reboot the system and run fsck....let us know if there are any errors reported.

User avatar
skip
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 204
Joined: 27 Oct 2007, 16:00
16
Location: 18th Galaxy

Post by skip »

I installed debian with lvm encryption, does it affect current problem? :?:
Image Image Image

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hm, I am not too familiar with that feature and what problems it might cause....but if there is a general problem with the file system or the HDD fsck will find it... :wink:

User avatar
skip
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 204
Joined: 27 Oct 2007, 16:00
16
Location: 18th Galaxy

Post by skip »

bad_brain wrote:hmm....I begin to think this might be a hardware problem with the HDD, to check it run a file system check:

Code: Select all

shutdown -rF now
this will reboot the system and run fsck....let us know if there are any errors reported.
The errors are still the same whether i type the command or not.

Code: Select all

Could not start the X
server (your graphical environment)
due to some internal error.
Please contact your system administrator
or check the syslog to diagnose.
In the meantime this display will be
\disabled. Please restart GDM when 
the problem is corrected.
or like these errors? they appear every time i boot up. should i post them all?

Code: Select all

Starting periodic command scheduler: cron/user/sbin/cron: cant open or create /var/run/crond.pid: Read-only filesystem It will ignored in the future release
failed!
Enabling additional executable binary formats: binfmt-supportWARNING: All config files need .conf : /etc/mod/probe.d/display_class, 
WARNING: All config files need .conf: /etc/mod/probe.d/blacklist. It will ignored in the future release
WARNING: All config files need .conf: /etc/mod/probe.d/pnp-hotplug. It will ignored in the future release
.
Cannot create /var/run/kdm/Xaccess

and the output for fsck when i put it in the console

Code: Select all

# fsck
fsck 1.46.6 (30-May-2009)
e2fsck 1.46.6 (30-May-2009)
/dev/mapper/Debian-root : clean 210062 / 9674752 files, 18130904 / 38678528 blocks (check in 2 mounts)
/dev/sda1 is mounted.

WARNING!!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage.

Do you really want to continue (y/n) : yes

/dev/sda1 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks and sizes.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1 : 33 / 124496 files (18.2% non-contiguous) 43089 / 248976 blocks
Is it a good idea to use the rescue option on the cd installer if there are no other options left? or there are hundreds of options left? :D
Image Image Image

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

I have no clue at the moment what causes this problem, so try the rescue option... :)

User avatar
skip
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 204
Joined: 27 Oct 2007, 16:00
16
Location: 18th Galaxy

Post by skip »

I tried the rescue option and change the permissions of passwd and shadow to 777 and the /tmp to 1777 and its subdirectories, but i cant change anything on fstab using vi, the cursor (blinking square) wont go down. After that, its still wont go inside even if i type startx. same errors. Which folders or files should i change? what other options should i do?

I can go inside the gui before i change the permissions but i turned it back (i think) and now it wont go inside. :?:
Image Image Image

Post Reply