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?

link|improve this question

78% accept rate
feedback

2 Answers

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

link|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. – toor 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? – toor 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. – toor Feb 6 '11 at 5:34
feedback

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 ~/.

link|improve this answer
and how do I have that transfered to the target when I log in? – toor Nov 17 '10 at 16:44
feedback

Your Answer

 
or
required, but never shown

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