Home / Operating System / Linux / Cài đặt SSH trên CentOS(Fedora,Redhat)

Cài đặt SSH trên CentOS(Fedora,Redhat)

OpenSSH Installations under CentOS Linux

+> Gõ lệnh sau để cài SSH Server và SSH Client:

# yum -y install openssh-server openssh-clients

+> Cấu hình để chạy như một service khi khởi động

# chkconfig sshd on
# service sshd start

+> Đảm bảo cổng 22 đã được mở.

# netstat -tulpn | grep :22

+> Chỉnh sửa file /etc/sysconfig/iptables (IPv4 firewall).

# vi /etc/sysconfig/iptables

+> Thêm dòng:

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT

+> Nếu muốn hạn chế truy cập:

-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -m state –state NEW -p tcp –dport 22 -j ACCEPT

+>Nếu sử dụng IPv6 thì thêm dòng này:

-A RH-Firewall-1-INPUT -m tcp -p tcp –dport 22 -j ACCEPT

+>Lưu và đóng lại:

# service iptables restart

+> Để config nhiều option hơn thì tham khảo file:  

     /etc/ssh/sshd_config

About dongpolicex2

Check Also

cài đặt ffmeg

Cài đặt FFmpeg + FFmpeg-PHP +Lame + Ruby + Mplayer + Mencoder + flv2tool

Cài đặt FFmpeg + FFmpeg-PHP +Lame + Ruby + Mplayer + Mencoder + flv2tool Để …

Leave a Reply

Translate »
0902 780 887