作用: SSHD 服务用户远程主机连接、主机间文件互传,
protocal:ssh(secure shell)安全壳协议
Description :
SSH (Secure SHell) is a program for logging into and executing
commands on a remote machine. SSH is intended to replace rlogin and
rsh, and to provide secure encrypted communications between two
untrusted hosts over an insecure network. X11 connections and
arbitrary TCP/IP ports can also be forwarded over the secure channel.
默认端口:22
配置文件:
/etc/ssh/ssh_config 客户端配置文件
/etc/ssh/ sshd_config 服务端配置文件
一般只需改服务器端配置文件
配置文件常用修改项:
13 #Port 22 端口,ssh默认是22,安全考虑可以修改默认端口号;
可添加一行设置多端口监听
15 #ListenAddress 0.0.0.0 监听地址:默认监听所有ip地址
16 #ListenAddress :: ipv6表示形式,监听所有地址
可以添加一个新的网卡,设置新的ip地址,将其设置为监听地址,则客户端只能连接新的ip
21 Protocol 2 默认支持2版本,若要支持1版本,只需在2后面加,1即可
26 #HostKey /etc/ssh/ssh_host_rsa_key 无交互登录密钥加密方式,默认为rsa
27 #HostKey /etc/ssh/ssh_host_dsa_key
31 #ServerKeyBits 1024 加密密钥长度
36 SyslogFacility AUTHPRIV 日志记录位置:可查看 /etc/rsyslog.conf 中的配置,默认是
所以,ssh日志默认记录在 /var/log/secure
37 #LogLevel INFO 记录INFO及以上级别的日志信息
41 #LoginGraceTime 2m ssh连接等待密码输入时间,默认2分钟没输入密码连接中断
42 #PermitRootLogin yes 允许root用户ssh连接,安全考虑,设为no
47 #RSAAuthentication yes rsa密钥验证
64 #PasswordAuthentication yes 密码验证,yes
65 #PermitEmptyPasswords no 允许空密码登录,不用许
81 GSSAPIAuthentication yes 内网可关闭已提高连接速度
112 #PrintMotd yes 连接时打印/etc/motd中的内容
113 #PrintLastLog yes 连接时显示用户上次登录日志信息
116 #UsePrivilegeSeparation yes 开启时,非root用户登录将创建非root用户的进程,利于系统安全
122 #UseDNS yes 验证dns,关闭后可提高连接速度
123 #PidFile /var/run/sshd.pid sshd服务的pid
另:
查看系统是否已安装openssh:
[root@fan_client_40 Packages]# rpm -qa | grep openssh
openssh-askpass-5.3p1-94.el6.x86_64
openssh-5.3p1-94.el6.x86_64
openssh-clients-5.3p1-94.el6.x86_64
openssh-server-5.3p1-94.el6.x86_64
查看具体软件包作用:
[root@fan_client_40 Packages]# rpm -qpi openssh-clients-5.3p1-94.el6.x86_64.rpm