---
# System prepended metadata

title: CentOS SSH port changing
tags: [Linux]

---

---
tags: Linux
---

# CentOS SSH port changing
1. Changing sshd_config
echo "Port 2222" >> /etc/ssh/sshd_config
or
vi /etc/ssh/sshd_config
2. Configure firewall
firewall-cmd --permanent --remove-service=ssh
firewall-cmd --permanent --add-port=2222/tcp
firewall-cmd --reload
3. Restart SSH service
systemctl restart sshd.service
4. Check SSH status
systemctl status sshd.service
 