Andy
A-ndy.dev

A-ndy.dev

Secure your SSH access

Andy's photo
Andy
·Aug 7, 2021·

1 min read

Create New Account

$ adduser admin1 --home /var/www

Add New Account as Sudoers

$ nano /etc/sudoers

Disable root account

$ nano /etc/ssh/sshd_config

Change root login PermitRootLogin yes change to PermitRootLogin no Change SSH port Port 22 change to Port e.q 2223 Restart SSH

$ service ssh restart

Change Owner www/html folder

$ sudo chown -R admin1:root /var/www/html

 
Share this