1

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?

d-_-b
  • 1,104
  • 3
  • 11
  • 23

2 Answers2

4

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

SmallClanger
  • 8,947
  • 1
  • 31
  • 45
  • 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 02: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 06 '11 at 05:34
0

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

Gopoi
  • 547
  • 5
  • 21