2021年10月19日星期二

How to add multiple user with sh?




Step 1. mkdir bin

Step 2.cd/root/bin

Step3.vim useradd.sh

#:/bin/bash

groupadd workstation

for username in workstation1 workstation2 workstation3 workstation4 workstation5

do

        useradd -G workstation $username

        echo "password" | passwd --stdin $username

done


Step4.sh useradd.sh

Step5.id workstation1


沒有留言:

發佈留言

歡迎留下寶貴意見

資訊資產盤點

 https://forms.gle/KP7VuzdRgFyT3kqX9 https://docs.google.com/spreadsheets/d/1JrCSUoK8DFm4SloUYkofqvYNdy3ArDy7gQ376vT-6HQ/edit?usp=sharing