Thứ Hai, 9/06/2025
Loading...
  • Login
Hoàng Giang Nam Blog
  • Home
  • WordPress
    • WordPress
    • Woocommerce
  • Windows
  • Office
  • Phần Mềm
  • Thủ thuật
  • Linux
    • Ubuntu
    • CentOS
    • VPS – Server
    • Web Server
No Result
View All Result
Hoàng Giang Nam Blog
  • Home
  • WordPress
    • WordPress
    • Woocommerce
  • Windows
  • Office
  • Phần Mềm
  • Thủ thuật
  • Linux
    • Ubuntu
    • CentOS
    • VPS – Server
    • Web Server
No Result
View All Result
  • Login
Hoàng Giang Nam Blog
No Result
View All Result
Home Chung
Thay đổi port SSH của VPS

Thay đổi port SSH của VPS

admin by admin
19/12/2024
Share on FacebookShare on Twitter

Mục lục

  1. Login vào VPS sử dụng quyền root
  2. Chỉnh sửa file sshd_config
  3. Mở port nếu dùng firewall

Các bạn mua VPS thường sẽ nhận port mặc định  là 22. Hoặc bị đổi qua port khác thì các bạn cũng cứ nên thay đổi port sang port của bạn với mọi VPS của bạn thì tốt hơn.

Thay đổi port SSH của VPS

Bây giờ, mình hướng dẫn các bạn đổi port 2222 qua port khác.

Login vào VPS sử dụng quyền root

Chỉnh sửa file sshd_config

nano /etc/ssh/sshd_config

Tìm kiếm dòng #Port 2222, bỏ dấu # ở đầu và thay bằng port bạn muốn dùng, ví dụ 2468 (Port này được sử dụng trên Windows chứ không dùng trên Linux)

Mở port nếu dùng firewall

Stop iptables

service iptables stop

Mở port 2468

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 2468 -j ACCEPT

Khởi động lại SSHD service

service sshd reload

Lưu và khởi động lại iptables

service iptables saveservice iptables start

Vậy là xong rồi đó, hãy login lại SSH sử dụng port mới xem nào.

Tags: PortSSHVPS
admin

admin

Next Post
Backup VPS lên Google Drive với Rclone

Backup VPS lên Google Drive với Rclone

Please login to join discussion

Recommended.

Dùng thử VPS Linode trong 60 Ngày với 100$ Credit trải nghiệm dịch vụ

Dùng thử VPS Linode trong 60 Ngày với 100$ Credit trải nghiệm dịch vụ

01/01/2025
HuananZhi X79 / X99 Motherboard BIOS POST codes

HuananZhi X79 / X99 Motherboard BIOS POST codes

01/01/2025

Trending.

HuananZhi X79 / X99 Motherboard BIOS POST codes

HuananZhi X79 / X99 Motherboard BIOS POST codes

01/01/2025
Tạo file IMG Windows.GZ bằng VM VirtualBox để cài đặt trên VPS Digitalocean, Linode

Tạo file IMG Windows.GZ bằng VM VirtualBox để cài đặt trên VPS Digitalocean, Linode

31/12/2024
Cài đặt AApanel & TOR network

Cài đặt AApanel & TOR network

01/01/2025
Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

19/12/2024
Sử dụng Nginx làm Reverse Proxy cho nhiều trang web

Sử dụng Nginx làm Reverse Proxy cho nhiều trang web

18/12/2024
Hoàng Giang Nam

Blog chia sẽ kiến thức lập trình, source code, themes, plugin, phần mềm & thủ thuật máy tính...

Follow Us

Danh mục

  • CentOS
  • Chung
  • Server Email
  • Thủ thuật máy tính
  • Ubuntu
  • VPS – Server
  • Web Server
  • Windows
  • Woocommerce
  • Wordpress

Recent News

Disable Web Search Results in Windows 10/11 Start Menu

16/01/2025
Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

19/12/2024
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2024 Hoanggiangnam.com

No Result
View All Result
  • Home
  • Phần Mềm
  • Thủ thuật máy tính
  • WordPress
  • Ubuntu
  • Office
  • Photography
  • Windows

© 2024 Hoanggiangnam.com

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Click to Copy