Execute shell script everytime a new user is created

后端 未结 3 1992
小蘑菇
小蘑菇 2021-02-15 17:27

What would be the easiest way to execute a command everytime a new user is added?

I checked through /etc/adduser.conf but nothing is in there which looks li

3条回答
  •  情书的邮戳
    2021-02-15 18:11

    From man adduser:

       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
    

    Looks like you can add your user-creation actions here.

提交回复
热议问题