linux skel
We want to create system default for user creation and addition. System defaults mean what will be default values for the user creation like home path, user id etc.
我们想要为用户创建和添加创建系统默认设置。 系统默认值表示用户创建的默认值,例如主目录路径,用户ID等。
skel目录
(skel Directory
) /etc/skel is the directory where files will be copied to the new user directory from here. If we look detailed we will see that there are some default files in it.
/ etc / skel是将文件从此处复制到新用户目录的目录。 如果我们仔细查看,将会发现其中包含一些默认文件。
$ls -al /etc/skel/
All these .bashrc .bash_logout and .bash_profile files will be copied newly created user home directory.
所有这些.bashrc .bash_logout和.bash_profile文件将被复制到新创建的用户主目录中。
.bashrc is the start file when a new shell is opened it will run. For example if we want to run some command while opening new shell or we want to set some environment variables we will add them to this files.
.bashrc是打开新外壳程序时将开始运行的开始文件。 例如,如果我们要在打开新外壳时运行某些命令,或者想要设置一些环境变量,我们会将它们添加到此文件中。
.bash_profile is the file which will call .bashrc file and set some PATH environment
.bash_profile是将调用.bashrc文件并设置一些PATH环境的文件
在Skel中创建一些文件
(Create Some File In Skel
) Keep i mind that to create files in skel we need root privileges. If we want to set some mail related environment variables we can edit .bash_profile file like below.
请记住,要在skel中创建文件,我们需要root特权。 如果我们想设置一些与邮件相关的环境变量,我们可以编辑.bash_profile文件,如下所示。
$echo "mail=192.168.1.10" >> /etc/skel/.bashrc
LEARN MORE What is Dash / Shell / sh and How To Use It?
了解更多什么是Dash / Shell / sh以及如何使用?
翻译自: https://www.poftut.com/create-user-creation-defaults-skel-linux/
linux skel