Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Thanks for the unwarranted downvote -.- –  4wk_ Nov 26 '13 at 11:12
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

1 Answer 1

up vote 2 down vote accepted

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"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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