Skip to content

Instantly share code, notes, and snippets.

@vuthaihoc
Created May 30, 2020 15:45
Show Gist options
  • Save vuthaihoc/0236055ff0c273321387a5f349e6e982 to your computer and use it in GitHub Desktop.
Save vuthaihoc/0236055ff0c273321387a5f349e6e982 to your computer and use it in GitHub Desktop.
Centos scripts

Login as root and ...

# create new user
useradd hocvt
# change pass
passwd hocvt
# add to sudoer
usermod -aG wheel hocvt
# login to created user
su hocvt
# goto home
cd ~
# create .ssh folder
mkdir .ssh
# change mod (required by sshd see https://wiki.centos.org/HowTos/Network/SecuringSSH heading 7th)
chmod 700 .ssh
cd .ssh/
# create authorized_keys file
vim authorized_keys
# .... paste your public key and save
# chmod
chmod 600 authorized_keys
# Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment