This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
install-scripts/user.sh

19 lines
443 B
Bash
Raw Normal View History

2020-03-19 19:07:07 +00:00
#!/bin/sh
useradd -m -s /bin/bash "$_user"
groupadd sudo
usermod -aG sudo "$_user"
mkdir /home/"$_user"/.ssh
cp /root/.ssh/authorized_keys /home/"$_user"/.ssh/
chown "$_user": /home/"$_user"/.ssh/authorized_keys
passwd -d "$_user"
chage -d 0 "$_user"
2020-03-19 19:11:41 +00:00
if command -v apt-get ; then
apt-get update && apt-get -y upgrade && apt-get -y install sudo
else
echo "Error - no package installer found."
fi
2020-03-19 19:07:07 +00:00
# TODO ensure group sudo is allowed sudo