I'm trying to set up Agent Forwarding on my MacBook Air running Mountain Lion.
Locally, I can run ssh -T git@github.com and I successfully connect to github.
当我尝试SSH到服务器并运行时ssh -T git@github.com,它说权限被拒绝。
这是 ~/.ssh/config
Host <my host>
ForwardAgent yes
Run Code Online (Sandbox Code Playgroud)
输出 ssh -v <my server>
debug1: Reading configuration data /Users/tombleymaier/.ssh/config
debug1: /Users/tombleymaier/.ssh/config line 1: Applying options for <host>
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to <host> [<ip>] port 22.
debug1: Connection established.
Run Code Online (Sandbox Code Playgroud)
/etc/ssh_config (第20行以上)
Host *
SendEnv LANG LC_*
# 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 22
# 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
# ProxyCommand ssh -q -W %h:%p gateway.example.com
Run Code Online (Sandbox Code Playgroud)
我在没有问题的另一台运行Mountain Lion的MacBook上进行了设置。
原来,每次重新启动时都会从本地ssh-agent中删除该标识。ssh-add使用以下-k命令运行:ssh-add -K ~/.ssh/privateKey.txt
来自:SVN + SSH,不必每次都执行ssh-add吗?(苹果系统)
| 归档时间: |
|
| 查看次数: |
6714 次 |
| 最近记录: |