Authentication SSH-在公钥身份验证期间要求输入密码短语

Authentication SSH-在公钥身份验证期间要求输入密码短语,authentication,ubuntu,ssh,public-key-encryption,Authentication,Ubuntu,Ssh,Public Key Encryption,我已经读了一些关于公钥认证的内容,但我认为我缺少了一个关键方面 我有一个Ubuntu服务器,配置为Subversion服务器,通过SSH使用非标准端口接受SVN连接。所以,要检查,它应该是这样的: svn co svn+ssh://user@example.com:12345/repos/public 现在,我的服务器当前支持基于密码的身份验证和公钥身份验证。假设我办公室的服务器已经被栓住并锚定,防火墙和所有设备都在工作,我就不必担心有人从服务器上复制文件 对于我的两台客户端笔记本电脑,我已经

我已经读了一些关于公钥认证的内容,但我认为我缺少了一个关键方面

我有一个Ubuntu服务器,配置为Subversion服务器,通过SSH使用非标准端口接受SVN连接。所以,要检查,它应该是这样的:

svn co svn+ssh://user@example.com:12345/repos/public
现在,我的服务器当前支持基于密码的身份验证和公钥身份验证。假设我办公室的服务器已经被栓住并锚定,防火墙和所有设备都在工作,我就不必担心有人从服务器上复制文件

对于我的两台客户端笔记本电脑,我已经生成了公钥-私钥对,并通过
ssh copy id
命令将客户端的公钥添加到服务器上的AuthorizedKeys列表中。我现在可以从这些客户端笔记本电脑SSH到服务器,而无需密码

但这与我有关。如果有人闯入我的酒店房间偷走了我的笔记本电脑,那么他们只需拉动硬盘,将
~/.ssh
的内容复制到另一台机器上,然后毫不费力地尝试登录到我的服务器。如果我只使用基于密码的身份验证,只需记住密码或将其存储在加密的TrueCrypt存档中,则会安全得多

我知道在客户端创建密钥对的过程中,必须输入密码短语。是否可以要求服务器不仅验证公钥,还需要输入密码短语?如果只需要窃取一名员工的笔记本电脑并从中复制一个文件以获得整个系统访问权限,那么这似乎是一个非常脆弱的系统


谢谢。

您可以使用附加的密码短语保护客户端上的密钥库,因此需要解锁密钥才能使用它,但这是在客户端上配置的,服务器无法强制执行。使用密码时,您只需解锁一次密钥,并在客户端使用期间使用它。

另一个SO网站对此进行了介绍

下面是示例SSHD服务器脚本

#######################################################
###  Calomel.org  SERVER  /etc/ssh/sshd_config
#######################################################
#
Port 22
Protocol 2
AddressFamily inet
#ListenAddress 127.0.0.1

#See the questions section for setting up the gatekeeper
#ForceCommand /tools/ssh_gatekeeper.sh 

AllowUsers calomel@10.10.10.3 calomel@192.168.*
AllowGroups calomel

AllowTcpForwarding yes
#AuthorizedKeysFile .ssh/authorized_keys (need to be be commented for OpenSSH 5.4)
Banner /etc/banner
ChallengeResponseAuthentication no
Ciphers aes256-ctr,aes192-ctr,aes128-ctr
ClientAliveInterval 15
ClientAliveCountMax 3
Compression yes
GatewayPorts no
LogLevel VERBOSE
LoginGraceTime 50s
MACs hmac-sha2-512-96,hmac-sha2-512,hmac-sha2-256-96,hmac-sha2-256,hmac-sha1-96,hmac-sha1
MaxAuthTries 6
MaxStartups 10
PasswordAuthentication yes
PermitEmptyPasswords no
#PermitOpen localhost:80
PermitRootLogin no
PermitUserEnvironment no
PidFile /var/run/sshd.pid
PrintLastLog yes
PrintMotd no
PubkeyAuthentication yes
StrictModes yes
Subsystem sftp /usr/libexec/sftp-server
SyslogFacility AUTH
TCPKeepAlive no
UseDNS no
UseLogin no
UsePrivilegeSeparation yes
X11DisplayOffset 10
X11Forwarding no
X11UseLocalhost yes

#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       ForceCommand cvs server
#
#######################################################
###  Calomel.org  SERVER  /etc/ssh/sshd_config
#######################################################