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 want to clear all enviroment variables for a specific user.

So when the user logins it should be the same as he called

 env -i /bin/bash

i've tried to put this line in .bash_profile but it seems it is never executed.

share|improve this question

1 Answer 1

my understanding is you need exec to start the shell. exec env -i /bin/bash

share|improve this answer
Yes, this is the way i\ve tried. exec env -i HOME=$HOME /bin/bash –  Korniltsev Anatoly Jun 20 '12 at 14:21

Your Answer


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.