zoukankan      html  css  js  c++  java
  • Linux创建用户时让每个用户家目录中自带说明文档

    新用户创建时模板文件放在/etc/skel中,只要在skel中放入相应文档,即可在创建用户时在其家目录中产生对应文档

    [00:30:48 root@C8[ ~]#ll -a /etc/skel/   ##在skel中新增.Welcome文件
    total 24
    drwxr-xr-x.   2 root root   95 Jul 13 00:30 .
    drwxr-xr-x. 103 root root 8192 Jul 12 23:42 ..
    -rw-r--r--.   1 root root   18 Nov  9  2019 .bash_logout
    -rw-r--r--.   1 root root  141 Nov  9  2019 .bash_profile
    -rw-r--r--.   1 root root  312 Nov  9  2019 .bashrc
    -rw-r--r--.   1 root root    0 Jul 13 00:07 null.test
    -rw-r--r--.   1 root root    0 Jul 13 00:30 .Welcome
    [00:30:54 root@C8[ ~]#useradd test985     ##新建用户test985
    [00:31:17 root@C8[ ~]#ll -a /home/test985/ ##查看自动创建的家目录
    total 12
    drwx------. 2 test985 test985  95 Jul 13 00:31 .
    drwxr-xr-x. 4 root    root     36 Jul 13 00:31 ..
    -rw-r--r--. 1 test985 test985  18 Nov  9  2019 .bash_logout
    -rw-r--r--. 1 test985 test985 141 Nov  9  2019 .bash_profile
    -rw-r--r--. 1 test985 test985 312 Nov  9  2019 .bashrc
    -rw-r--r--. 1 test985 test985   0 Jul 13 00:07 null.test
    -rw-r--r--. 1 test985 test985   0 Jul 13 00:30 .Welcome  ##赫然在列
    [00:31:39 root@C8[ ~]#ll -a /home/test211/  ##查看之前创建的test211用户家目录
    total 12
    drwxr-xr-x. 2 root root  79 Jul 13 00:16 .
    drwxr-xr-x. 4 root root  36 Jul 13 00:31 ..
    -rw-r--r--. 1 root root  18 Jul 13 00:16 .bash_logout
    -rw-r--r--. 1 root root 141 Jul 13 00:16 .bash_profile
    -rw-r--r--. 1 root root 312 Jul 13 00:16 .bashrc
    -rw-r--r--. 1 root root   0 Jul 13 00:16 null.test  ##只有之前创建的文件,没有Welcome
    
    * * * 胖并快乐着的死肥宅 * * *
  • 相关阅读:
    人不能乱说
    信息不可透露

    一波韭菜又一波韭菜,割了一波又一波
    截取等宽中英文字符串(比如截取2个,中午截取两个字,英文截取四个单词)
    nhibernate 配置nvarchar(max)
    angularjs 自带的过滤器
    检测是否是IE浏览器
    WebClient 使用
    从流获取缩略图
  • 原文地址:https://www.cnblogs.com/bpzblog/p/13291217.html
Copyright © 2011-2022 走看看