Last active
October 1, 2024 21:30
-
-
Save netravnen/cf1833ac32dbd897accab3d0b2df5524 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read -p "Useraccount: " user_account | |
# sh -c 'if [ -d $HOME/.dotfiles ]; then rm $HOME/.dotfiles; fi | |
# git clone https://code.netravnen.org/netravnen/dotfiles $HOME/.dotfiles | |
# for FILE in $(ls -al1 $HOME/.dotfiles/dotfiles | grep "^-" | cut -c52-); do | |
# if [ -f $HOME/$FILE ]; then rm $HOME/$FILE; fi # Remove conflicting files in homedir | |
# done | |
# if [ -d $HOME/.byobu ]; then rm -rf $HOME/.byobu; fi # Remove byobu from homedir | |
# cd $HOME/.dotfiles && git pull && stow -R dotfiles && cd | |
# source .bashrc' user_account | |
adduser --disabled-password --shell /bin/bash --home /home/artomaton artomaton | |
if ! [ -d /home/artomaton/.ssh ]; then mkdir -p /home/artomaton/.ssh; fi | |
cat <<EOF > /home/artomaton/.ssh/authorized_keys | |
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAH8OAaKbEkZLTAfuWTR/VSq3TKAfC0YVXOKLfnYWamiXB927ISuG19v/5Vxlu29ZWjxCg0lCEeR1c08q3oIA4jKFgBAeHEFm2bgF42JPlrqPp8EDyg9/VzqJmky808aoIlXnfO6K/kENRRMzT3A7vmE5xQFmAmTJ3bP8HgKS15SlrY6NQ== "ECDSA_netra@DESKTOP-NIA3O9L | |
EOF | |
if [ -d /home/artomaton ]; then | |
chown -R artomaton:artomaton /home/artomaton | |
chmod 0700 /home/artomaton/.ssh | |
chmod 0600 /home/artomaton/.ssh/authorized_keys | |
fi | |
cat <<EOF > /etc/sudoers.d/sudoers | |
artomaton ALL=(ALL:ALL) NOPASSWD: ALL | |
EOF | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment