Skip to content

Instantly share code, notes, and snippets.

@KarimullinArthur
Last active March 10, 2024 13:21
Show Gist options
  • Select an option

  • Save KarimullinArthur/d5199fb7162dd547826e2d081d7c1011 to your computer and use it in GitHub Desktop.

Select an option

Save KarimullinArthur/d5199fb7162dd547826e2d081d7c1011 to your computer and use it in GitHub Desktop.

Revisions

  1. KarimullinArthur revised this gist Mar 10, 2024. 1 changed file with 0 additions and 0 deletions.
    Empty file modified create_bot.sh
    100644 → 100755
    Empty file.
  2. KarimullinArthur created this gist Oct 25, 2023.
    21 changes: 21 additions & 0 deletions create_bot.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/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