I changed the default username using usermod. and now whenever I type a sudo command it requires a password. I do it only when it is the first time I type sudo. further it does not require any password. I do not understand it.

closed as unclear what you're asking by joan, Milliways, Dmitry Grigoryev, Jacobm001 May 4 '17 at 17:25

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    What is your actual issue or question? – arielnmz May 3 '17 at 14:52
  • This is a general *nix question, it is not specific to the Raspberry Pi. – joan May 3 '17 at 15:00

This has nothing to do with changing the user name, it's default sudo behaviour. sudo caches your credentials so you don't get asked if you do another sudo within a short range of time (15 minutes is default). If you don't enter another sudo command for 15 minutes, you'll get prompted again. Or do sudo -k to reset the credentials immediately.

  • fixed with visudo – aguirab May 4 '17 at 7:57

fixed with visudo line pi ALL=(All) NOPASSWD:ALL change : pi --> nex $USER thanks

Not the answer you're looking for? Browse other questions tagged or ask your own question.