Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In my new Gentoo installation, su doesn't work as my non-root user: After entering the correct password I get the message "su: Permission denied". What could be causing this? I have already tried reinstalling the package containng /bin/su.

EDIT: sudo works.

share|improve this question
    
Are you able to su from root to another user? –  michas Jan 20 '13 at 3:15

3 Answers 3

up vote 1 down vote accepted

I solved the same problem by editing

 /etc/pam.d/su

and commenting out this line:

auth       required     pam_wheel.so use_uid

It requires users to be in the wheel group to be able to switch user. User switching as non-root works again when this pam module is disabled for su.

share|improve this answer

There could be many problems. Check some of these items, using the hypothetical user, erik:

  1. Is erik a member of the wheel group (groups)?
  2. Are you providing the root password? (And not the password for erik)
  3. Does /bin/su have these privileges: rwsr-xr-x (Is it setuid root? ls -la /bin/su)
  4. Can you log in as root via the console?
  5. Have you looked at the logs for a clue in an error message?
  6. Have you turned on grsecurity in the kernel?
  7. Did it ever work? If so, when did it break?
  8. What happens if erik does a sudo su -?
share|improve this answer

There could be many reasons. It's very likely that the reason appears in the system logs. Look in /var/log for files that got modified at the time of an su attempt (the file name depends on your syslog configuration). If you have trouble interpreting log entries, copy-paste them into your question.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.