在RedHat和CentOS等版本的linux中,SSH服务有两个配置文件,大家可以通过修改配置文件永久修改SSH的
配置信息。两个文件都在"/etc/ssh"目录下,分别是:
</pre><pre name="code" class="python">
<span style="font-family:Comic Sans MS;font-size:12px;">[root@localhost ssh]# ll /etc/ssh</span>
-rw-r--r--. 1 root root 2049 1118 16:33 ssh_config
-rw-------. 1 root root 3877 1118 16:41 sshd_config
ssh_config配置ssh客户端程序,表示通过ssh其他服务器时的默认值,下面是部分选项:
sshd_config是服务器选项,在客户端登录本机时起作用。下面是部分选项:
# ForwardAgent no
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# Port 6622
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
Port 6622
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
#LogLevel INFO
#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedKeysCommand none