33 lines
891 B
Bash
Executable File
33 lines
891 B
Bash
Executable File
#!/bin/sh
|
|
|
|
_cmd_su="su --login $_user -c"
|
|
|
|
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"
|
|
|
|
if command -v apt-get ; then
|
|
apt-get update && apt-get -y upgrade && apt-get -y install sudo git
|
|
else
|
|
echo 'Error - no package installer found.'
|
|
exit 1
|
|
fi
|
|
|
|
$_cmd_su "git config --global user.email '$_git_user_email'"
|
|
$_cmd_su "git config --global user.name '$_git_user_name'"
|
|
# TODO populate global .gitignore
|
|
# *.swp
|
|
# node_modules/
|
|
' Session.vim'
|
|
|
|
# TODO ensure group sudo is allowed sudo
|
|
|
|
# TODO - use a minimal .profile instead
|
|
$_cmd_su git clone https://git.rayelliott.dev/dots/profile.git /home/$_user/.config/profile
|
|
$_cmd_su cat /home/$_user/.config/profile/profile >> /home/$_user/.profile
|