Results 1 to 12 of 12

Thread: can't su to root when I could before

  1. #1
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)

    can't su to root when I could before

    I recently installed gentoo and everything has been going fine, however pretty much all of the files and folders have been set to read-only for normal users. if I want to use something like jedit or open office, I am unable to save anything to disk, and an error saying I don't have the correct permissions pops up when I do try to save something. I can't create files or folders through Konqueror either. This is highly impractical so I decided to try and sort it out and started messing around with chmod; permissions . Up until this point I have been su-ing to root and creating and editing files and folders via the terminal but I have never been able to write to a file or folder using a gui of any sort.

    I don't know what I did but after messing around with file/folder permissions I am unable to su to root via the terminal and get the following error:

    Code:
    $ su
    password: < enters correct password > 
    setgid: Operation not permitted
    $
    If I change to a console login and try to login as root the system seems to think that I have entered the wrong password and requests a login name again. I've done a lot of reading which has led me to look at /etc/passwd, groups and shadow but I can't sort the problem out. Google hasn't been that much help, probably because I don't exactly know whats wrong. I know its probably a permissions thing but I am not sure which files/folders it applies to. In short how might this be sorted?
    Last edited by Dorza; 23-06-2007 at 06:02 PM.

  2. #2
    Senior Member
    Join Date
    May 2007
    Location
    West Wales
    Posts
    484
    Thanks
    30
    Thanked
    18 times in 16 posts
    • Phil_P's system
      • Motherboard:
      • Gigabyte P35-DS4
      • CPU:
      • Q6600 G0
      • Memory:
      • 4x1GB Crucial
      • Storage:
      • 2 x WD 1TB in RAID1
      • Graphics card(s):
      • Gigabyte 7600GS
      • PSU:
      • Etasis 750W
      • Operating System:
      • RHEL5/RHEL6
      • Monitor(s):
      • Samsung 226BW 22" panel
      • Internet:
      • F2S 8mbit
    I'm guessing, but try checking your permissions on /bin/su:

    Code:
    [phil@jessie ~]$ ls -l /bin/su
    -rwsr-xr-x 1 root root 24060 Mar 21 21:24 /bin/su
    They should match mine above.

  3. Received thanks from:

    Dorza (23-06-2007)

  4. #3
    Senior Member
    Join Date
    May 2007
    Location
    West Wales
    Posts
    484
    Thanks
    30
    Thanked
    18 times in 16 posts
    • Phil_P's system
      • Motherboard:
      • Gigabyte P35-DS4
      • CPU:
      • Q6600 G0
      • Memory:
      • 4x1GB Crucial
      • Storage:
      • 2 x WD 1TB in RAID1
      • Graphics card(s):
      • Gigabyte 7600GS
      • PSU:
      • Etasis 750W
      • Operating System:
      • RHEL5/RHEL6
      • Monitor(s):
      • Samsung 226BW 22" panel
      • Internet:
      • F2S 8mbit
    Also check /etc/passwd and /etc/group are world readable:

    Code:
    $ ls -l /etc/passwd
    -rw-r--r-- 1 root root 1678 May 10 19:20 /etc/passwd
    [phil@jessie ~]$ ls -l /etc/group
    -rw-r--r-- 1 root root 662 May 10 19:21 /etc/group

  5. #4
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    Yeah, after reading more throughout the day it has become clear to me that I have naused my permissions right up; I mean completely screwed them up . Thanks for giving me that info, it is what I have been looking for because I thought there was an issue with those files.

    As I guessed my permissions are different to yours. I will have to boot a live cd since I can't chmod anything at the moment. What does the 1678 part mean, is that a umask?

  6. #5
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    Thanks a lot. That worked a treat . What should the permissions for /etc/shadow look like by the way?

    Now that I can su what would be the best way to go about restoring the permissions to my files and folders?

  7. #6
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb
    1678 is the file size i think

  8. #7
    Senior Member
    Join Date
    May 2007
    Location
    West Wales
    Posts
    484
    Thanks
    30
    Thanked
    18 times in 16 posts
    • Phil_P's system
      • Motherboard:
      • Gigabyte P35-DS4
      • CPU:
      • Q6600 G0
      • Memory:
      • 4x1GB Crucial
      • Storage:
      • 2 x WD 1TB in RAID1
      • Graphics card(s):
      • Gigabyte 7600GS
      • PSU:
      • Etasis 750W
      • Operating System:
      • RHEL5/RHEL6
      • Monitor(s):
      • Samsung 226BW 22" panel
      • Internet:
      • F2S 8mbit
    Quote Originally Posted by Dorza View Post
    Thanks a lot. That worked a treat . What should the permissions for /etc/shadow look like by the way?

    Now that I can su what would be the best way to go about restoring the permissions to my files and folders?
    /etc/shadow should be read-only by root only as this contains the encrypted passwords for all user accounts on the system, including root.

    Code:
    $ ls -l /etc/shadow
    -r-------- 1 root root 1115 May 10 19:20 /etc/shadow
    Do you have any idea exactly what you've changed?

    BTW, getting back to the original problem, as a regular user, you should only have permissions to create/save files in your /home/username/ directory. Everything else should be writable by root only - it's one of the core fundamentals of *nix based operating systems and is a big part of the reason Linux is so resistant to viruses and the like. Any administration tasks you need to do, you should always do as root.

    If you're not very comfortable at the command line, you can still use the GUI tools. For example, to edit a file as root using gedit, su to root and type gedit to launch the app - then any file you open, you open as root.

    Likewise with file management. If you use kde for example, you can su to root and type 'konqueror' to launch it with root permissions.

    Hope that helps
    Last edited by Phil_P; 24-06-2007 at 12:21 AM.

  9. #8
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    Basically I have changed my entire root directory to 777. This whole problem started because I couldn't write anything to my /home/username directory as a normal user. It has been that way since I got Gentoo up and running as I mentioned above. I then went and started fiddling with chmod and got carried away with it. You live and learn I guess - and I have learned to not mess with chmod without thinking .


    It has been suggest on the gentoo forums that doing emerge -e system and then emerge -e world will restore many of the permissions to what they should be. I may have interpreted the suggestion incorrectly though.

    EDIT: I am comfortable with the command line stuff, I prefer it actually and if I am serious about using linux (which I am) I really need to learn how to do things via the command line. It is nice to use a gui for some things though and I didn't know that launching an app in such a way would give it root access; it seems kind of obvious to me now though.
    Last edited by Dorza; 24-06-2007 at 12:34 AM.

  10. #9
    Senior Member
    Join Date
    May 2007
    Location
    West Wales
    Posts
    484
    Thanks
    30
    Thanked
    18 times in 16 posts
    • Phil_P's system
      • Motherboard:
      • Gigabyte P35-DS4
      • CPU:
      • Q6600 G0
      • Memory:
      • 4x1GB Crucial
      • Storage:
      • 2 x WD 1TB in RAID1
      • Graphics card(s):
      • Gigabyte 7600GS
      • PSU:
      • Etasis 750W
      • Operating System:
      • RHEL5/RHEL6
      • Monitor(s):
      • Samsung 226BW 22" panel
      • Internet:
      • F2S 8mbit
    I'm not that familiar with gentoo, but those suggested fixes have got to be worth a try I would think

    Yes, no doubt the command line must be mastered, but as always with Linux, there's always more than one way of achieving any given task. LOL, I remember when I first started out, I would log out and log back in to kde as root to access gui tools as root

    But hey, at least you've learned something from the experience - that's the main thing

  11. #10
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    When I first started messing around with various distros (back when Red Hat 8 was about) I used to do the same as you to access root stuff. I think many new linux users find it hard to let go of running as root when they come from windows because it is so convenient for them.

    Anyway thanks for your help Phil and your input streetster.

  12. #11
    Member
    Join Date
    Jun 2007
    Location
    Edinburgh
    Posts
    68
    Thanks
    4
    Thanked
    3 times in 3 posts
    • Uncle Psychosis's system
      • Motherboard:
      • Asus P5N-E SLI
      • CPU:
      • Intel Core2Duo E4300
      • Memory:
      • 2GB
      • Graphics card(s):
      • Nvidia 8600GT
      • Case:
      • Lian-LI PC7
    I believe the solution to your original problem was that your user needs to be a member of the "wheel" group to su on Gentoo.

    http://forums.gentoo.org/viewtopic-p...4247df2e59f450

    If you have screwed up all your permissions across your file system you'll definitely have to fix them or else you'll be in trouble at some point in the future.

    Great choice on Gentoo by the way, the documentation and user forums are really helpfull---I strongly suggest searching/posting there if you have problems.

    Also, on my first Gentoo install I got into a real mess because I didnt really pay attention to the portage (emerge) documentation. Check out the portage documentation:

    http://www.gentoo.org/doc/en/handboo...?part=3&chap=1

    Specifically, I suggest paying attention to how package.mask and package.use work. They'll make your life simple if you suss them out!

    Sam
    "bother", said Pooh. "There's an infinite number of monkeys at the door wanting to sue A.A.Milne for plagiarism."

  13. #12
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    Yeah the documentation is superb I have to say and the gentoo-wiki How To guides are also well written. They have helped me no end.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. USB root hubs
    By BEANFro Elite in forum PC Hardware and Components
    Replies: 0
    Last Post: 28-06-2006, 05:14 PM
  2. Enabling Root Account
    By Jonny M in forum Apple Mac
    Replies: 5
    Last Post: 03-06-2006, 12:25 AM
  3. Intolerance is the root of all evil :(
    By TheAnimus in forum General Discussion
    Replies: 9
    Last Post: 16-03-2006, 10:57 PM
  4. Win 2000 root dir
    By speedy_s in forum Software
    Replies: 23
    Last Post: 30-03-2005, 06:08 PM
  5. PEG Root Control & PEG Buffer Length
    By Olly1234 in forum PC Hardware and Components
    Replies: 3
    Last Post: 06-03-2005, 10:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •