/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#
- /etc/skel的作用
- /etc/skel的作用
- /etc/skel
- linux /etc/skel 目录
- 解析Linux /etc/skel
- 浅析/etc/skel 目录
- linux:/etc/skel 文件夹
- /etc/skel/目录
- Linux下/etc/skel框架目录的简介与使用
- Linux下/etc/skel框架目录的简介与使用
- linux下/etc/skel目录解释
- /etc/oratab的作用
- etc各个文件的作用
- /etc/inittab文件的作用
- /etc/hosts文件的作用
- /etc/hosts.allow和/etc/hosts.deny的作用
- Linux的/etc/services文件的作用?
- linux中/etc/init.d的作用
- Linux实习培训笔记(三)
- Linux实习培训笔记(二)
- Linux实习培训笔记(一)
- 是否该自称为程序员
- 2015年4月26日又一次难忘
- /etc/skel的作用
- 《管理概论》第一周管理导论
- 【OpenCV】图像变换(四-1)-霍夫变换线段检测
- 安装src.rpm软件包
- 一步一个脚印学算法——希尔排序算法
- CentOS 5.3(Kernel2.6.18.128)支持ntfs分区
- windows8.1下配置ise14.7
- Singapore Citizenship AIP (Approve in principle)
- Android反编译