linux 下 Open SSH 网络安全连接实用配置(实践篇)
环境说明:linux redhat+SSH Secure Shell 3.2.9 (Build 283)
下载地址:http://www.ssh.com/
Open SSH 是SSH(Secure Shell)协议的免费开源软件,是一种在主机之间通过加密和身份认证机制提供安全连接的协议。该协议默认使用DSA (Digital Signature Algorithm)数字签名算法.
一、SSH安装
默认linux系统已经安装SSH,所以不必自己再装,在此省略。
二、启动和停止ssh
# service sshd start
# service sshd stop
# service sshd restart
三、配置文件说明
守护进程默认主配置文件/etc/ssh/sshd_config,客户端配置文件ssh_config,包含DSA私钥文件ssh_host_dsa_key,包含DSA公钥文件ssh_host_dsa_key.pub,主配置文件参数选项优先生效。
1)修改守护进程默认主配置文件/etc/ssh/sshd_config
[root@linuxserver ssh]# vi sshd_config
Port 4699 #修改默认端口为4699,可根据实际情况设置端口号,这样能保护系统相对安全。
2)修改客户端配置文件ssh_config
[root@linuxserver ssh]# vi ssh_config
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
# Site-wide defaults for various options
# Port 22
Port 4699 #修改默认端口为4699,可根据实际情况设置端口号,这样能保护系统相对安全。
四、安装ssh客户端连接工具
ok,修改完配置文件后,重启服务即可,配置客户端ip,port,用户名,输入密码连接即可。
参考文献:
杨明华《Linux系统与网络服务管理技术大全 完全手册》,电子工业出版社 2008年版