以编程方式克隆新用户的/ etc / skel

时间:2017-12-05 21:22:04

标签: linux ubuntu centos redhat pam

/etc/skel是将为新用户克隆的文件夹。有没有办法可以定义规则从/etc/skel文件夹中复制什么?

例如,我正在寻找一种方法,如果用户被创建并属于名为A的组,则克隆除/etc/skel之外的/etc/skel/not_for_a.txt文件夹。可能的?

1 个答案:

答案 0 :(得分:0)

If the file /usr/local/sbin/adduser.local exists, it will be exe‐ cuted after the user account has been set up in order to do any local setup. The arguments passed to adduser.local are: username uid gid home-directory

我可以使用/usr/local/sbin/adduser.local在创建用户后调用命令