为项目在本地机器上设置 SSH 访问。
当我ssh -v localhost
的连接被拒绝时。以下是堆栈跟踪。
OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /Users/Kyle.Welsby/.ssh/config
debug1: Applying options for localhost
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /Users/Kyle.Welsby/.ssh/identity type -1
debug1: identity file /Users/Kyle.Welsby/.ssh/id_rsa type 1
debug1: identity file /Users/Kyle.Welsby/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
我的 ssh 配置是标准的 Mac OS X 设置。进行了以下更改。
# /etc/sshd_config
PermitUserEnvironment yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
# ~/.ssh/config
Host localhost
User Kyle.Welsby
答案1
问题是PermitUserEnvironment yes
我将其注释掉并且一切工作正常。