برای امنیت بیشتر بر روی CentOS 6یا 7 ,SSH Port خود را تغییر دهید

برای امنیت بیشتر بر روی CentOS 6یا 7 ,SSH Port خود را تغییر دهید

به نظر میرسد که همه برای وصل شدن  به سرورشان با  SSH از port 22 استفاده میکنند.به نظر من این فقط راهی است برای اینکه یک حمله کننده راحت تر سرور شما را هدف قرار دهد

تغییر  SSH por روی سرور به نظر سخت میرسد اما واقعا بسیار ساده است

در ابتدا ما باید فایل کانفیگ (SSHD (SSH server daemon را ویرایش کنیم

vi /etc/ssh/sshd_config

Add the following code to either the top or the bottom of the configuration file

# SSH Port
Port 2124  # the port you want to change it to

Next, we’ll update the firewall. If you have disabled the firewall, skip this step. My example uses port 2124. For CentOS 6 users, run these commands:

iptables -I INPUT -p tcp --dport 2124 --syn -j ACCEPT
service iptables save
semanage port -a -t ssh_port_t -p tcp 2124

CentOS 7 users, run these commands instead:

firewall-cmd --add-port 2124/tcp --permanent
firewall-cmd --add-port 2124/tcp

The configuration changes are now finished. Restart the SSH server (SSHD)…

service sshd restart

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *