coffee-grinder Asked: 2011-03-06 05:09:02 +0800 CST2011-03-06 05:09:02 +0800 CST 2011-03-06 05:09:02 +0800 CST 创建新用户时,如何在其主目录中自动创建 .virtualenvs 目录? 772 我想在创建新用户时在每个新用户的主目录中自动创建一个名为“.virtualenvs”的目录。 我正在使用 useradd 命令来创建新用户。 users 1 个回答 Voted Best Answer Lekensteyn 2011-03-06T05:13:23+08:002011-03-06T05:13:23+08:00 创建目录/etc/skel/.virtualenvs。该/etc/skel目录将用作新主目录的骨架。 它定义在/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
创建目录
/etc/skel/.virtualenvs
。该/etc/skel
目录将用作新主目录的骨架。它定义在
/etc/adduser.conf
: