Skip to content

Instantly share code, notes, and snippets.

@md-shadhin
Created December 6, 2018 18:49
Show Gist options
  • Select an option

  • Save md-shadhin/773cda1c3104d76f35b9917b815be64a to your computer and use it in GitHub Desktop.

Select an option

Save md-shadhin/773cda1c3104d76f35b9917b815be64a to your computer and use it in GitHub Desktop.

Revisions

  1. md-shadhin created this gist Dec 6, 2018.
    19 changes: 19 additions & 0 deletions problem-3.ssh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #1 Add user without password non-interactively
    adduser --disabled-password --gecos "" username_new_user

    #2 Grant root access to the user
    usermod -aG sudo username_new_user

    #3 Create a folder named .ssh
    cd /home/username_new_user
    mkdir ~/.ssh

    #4 Create a blank file named id_rsa
    cd ~/.ssh
    touch id_rsa

    #5 Change the file permission of id_rsa
    sudo chmod 0444 id_rsa

    #6 Change the ownership
    sudo chown -R username_new_user: /home