Add new user account on CentOS

# Create your new user
adduser userName

# Set user password
passwd userName

 

Give root access

# Add your user to the wheel group
gpasswd -a userName wheel

 

Add Public Key Authentication

# Generate your key locally
ssh-keygen

# Get your key
cat ~/.ssh/id_rsa.pub

 

Add the ssh key on your server

# Login on the new user account
su userName

cd ~

# Create your ssh directory
mkdir .ssh
chmod 700 .ssh

# Add your key
nano .ssh/authorized_keys

# save and exit
chmod 600 .ssh/authorized_keys


 

Allow to run sudo commands without password

nano /etc/sudoers

# Search for %wheel
# ## Same thing without a password
# Now, uncomment : %wheel  ALL=(ALL)	NOPASSWD: ALL
%wheel  ALL=(ALL)	NOPASSWD: ALL

Reload sshd

systemctl reload sshd

 

Linux Python Security
Use Python Requests to Authenticate
Using requests, you can authenticate on a secure website. This method, will also read the CSRF field and cookie, and get it ready for the validation.
Python Tutorials
Create daily snapshots using Python on Digitalocean
Use python to automatically create daily snapshots on digitalocean. This script will generate the new snapshot and automatically remove the old one.
Top