Skip to content

Instantly share code, notes, and snippets.

@KarimullinArthur
Last active March 10, 2024 13:21
Show Gist options
  • Save KarimullinArthur/d5199fb7162dd547826e2d081d7c1011 to your computer and use it in GitHub Desktop.
Save KarimullinArthur/d5199fb7162dd547826e2d081d7c1011 to your computer and use it in GitHub Desktop.
create bot on server (tmp)
#!/usr/bin/bash
ADMIN_USER=arthur
echo Bot Name
read name
useradd -s /bin/bash $name
mkdir /home/$name
passwd $name
usermod -aG sudo $name
ln -s /home/$ADMIN_USER/.profile /home/$name/.profile
ln -s /home/$ADMIN_USER/.bashrc /home/$name/.bashrc
mkdir /home/$name/.ssh
ln -s /home/$ADMIN_USER/.ssh/id* /home/$name/
chown -R $name /home/$name
chgrp -R $name /home/$name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment