# Site-wide defaults for various options
Host *
ForwardAgent no
ForwardX11 no
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes
PasswordAuthentication yes
FallBackToRsh no
UseRsh no
BatchMode no
CheckHostIP yes
StrictHostKeyChecking no
IdentityFile ~/.ssh/identity
Port 22
Cipher blowfish
EscapeChar ~
下面逐行说明上面的选项设置:
Host *
选项“Host”只对能够匹配后面字串的计算机有效。“*”表示所有的计算机。
ForwardAgent no
“ForwardAgent”设置连接是否经过验证代理(如果存在)转发给远程计算机。
ForwardX11 no
“ForwardX11”设置X11连接是否被自动重定向到安全的通道和显示集(DISPLAY set)。
RhostsAuthentication no
“RhostsAuthentication”设置是否使用基于rhosts的安全验证。
RhostsRSAAuthentication no
“RhostsRSAAuthentication”设置是否使用用RSA算法的基于rhosts的安全验证。
# This is ssh server systemwide configuration file.
Port 22
ListenAddress 192.168.1.1
HostKey /etc/ssh/ssh_host_key
ServerKeyBits 1024
LoginGraceTime 600
KeyRegenerationInterval 3600
PermitRootLogin no
IgnoreRhosts yes
IgnoreUserKnownHosts yes
StrictModes yes
X11Forwarding no
PrintMotd yes
SyslogFacility AUTH
LogLevel INFO
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes
PasswordAuthentication yes
PermitEmptyPasswords no
AllowUsers admin
$ man ssh (1) - OpenSSH secure shell client (remote login program)
$ man ssh [slogin] (1) - OpenSSH secure shell client (remote login program)
$ man ssh-add (1) - adds identities for the authentication agent
$ man ssh-agent (1) - authentication agent
$ man ssh-keygen (1) - authentication key generation
$ man sshd (8) - secure shell daemon
SSH1每用户配置
第一步
为本地服务器创建私有和公用密匙,执行下面的命令:
[root@deep]# su username
[username@deep]$ ssh-keygen1
举个例子,显示出来的结果可能是:
Initializing random number generator...
Generating p: ............................++ (distance 430)
Generating q: ......................++ (distance 456)
Computing the keys...
Testing the keys...
Key generation complete.
Enter file in which to save the key (/home/username/.ssh/identity): 【按下回车键】
Enter passphrase:
Enter the same passphrase again:
Your identification has been saved in /home/username/.ssh/identity.
Your public key is:
1024 37
14937757511251955533691120318477293862290049394715136511145806108870001764378494676831
29757784315853227236120610062314604405364871843677484233240919418480988907860997175244
46977589647127757030728779973708569993017043141563536333068888944038178461608592483844
590202154102756903055846534063365635584899765402181 username@deep.openarch.com
Your public key has been saved in /home/username/.ssh/identity.pub
[root@deep]# su username
[username@deep]$ ssh-keygen1 –p
Enter file key is in (/home/username/.ssh/identity): [按下回车键]
Enter old passphrase:
Key has comment username@deep.openarch.com
Enter new passphrase:
Enter the same passphrase again:
Your identification has been saved with the new passphrase.
[root@deep]# ssh username www.openarch.com
username@deep.openarch.com’s password:
Last login: Tue Oct 19 1999 18:13:00 -0400 from gate.openarch.com
Welcome to www.openarch.com on Deepforest.