更新 'cg_init_machine.sh'

support ubuntu 16
This commit is contained in:
toby 2022-12-28 21:30:35 +08:00
parent b99c861370
commit 350460eb61
1 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,12 @@
#!/bin/bash #!/bin/bash
getent group wheel || groupadd wheel getent group wheel || groupadd wheel
useradd cg_maintain_user useradd cg_maintain_user
if command -v groupmems &> /dev/null
then
groupmems -g wheel -a cg_maintain_user groupmems -g wheel -a cg_maintain_user
else
usermod -a -G wheel cg_maintain_user
fi
echo '%wheel ALL=(ALL:ALL) ALL' | EDITOR='tee -a' visudo echo '%wheel ALL=(ALL:ALL) ALL' | EDITOR='tee -a' visudo
mkdir -p /home/cg_maintain_user/.ssh mkdir -p /home/cg_maintain_user/.ssh
touch /home/cg_maintain_user/.ssh/authorized_keys touch /home/cg_maintain_user/.ssh/authorized_keys