/etc/skel的作用

来源:互联网 发布:波尔津吉斯数据 编辑:程序博客网 时间:2024/06/13 21:45

The /etc/skel directory contains files and directories that are automatically copied over to a new user'shome directory when such user is created by theuseradd program.

A home directory, also called a login directory, is the directory on Unix-like operating systems that serves as the repository for a user's personal files, directories and programs, including personal configuration files. It is also the directory that a user is first in afterlogging into the system. The/etc directory and its subdirectories contain the many important configuration files for the system.

The useradd program is located in the /usr/sbin/ directory, and on most systems it is accessible only by theroot (i.e., administrative) user. On some systems this program might be calledadduser.

/etc/skel allows a system administrator to create a default home directory for all new users on a computer or network and thus to make certain that all users begin with the same settings orenvironment.

Several user configuration files are placed in /etc/skel by default when the operating system is installed. Typically they might include.bash_profile, .bashrc, .bash_logout, dircolors,.inputrc and .vimrc. The dots preceding the names of these files indicate that they arehidden files, i.e., files that are not normally visible in order to avoid visual clutter and help reduce the chances of accidental damage.

The contents of /etc/skel can be viewed by using the ls (i.e., list) command with its-a option (which shows all files and directories, including hidden ones), i.e.,

ls -a /etc/skel

The location of /etc/skel can be changed by editing the line that begins with SKEL= in the configuration file/etc/default/useradd. By default this line says SKEL=/etc/skel.

It is usually better to keep /etc/skel as small as possible and put system-wide configuration items into global configuration files such as/etc/profile. This is because the latter makes it much easier to update existing users' files because its settings take effect as soon as the system is turned on and apply to new users and old uses alike.

When a user is removed from the system by an administrator with the userdel command, that user's home directory, including the files and directories that have been copied into it from /etc/skel, remains intact.

The name of the directory skel is derived from the word skeleton, because the files it contains form the basic structure for users' home directories.

转自:http://www.bellevuelinux.org/etc_skel.html


验证:
huanlf:/etc/skel# pwd
/etc/skel

huanlf:/etc/skel# ls -a
.  ..  .bash_profile  .bashrc

huanlf:/etc/skel# ls /home/
huanlf  knoppix

huanlf:/etc/skel# touch hello world

huanlf:/etc/skel# useradd -m huan

huanlf:/etc/skel# ls -a /home/huan/
.  ..  .bash_profile  .bashrc  hello  world
huanlf:/etc/skel# 
0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 登录微信收不到验证码怎么办 红米手机黑白屏怎么办 手机登录不上电子邮件怎么办 如果台湾发生骚乱大陆怎么办 80端口被占用了怎么办? qq邮箱服务器密码忘记了怎么办 对方身份异常请验证怎么办 qq附近人屏蔽了怎么办 快递地址填错了怎么办 快递填错地址已经发货怎么办 淘宝受到卖家威胁怎么办 消费者被外卖商家威胁怎么办 拼多多商家打电话威胁怎么办 退款被拒商家还威胁怎么办? 打错电话给领导怎么办 领导送礼物给我怎么办 南瓜饼和面很稀怎么办 包饺子剩的肉馅怎么办 发好的面团粘手怎么办 富士变频器减速时间过电流怎么办 铺木地板地面不是很平怎么办 眼镜被铁锈烫了怎么办 平车机针头小了怎么办 mk包五金坏了怎么办 迁坟原来的棺材怎么办 新建定额项目没有措施项目怎么办 太岁符忘记烧了怎么办 穿裙子去了寺庙怎么办 美甲彩绘胶干了怎么办 美甲彩绘胶稀怎么办 彩绘胶弄衣服上怎么办 彩绘胶买来太稠怎么办 做指甲没有底胶怎么办 交定金后发现房屋不合法怎么办 买车付了定金不想要了怎么办 买车付定金后不想要怎么办 非法经营的产品至人伤亡怎么办 返修漆施工不对色怎么办 叶子板撞变形了怎么办 挤了三角区疖子怎么办 三角部位太鼓的怎么办