Created
December 9, 2018 13:32
-
-
Save bhuiyanmobasshir94/01e4b27cef064fcc16bfe545bf961298 to your computer and use it in GitHub Desktop.
Linux basic commands dist - Ubuntu 16.04
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
# Add User Non-interactively without password | |
1. sudo adduser --disabled-password --gecos "" username | |
# Grant root access to the user so s/he can execute sudo without a password. | |
1. sudo visudo | |
#After includedir /etc/sudoers.d put-. | |
2. username ALL=(ALL) NOPASSWD: ALL | |
# Create a folder named .ssh in the user’s home directory. | |
1. mkdir /home/username/.ssh | |
# Create a blank file named id_rsa in the .ssh folder. | |
1. cd /home/username/.ssh | |
2. > id_rsa | |
# Change the file permission of id_rsa so that it can only be read by a user. | |
1. chmod u+r,g-r,o-r id_rsa | |
# Change the ownership of the user’s home directory (including all files and folders) to the user. | |
1. sudo chown -R user: group /home/user/dir/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment