8

I want to automatically create a directory called ".virtualenvs" in each new user's home directory upon creation of that new user.

I am using the useradd command to create new users.

Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
coffee-grinder
  • 3,875
  • 8
  • 25
  • 22

1 Answers1

12

Create the directory /etc/skel/.virtualenvs. The /etc/skel directory will be used as a skeleton for a new home directory.

It's defined in /etc/adduser.conf:

# The SKEL variable specifies the directory containing "skeletal" user
# files; in other words, files such as a sample .profile that will be
# copied to the new user's home directory when it is created.
SKEL=/etc/skel
Lekensteyn
  • 171,743
  • 65
  • 311
  • 401
  • 1
    If you're giving your users virtualenvwrapper you can add the `$WORKON_HOME` environment variable to `/etc/skel/.bashrc` as well – Stephen Paulger Mar 28 '11 at 22:29