Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

Su problems

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
13 posts • Page 1 of 1
Author
Message
csfsmash
n00b
n00b
Posts: 19
Joined: Wed May 17, 2006 2:12 pm

Su problems

  • Quote

Post by csfsmash » Sat May 20, 2006 1:40 am

i got this error :O

smash ~ $ su
/bin/sh: Permission denied


how i fix this?
Top
roseZ
n00b
n00b
User avatar
Posts: 31
Joined: Sat Dec 17, 2005 5:23 pm
Location: Finland

  • Quote

Post by roseZ » Sat May 20, 2006 5:34 am

It looks like root's shell is set to /bin/sh in /etc/passwd, and the execute permission to /bin/sh (or to whatever it points to, if it's a symlink) is not set.
Top
csfsmash
n00b
n00b
Posts: 19
Joined: Wed May 17, 2006 2:12 pm

  • Quote

Post by csfsmash » Sat May 20, 2006 5:59 am

So, what i have to do to fix the problem?
Top
roseZ
n00b
n00b
User avatar
Posts: 31
Joined: Sat Dec 17, 2005 5:23 pm
Location: Finland

  • Quote

Post by roseZ » Sat May 20, 2006 6:12 am

Check what /bin/sh looks like by

Code: Select all

ls -l /bin/sh
For me, the output looks like this

Code: Select all

lrwxrwxrwx 1 root root 4 Apr 16 21:37 /bin/sh -> bash
which means that /bin/sh is a symlink pointing to /bin/bash. In this case, do the same thing for the link's target. In my case this is

Code: Select all

ls -l /bin/bash
which outputs

Code: Select all

-rwxr-xr-x 1 root root 767264 Apr 16 21:37 /bin/bash
Now, the critical parts are those x's. To set permissions like this issue (as root)

Code: Select all

chmod 0755 /bin/bash
You can make yourself root without su, right?
Top
csfsmash
n00b
n00b
Posts: 19
Joined: Wed May 17, 2006 2:12 pm

  • Quote

Post by csfsmash » Sat May 20, 2006 3:01 pm

ii did what you told and i still gettint permission denied...
as root i can run the su command.. for example
localhost ~ # su smash
smash@localhost /root $


:( any idea?
Top
overkll
Veteran
Veteran
Posts: 1249
Joined: Tue Sep 21, 2004 1:29 pm
Location: Austin, Texas

  • Quote

Post by overkll » Sat May 20, 2006 3:21 pm

Did you add the user that you are using to issue su to the "wheel" group?
Top
gentoo_dude
l33t
l33t
User avatar
Posts: 645
Joined: Sat May 08, 2004 10:29 pm
Location: Washington, DC

  • Quote

Post by gentoo_dude » Sat May 20, 2006 3:41 pm

Wheel group is to be able to perfom commands using sudo (as root).
su is to become another user if you know the user's password.

Do a ls -lsa /bin/su or ls -lsa /usr/bin/su.
See what group can do su. Add your user account to that group.

Mine is like this:

Code: Select all

28 -rws--x--x 1 root root 25024 Mar 17 16:12 /bin/su
Looks like it has the sticky bit set for uid. That means it will run with root previledges whoever runs that command. Probably the sticky bit has been reset.
In order to change it back you have to do

Code: Select all

chmod 4711 /bin/su
Top
csfsmash
n00b
n00b
Posts: 19
Joined: Wed May 17, 2006 2:12 pm

  • Quote

Post by csfsmash » Sat May 20, 2006 4:06 pm

i got 21 -wrwxr-xr-x 1 root wheel 24264 Feb 14 00:44 /bin/su

how i add the user to the group??
Top
csfsmash
n00b
n00b
Posts: 19
Joined: Wed May 17, 2006 2:12 pm

  • Quote

Post by csfsmash » Sat May 20, 2006 4:08 pm

ok i made this...

Code: Select all

userdel smash
adduser smash wheel
but now i dont have sound in X.. how i add the user to another group?? i mean to wheel and audio
Top
gentoo_dude
l33t
l33t
User avatar
Posts: 645
Joined: Sat May 08, 2004 10:29 pm
Location: Washington, DC

  • Quote

Post by gentoo_dude » Sat May 20, 2006 4:17 pm

Check the log in /var/log/everything/current and see what is the error for the authentication. Probably pam has something to do with it.
To add a user to a group you do

Code: Select all

usermod -a -G <groupname> <username>
Or you can manually edit with your favorite editor the /etc/group file
Last edited by gentoo_dude on Sat May 20, 2006 5:03 pm, edited 1 time in total.
Top
roseZ
n00b
n00b
User avatar
Posts: 31
Joined: Sat Dec 17, 2005 5:23 pm
Location: Finland

  • Quote

Post by roseZ » Sat May 20, 2006 4:42 pm

I think you should rather add user to a group with

Code: Select all

gpasswd -a <user> <group>
Did your su problem disappear, or did we just give you more grief? :?
Top
gentoo_dude
l33t
l33t
User avatar
Posts: 645
Joined: Sat May 08, 2004 10:29 pm
Location: Washington, DC

  • Quote

Post by gentoo_dude » Sat May 20, 2006 5:04 pm

I think the problem was that the user was not in the wheel group. Since I found serveral posts on different forums specifying the on Gentoo and on some BSDs in order to run just "su" the user must be in the wheel group.
Top
roseZ
n00b
n00b
User avatar
Posts: 31
Joined: Sat Dec 17, 2005 5:23 pm
Location: Finland

  • Quote

Post by roseZ » Sat May 20, 2006 5:32 pm

gentoo_dude wrote:I think the problem was that the user was not in the wheel group.
It seems you are correct, although, as I tested it on my box the error message was different from csfsmash's. With user not in wheel I get this:

Code: Select all

$ su -
Password: 
su: Permission denied
Sorry.
It makes no difference whether I try to su root or any other user, which supports your assessment.

Edit:
OK, I did some checking. It indeed confirmed that user must be in wheel group to use su at all (this depends on system settings, though). It was csfsmash's error message that led me to suspect permission problems. Pretty thorough discussion on this whole su business can be found in this thread. I'd be glad if someone explained why /bin/sh was complaining about permissions.
Top
Post Reply

13 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic