SSH là một giao thức cho phép chúng ta dùng shell trên linux một cách bảo mật hơn rất nhiều so với dùng telnet. Ngoài ra SSH còn cho phép ta tranfer data như FTP . Vậy chương này xin phép giới thiệu cấu hình cơ bản SSH:
Command line cấu hình startup service OpenSSH
[root@vinashares tmp]# chkconfig sshd on
[root@vinashares tmp]# service sshd start
[root@vinashares tmp]# service sshd stop
[root@vinashares tmp]# service sshd restart
[root@vinashares tmp]# service sshd start
[root@vinashares tmp]# service sshd stop
[root@vinashares tmp]# service sshd restart
Kiểm tra trạng thái kết nối của SSH ta dùng :
[root@vinashares tmp]# pgrep sshd
SSH2 bảo mật hơn so với SSH1 thế nên chúng te nên dùng ssh2 để config /etc/ssh/sshd_config .
Trích:
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22 –> thiết lập port cho SSH , mặc đinh là port 22, ta có thể change port ở đây.
#Protocol 2,1 –> sử dụng SSH 2. Nên dùng
#Protocol 2,1 –> sử dụng SSH 2. Nên dùng
#ListenAddress 0.0.0.0
#ListenAddress ::
#ListenAddress ::
………………..
Thông số trên cho phép ta lựa chọn port cho ssh , protocol cho SSH2. Lời khuyên là nên chọn SSH2.
Cho phép root không được login bằng SSH:
Cho phép root không được login bằng SSH:
Không có nhận xét nào:
Đăng nhận xét