I'm on a Debian Wheezy, and I'm wondering how I can, after editing /etc/passwd (actually to change a home directory, but nevermind), reload the user session without logging off.

I tried exec bash, exec bash --login, but it doesn't work

Any idea ?

NB : whatever I change on /etc/passwd I would like a command to refresh the user's session

EDIT : This may be a question for StackOverFlow. If so, please moove my question, thx.

  • 2
    what about su - "your Usernam" – Hartmut Nov 26 '13 at 11:26
  • wow, that simple... It works. Please write it on an answer, so I can validate it. I was however expecting a command without having to type a password, but it's ok. – 4wk_ Nov 26 '13 at 13:56
  • Sudoers entry with NOPASSWD? – Magellan Nov 26 '13 at 15:35
  • well, I don't have sudo, just a root account and many classic user with no right ;) – 4wk_ Nov 26 '13 at 16:27

please use su - "your username"

as a hack, if you like to do this without entering a password you could add the following line to /etc/sudoers

"your username" ALL=("your username") su

and then use the following command sudo su - "your username"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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