This page looks best with JavaScript enabled

secure your vps

 ·  ☕ 1 min read  ·  ✍️ CheeseMocha

create a new account, allow sudo permission

useradd testuser
passwd testuser

vi /etc/sudoers

1
2
3
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
testuser ALL=(ALL)       ALL
1
2
## Same thing without a password
testuser ALL=(ALL) NOPASSWD: ALL

chage logon port

vi /etc/ssh/sshd_config

firewall-cmd –permanent –zone=public –add-port=8822/tcp
firewall-cmd –reload
iptables -A INPUT -p tcp –dport 8822 -j ACCEPT
service sshd restart

disable root login

vi /etc/ssh/sshd_config

PermitRootLogin No

service sshd restart

Share on

cheesemocha