You are not logged in.

#1 2007-11-05 21:44:37

orion91
Member
From: Italy
Registered: 2007-03-23
Posts: 14
Website

How to set new sudo password prompt?

Hi guys, i've a problem with sudo!
I want set a new password prompt for me but unfortunately don't how to do...

I set  a defaults line in sodoers file with this syntax:
Defaults     passprompt="MyPass:"
but don't work...

I tried also start sudo with -p paramenter: sudo -p "Mypass:" but nothing roll

Someone can help me please...:(

Offline

#2 2007-11-05 22:14:16

mykey
Member
From: out of the blue
Registered: 2007-03-02
Posts: 113

Re: How to set new sudo password prompt?

orion91 wrote:

I want set a new password prompt for me

What do mean exactly - what do you want to achieve?

Offline

#3 2007-11-05 22:28:37

orion91
Member
From: Italy
Registered: 2007-03-23
Posts: 14
Website

Re: How to set new sudo password prompt?

Now my sudo passprompt is this:

[myuser@mybox ~] sudo nano /etc/X11/xorg.conf
Password:
...................
...................

I wanto for example something like this:
[myuser@mybox ~] sudo nano /etc/X11/xorg.conf
MyPass:
...................
...................

I hope to be more clear now tongue

Offline

#4 2007-11-05 23:01:48

Crooksey
Member
From: UK ~
Registered: 2006-08-14
Posts: 415
Website

Re: How to set new sudo password prompt?

I think that would involve editing the source, then recompiling it, allot of work for no real outcome. Unless you made a perl file, placed in /sbin that would give you the flexibility to add anything.


Arch Linux since 2006
Python Web Developer + Sys Admin (Gentoo/BSD)

Offline

#5 2007-11-05 23:15:17

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: How to set new sudo password prompt?

Actually, sudo has an option for this:

sudo -p 'Enter your password, %u:'

'%u' will be replaced with your username. You can also use %H or %h for the hostname with or without the domain, %U for the username sudo will use to run your command, or %% for an actual percent sign.

If you want to set a permanant prompt, either set the environment variable "SUDO_PROMPT" or set "passprompt" in /etc/sudoers using visudo.

Offline

#6 2007-11-05 23:24:28

dschrute
Member
From: NJ, USA
Registered: 2007-04-09
Posts: 183

Re: How to set new sudo password prompt?

Defaults     passprompt="MyPass:"

The above worked for me, just like you had it posted here, so you should double check your config to make sure you have the line exactly correct.
From the sudoers man page :

The default prompt to use when asking for a password; can be overridden via the -p option or the SUDO_PROMPT environment variable. Supports two escapes: "%u" expands to the user's login name and "%h" expands to the local hostname.  The default value is Password:.

Offline

#7 2007-11-06 13:40:31

orion91
Member
From: Italy
Registered: 2007-03-23
Posts: 14
Website

Re: How to set new sudo password prompt?

skymt wrote:

Actually, sudo has an option for this:

sudo -p 'Enter your password, %u:'

'%u' will be replaced with your username. You can also use %H or %h for the hostname with or without the domain, %U for the username sudo will use to run your command, or %% for an actual percent sign.

If you want to set a permanant prompt, either set the environment variable "SUDO_PROMPT" or set "passprompt" in /etc/sudoers using visudo.

I tried this solution but don't work for me..

If i try to do:
# sudo -p 'My Password:' i've "Password" for pass prompt.. roll

I've re-checked the sudoers file, is this:

# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification
Defaults        passprompt="Password:"
# Runas alias specification

# User privilege specification
root    ALL=(ALL) SETENV: ALL

# Uncomment to allow people in group wheel to run all commands
# and set environment variables.
%wheel  ALL=(ALL) ALL

Offline

Board footer

Powered by FluxBB