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

What would be the best way to get the same shell environment (paths excluded) on all my accounts automatically?

What I want is something that transfers the aliases, coloring, and other cool shiznit I have going on in my shell to other shells when I login. Is this possible? Do I have to copy my .bashrc file to all my accounts?

share|improve this question
add comment

2 Answers 2

Make any changes you need to make to /etc/skel. When you invoke useradd, it'll copy the content of this folder into the user's home directory, automatically.

http://www.linuxhowtos.org/Tips%20and%20Tricks/using_skel.htm

share|improve this answer
    
I'm talking about existing accounts. I know I can manually copy over bashrc or what ever the shell is. I just want the login to do this for me. –  d-_-b Nov 17 '10 at 16:46
    
Ah, then Gopoi's answer will do you. Rather than copy the files into place on existing accounts, simply add the configuration to /etc/bashrc (this might have a different name on some distros, such as /etc/bash.bashrc on Debian). This file is executed before the users own, so you don't need to have it copied into place. Or do you specifically want to enforce a standard bashrc and prevent local changes? –  SmallClanger Nov 17 '10 at 20:43
    
I think I want all my account's /home/user/.bashrc to be in sync with my laptop without extra effort to set up something on the server. Is there a way to push a file to the server before bash runs? –  d-_-b Nov 18 '10 at 2:40
    
So you have a primary user account on a laptop, and you want to copy the .bashrc from it to another system, where it will become the default for all users? –  SmallClanger Nov 19 '10 at 14:06
    
No, just my account of course. I want to be able to use all my nifty aliases etc. –  d-_-b Feb 6 '11 at 5:34
add comment

If you run bash yo can edit /etc/profile and /etc/bashrc. They are analog to the user ~/.profile and ~/.bashrc.

So put all your common vars in /etc and user more specifc in ~/.

share|improve this answer
    
and how do I have that transfered to the target when I log in? –  d-_-b Nov 17 '10 at 16:44
add comment

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.