Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 9th February 2011, 09:19 PM
sepoto Offline
Registered User
 
Join Date: Dec 2010
Posts: 174
linuxfirefox
Does sudo have to ask for my password every single time?

It seems that every time I use the 'sudo' command I have to type a password. Is there a way to get 'sudo' to remember the password at least for the current session after I use it once or something like that?

Thank you.
Reply With Quote
  #2  
Old 9th February 2011, 09:44 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,092
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

It should last 5 minutes.

It is limited to prevent "walkup" take overs (ie. you have to step out...).
Reply With Quote
  #3  
Old 9th February 2011, 09:46 PM
sepoto Offline
Registered User
 
Join Date: Dec 2010
Posts: 174
linuxfirefox
Re: Does sudo have to ask for my password every single time?

For me it is not lasting even five minutes. It asks every time for a password no matter what.
Reply With Quote
  #4  
Old 9th February 2011, 09:47 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,092
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

Well,, it appears to be a compile time limit. I haven't found any way to
change it. There may be a way though, but so far, without looking at the
source, I've seen no configuration file that contains it.
Reply With Quote
  #5  
Old 9th February 2011, 09:55 PM
bbobbo Offline
Registered User
 
Join Date: Dec 2004
Location: Cambridge, MA
Posts: 89
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

as long as you enter another sudo command within 5 minutes of the last sudo command, you won't have to enter your password. you can change the default action in /etc/sudoers. do 'man sudoers' for more information.

---------- Post added at 04:55 PM ---------- Previous post was at 04:48 PM ----------

from 'man sudoers':

Code:
       timestamp_timeout
                       Number of minutes that can elapse before sudo will ask
                       for a passwd again.  The default is 5.  Set this to 0
                       to always prompt for a password.  If set to a value
                       less than 0 the user’s timestamp will never expire.
                       This can be used to allow users to create or delete
                       their own timestamps via sudo -v and sudo -k
                       respectively.
and
Code:
       exempt_group
                   Users in this group are exempt from password and PATH
                   requirements.  This is not set by default.
Reply With Quote
  #6  
Old 9th February 2011, 09:58 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,092
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

Thanks - I looked for a timeout in there, but didn't find one. (nor the info
file either...)
Reply With Quote
  #7  
Old 9th February 2011, 10:12 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,976
linuxchrome
Re: Does sudo have to ask for my password every single time?

Another thing to keep in mind that everyone probably knows, but no one has mentioned, so just in case....

If I have an xterm open, and do sudo whatever, within that xterm, I have a five minute period to do something.

However, if I then open another xterm and type sudo whatever, I will have to enter my password again. It's a separate session.
Reply With Quote
  #8  
Old 9th February 2011, 10:24 PM
ElderSnake Offline
Registered User
 
Join Date: Nov 2010
Location: Australia
Posts: 683
windows_7firefox
Re: Does sudo have to ask for my password every single time?

Yes exactly, as long as it's the same session (terminal window) it should definitely last you 5 minutes.

You can also grant yourself the no password ability in the sudoers file too... but wouldn't recommend that..
__________________
OS': Arch Linux (KDE 4.10) - Fedora 17 (MATE) - Arch Linux (E17) - now Windows-free thanks Valve!
Reply With Quote
  #9  
Old 10th February 2011, 04:47 AM
thunderwinde Offline
Registered User
 
Join Date: Jan 2011
Posts: 23
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

Quote:
Originally Posted by ElderSnake View Post
Yes exactly, as long as it's the same session (terminal window) it should definitely last you 5 minutes.

You can also grant yourself the no password ability in the sudoers file too... but wouldn't recommend that..
+1 Yeah, kind of beats the whole purpose of not logging in as root to begin with
Reply With Quote
  #10  
Old 10th February 2011, 02:22 PM
SiliconSlick's Avatar
SiliconSlick Offline
Registered User
 
Join Date: Aug 2009
Location: College Station, TX
Posts: 501
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

Quote:
Originally Posted by thunderwinde View Post
+1 Yeah, kind of beats the whole purpose of not logging in as root to begin with
Not entirely... it means I would have to do:

sudo rm -rf /

instead of just:

rm -rf /

to ruin my whole day.

SS
Reply With Quote
  #11  
Old 10th February 2011, 02:52 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,976
linuxchrome
Re: Does sudo have to ask for my password every single time?

It can be useful in a script, where one specifies that only command x can be run with no password. Like many things, useful, but bad if misused.
Reply With Quote
  #12  
Old 10th February 2011, 09:15 PM
assen Offline
Registered User
 
Join Date: Oct 2008
Posts: 492
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

Hi,

If you need a long-lasting "sudo", just open a root shell:

sudo bash

WWell,
Reply With Quote
  #13  
Old 11th February 2011, 05:37 AM
thunderwinde Offline
Registered User
 
Join Date: Jan 2011
Posts: 23
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

Quote:
Originally Posted by SiliconSlick View Post
Not entirely... it means I would have to do:

sudo rm -rf /

instead of just:

rm -rf /

to ruin my whole day.

SS
Must be a fast user if you can undo that in just one day

---------- Post added at 09:37 PM ---------- Previous post was at 09:35 PM ----------

Quote:
Originally Posted by assen View Post
Hi,

If you need a long-lasting "sudo", just open a root shell:

sudo bash

WWell,
Hmm... I might be missing something here, but how exactly would that differ from just opening a shell and logging in as root? Seems like a roundabout way to get to where 'su -' will take you.
Reply With Quote
  #14  
Old 11th February 2011, 07:49 AM
jroa1 Offline
Registered User
 
Join Date: Oct 2010
Posts: 229
windows_vistafirefox
Re: Does sudo have to ask for my password every single time?

Quote:
Originally Posted by thunderwinde View Post

Hmm... I might be missing something here, but how exactly would that differ from just opening a shell and logging in as root? Seems like a roundabout way to get to where 'su -' will take you.
I guess if you do not have the root password but you do have sudo privileges, this might be an option. But then you could always

Code:
sudo su -
Reply With Quote
  #15  
Old 11th February 2011, 08:07 AM
thunderwinde Offline
Registered User
 
Join Date: Jan 2011
Posts: 23
linuxfedorafirefox
Re: Does sudo have to ask for my password every single time?

Quote:
Originally Posted by jroa1 View Post
I guess if you do not have the root password but you do have sudo privileges, this might be an option. But then you could always

Code:
sudo su -
The logical continuation of which is:

Code:
# sudo su -

# passwd root
Reply With Quote
Reply

Tags
password, single, sudo, time

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I SUDO with no password ? OralDeckard Using Fedora 3 2nd August 2010 08:01 AM
Several scp's and a single password joe.pelayo Using Fedora 3 12th September 2009 09:34 AM
Is there a way to use sudo password with the gui (gnome)? Thaidog Using Fedora 1 14th January 2009 02:41 AM
Using kdesu or sudo without password Krister Hallerg Using Fedora 17 11th March 2007 05:35 AM
what is the sudo password? acerfedora Using Fedora 7 22nd July 2006 04:43 PM


Current GMT-time: 08:14 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat