Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Why is su asking root to reenter password?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
dsegel
Tux's lil' helper
Tux's lil' helper
Posts: 127
Joined: Fri Jan 31, 2003 8:41 pm

Why is su asking root to reenter password?

  • Quote

Post by dsegel » Tue Jul 03, 2007 6:20 pm

On one of my Gentoo systems if I try to su to a regular user account it asks me to "reenter password". On other systems it doesn't do this, it just switches to the specified user.

So what have I changed to make su act this way?
Top
ketjap
Tux's lil' helper
Tux's lil' helper
Posts: 75
Joined: Thu Nov 03, 2005 12:38 pm
Location: The Netherlands

  • Quote

Post by ketjap » Tue Jul 03, 2007 6:37 pm

You must have something in the sudoers file which you can change with visudo.
Top
embobo
Guru
Guru
Posts: 311
Joined: Mon May 19, 2003 6:48 am

Re: Why is su asking root to reenter password?

  • Quote

Post by embobo » Tue Jul 03, 2007 9:35 pm

dsegel wrote:On one of my Gentoo systems if I try to su to a regular user account it asks me to "reenter password". On other systems it doesn't do this, it just switches to the specified user.

So what have I changed to make su act this way?
What is in "/etc/pam.d/su"?
Top
dsegel
Tux's lil' helper
Tux's lil' helper
Posts: 127
Joined: Fri Jan 31, 2003 8:41 pm

  • Quote

Post by dsegel » Tue Jul 03, 2007 11:30 pm

The sudoers file is identical across systems. It contains the default root settings of:

root ALL=(ALL) ALL
Top
dsegel
Tux's lil' helper
Tux's lil' helper
Posts: 127
Joined: Fri Jan 31, 2003 8:41 pm

  • Quote

Post by dsegel » Tue Jul 03, 2007 11:33 pm

/etc/pam.d/su is identical as well:

Code: Select all

#%PAM-1.0

auth       sufficient   pam_rootok.so

# If you want to restrict users begin allowed to su even more,
# create /etc/security/suauth.allow (or to that matter) that is only
# writable by root, and add users that are allowed to su to that
# file, one per line.
#auth       required     pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.allow

# Uncomment this to allow users in the wheel group to su without
# entering a passwd.
#auth       sufficient   pam_wheel.so use_uid trust

# Alternatively to above, you can implement a list of users that do
# not need to supply a passwd with a list.
#auth       sufficient   pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.nopass

# Comment this to allow any user, even those not in the 'wheel'
# group to su
auth       required     pam_wheel.so use_uid

auth       include              system-auth

account    include              system-auth

password   include              system-auth

session    include              system-auth
session    required     pam_env.so
session    optional             pam_xauth.so
Top
embobo
Guru
Guru
Posts: 311
Joined: Mon May 19, 2003 6:48 am

  • Quote

Post by embobo » Tue Jul 03, 2007 11:39 pm

dsegel wrote:/etc/pam.d/su is identical as well:

Code: Select all

#%PAM-1.0

auth       sufficient   pam_rootok.so

# If you want to restrict users begin allowed to su even more,
# create /etc/security/suauth.allow (or to that matter) that is only
# writable by root, and add users that are allowed to su to that
# file, one per line.
#auth       required     pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.allow

# Uncomment this to allow users in the wheel group to su without
# entering a passwd.
#auth       sufficient   pam_wheel.so use_uid trust

# Alternatively to above, you can implement a list of users that do
# not need to supply a passwd with a list.
#auth       sufficient   pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.nopass

# Comment this to allow any user, even those not in the 'wheel'
# group to su
auth       required     pam_wheel.so use_uid

auth       include              system-auth

account    include              system-auth

password   include              system-auth

session    include              system-auth
session    required     pam_env.so
session    optional             pam_xauth.so
Are you trying to su from the root account to another account? If so then "auth sufficient pam_rootok.so" should
do it.

Otherwise, you'll need to uncomment the "auth sufficient pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.nopass" line and set up a /etc/security/suauth.nopass
Top
ketjap
Tux's lil' helper
Tux's lil' helper
Posts: 75
Joined: Thu Nov 03, 2005 12:38 pm
Location: The Netherlands

  • Quote

Post by ketjap » Thu Jul 05, 2007 5:39 am

If you try it from another acount, Is that acount a member of the group wheel?
Top
dsegel
Tux's lil' helper
Tux's lil' helper
Posts: 127
Joined: Fri Jan 31, 2003 8:41 pm

  • Quote

Post by dsegel » Tue Jul 10, 2007 3:05 pm

embobo wrote: Are you trying to su from the root account to another account? If so then "auth sufficient pam_rootok.so" should
do it.

Otherwise, you'll need to uncomment the "auth sufficient pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.nopass" line and set up a /etc/security/suauth.nopass
Yes, I'm trying to su from root to a regular user - I'm actually trying to run a scp command via cron as a user who has a key setup to allow login to a particular server.

It still doesn't work, but for the time being I just allowed the user in question to use cron instead.
Top
Post Reply

8 posts • Page 1 of 1

Return to “Networking & Security”

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