Tyleo-Scripts/irp-srv-acc

24 lines
771 B
Text
Raw Normal View History

2024-02-18 18:06:30 +00:00
# Setup Service Account
clear
echo ===========================================
echo = Server Node Installation as Docker Host =
echo ===========================================
echo = Patching Sudo with Ruby Group Patch...
groupadd --gid 50000 ruby
echo "%ruby ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ruby-root
echo = Service Account Creation...
echo -n "= Username (lowercase): "
read Suid
echo = Creating $Suid...
useradd -d /home/service-$Suid -m $Suid
echo = Defining Shell to FiSH...
usermod --shell /usr/bin/fish $Suid
usermod --shell /usr/bin/fish root
echo = Adding to Groups Wheel, Ruby and Docker...
usermod -aG wheel $Suid
usermod -aG ruby $Suid
usermod -aG docker $Suid
echo = Set Password for $Suid Account...
passwd $Suid
echo = Setup $Suid Quick Sudo...