Skip to content

Instantly share code, notes, and snippets.

@Edison-Hsu
Last active August 23, 2017 10:41
Show Gist options
  • Save Edison-Hsu/b90acf5af30ee5217cb08f6535d5ed86 to your computer and use it in GitHub Desktop.
Save Edison-Hsu/b90acf5af30ee5217cb08f6535d5ed86 to your computer and use it in GitHub Desktop.

Revisions

  1. Edison-Hsu revised this gist Aug 23, 2017. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion new_user_with_sudo.txt
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,10 @@ usermod -aG sudo #{username}

    # Test sudo access on new user account
    su - #{username}
    sudo ls -la /root
    sudo ls -la /root


    su - #{username}
    mkdir ~/.ssh
    touch authorized_keys
    # add key
  2. Edison-Hsu renamed this gist Aug 21, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. Edison-Hsu renamed this gist Aug 21, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. Edison-Hsu revised this gist Aug 21, 2017. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1 +1,9 @@
    `adduser username`
    # Use the adduser command to add a new user to your system.
    adduser #{username}

    # Use the usermod command to add the user to the sudo group.
    usermod -aG sudo #{username}

    # Test sudo access on new user account
    su - #{username}
    sudo ls -la /root
  5. Edison-Hsu created this gist Aug 21, 2017.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    `adduser username`