使用 Shell Script 大量新增 Linux 使用者
環境
OS: Ubuntu 18.04
#!/bin/bash
users=(user1 user2 user3)
for user in "${users[@]}"
do
adduser --disabled-password --gecos "" $user
usermod -a -G sudo $user
echo "${user}:${user}" | chpasswd
chage -d 0 $user
done
adduser --disabled-password --gecos 關閉密碼詢問互動,新建使用者
usermod -a -G sudo 新增使用者至群主 (這邊是把使用者加入 sudo 群組,讓他們可以使用 sudo)
echo "${user}:${user}" | chpasswd 更改使用者密碼與使用者帳號一至
chage -d 0 $user 要求使用者第一次登入必須更改密碼
The selection of video games at Red Dog Casino is sufficiently small, with just below a hundred and twenty totally different slot video games on supply. BitStarz is a superb online on line casino that provides hours of leisure enjoyable with its superb selection of over 3800 video games. We love their selection of BitStarz exclusive video games that you'll not find wherever else on 코인카지노 the web. They even have excellent buyer assist with a complete FAQs section as well as|in addition to} e-mail and stay chat assist.
回覆刪除