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.

  • 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.

| improve this answer | |
  • fixed with visudo – aguirab May 4 '17 at 7:57

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

| improve this answer | |

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