LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-11-2011, 12:37 PM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
su and sudo don't say what password to enter


I wonder how to make su and sudo say what user's password to enter?

It's not a big problem for me because I have the same password for both my normal account and the root account, but still it would be nice.
 
Old 02-11-2011, 12:49 PM   #2
reed9
Member
 
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 142Reputation: 142
I don't really understand the problem. Su is by default going to be the root password, unless you're specifying a specific user, and sudo is going to be the current user's password.
 
Old 02-11-2011, 12:52 PM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,338

Rep: Reputation: 259Reputation: 259Reputation: 259
For sudo is specifying whose password I have to enter:
Code:
$ sudo -u oleg ls
oleg's password:
 
Old 02-11-2011, 12:55 PM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012
su means "switch user". So you will enter the password of the user you are switching to, which is root by default.

sudo is "superuser do" (or at least that's the usual translation). It's a system for giving regular users access to commands they wouldn't normally be able to use. Since you have been given permission by the administrator to issue the command, you use your own password.
 
Old 02-11-2011, 01:19 PM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Quote:
Originally Posted by David the H. View Post
su means "switch user". So you will enter the password of the user you are switching to, which is root by default.

sudo is "superuser do" (or at least that's the usual translation). It's a system for giving regular users access to commands they wouldn't normally be able to use. Since you have been given permission by the administrator to issue the command, you use your own password.
I know that.

But in distros like Ubuntu it actually asks "Password for <user>:" instead of just "Password:", and I was curious about how to do that.

And it can have a useful purpose, for example if a script asks for a password, you don't know if the script is using su or sudo, thus you don't know whether to enter your or root's password.
 
Old 02-11-2011, 02:33 PM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005
Are you talking about a script that you made yourself?
 
Old 02-11-2011, 02:44 PM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012
Heh, I didn't notice who I was replying to. Of course you're experienced enough to know that. But it wasn't clear enough in your original request what you want.

I see that sudo has a -p option for formatting the password prompt. (edit: and a SUDO_PROMPT env. variable) I don't see anything similar for su.

Last edited by David the H.; 02-11-2011 at 02:46 PM.
 
Old 02-11-2011, 02:47 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Well Sudo has options for changing the prompt if you read the manpage *ahem*, not sure why it matters though. A script is, obviously, a script, you can just echo out whatever the hell you want to when you want to, no need to care about the subtleties of the commands you're running. If the script doesn't make it obvious, it's a pretty poor script in the first place. Unless it's within an evironment, e.g. ubuntu, where it is implicit.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to enter password in terminal to enter as root.. ANISHKUMAR.R Linux - Newbie 5 08-07-2010 08:46 AM
sudo changes the owner and the group of some my files and now I can't enter in X Ali79 Linux - Software 5 12-10-2004 02:01 PM
can't enter password riverbed Linux - Newbie 2 01-30-2004 02:31 AM
Cant enter password lex0429 Mandriva 1 09-26-2003 11:33 AM
I canīt enter the password!! Andres_age Linux - General 3 11-11-2002 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration