How can one use sudo, without typing sudo more than once per sudo session?

By that I mean that you'll be asked to type your password each 15 minutes after the last command you executed, while executing commands within this time (within this "grace period") will restart the timeout.

Another example:

  1. You boot the system.
  2. You execute any command whatsoever.
  3. Immediately after that, you are being asked to fill in your password.
  4. The command is executed.
  5. If 15 minutes passed and you haven't typed any command (say, you suddenly had to leave the PC), you will be prompted for your password again.

This could save typing the word sudo instead typing it tens if not hundreds of times a day (not always you run scripts as sudo).

  • This is how sudo works by default, isn't it? Aug 13, 2017 at 4:47
  • Up until this moment I thought one should type "sudo" before each command within the "grace period".
    – user149572
    Aug 13, 2017 at 4:48
  • Oh, yes, I misunderstood: you still need to type "sudo" before each command. You might want to open a root shell then: sudo -i -- from there, each command you execute is ran as root Aug 13, 2017 at 4:50
  • If it implements the grace period concept it's good.
    – user149572
    Aug 13, 2017 at 4:55

1 Answer 1


Use sudo -i. The -i option will log you in and you won't have to retype the password or add sudo before commands every single time.

  • Is this su mode? Because I don't the regular su mode.
    – user149572
    Aug 13, 2017 at 7:54
  • No, this is not su mode. sudo -i simply logs you in with your(current user's) password and gives you root privileges. Aug 15, 2017 at 8:01
  • Not a solution. This effectively breaks the audit. Basically sudo bash, su - and so on, are all bad from system administration perspective.
    – 0andriy
    Apr 10 at 17:05

You must log in to answer this question.