Last active
March 10, 2024 13:21
-
-
Save KarimullinArthur/d5199fb7162dd547826e2d081d7c1011 to your computer and use it in GitHub Desktop.
create bot on server (tmp)
This file contains hidden or 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
#!/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