gpt4 book ai didi

SSH 代理转发

转载 作者:行者123 更新时间:2023-12-04 19:41:41 24 4
gpt4 key购买 nike

我正在尝试在运行 Mountain Lion 的 MacBook Air 上设置代理转发。

在本地,我可以运行 ssh -T git@github.com我成功连接到 github。

当我尝试通过 ssh 连接到我的服务器并运行 ssh -T git@github.com 时,它说权限被拒绝。

这是 ~/.ssh/config

Host <my host>
ForwardAgent yes

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.

/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

我在另一台运行 Mountain Lion 的 MacBook 上进行了设置,没有出现任何问题。

最佳答案

事实证明,每次重新启动时,身份都会从本地 ssh-agent 中删除。必须使用 -k 命令运行 ssh-add:ssh-add -K ~/.ssh/privateKey.txt

发件人:SVN+SSH, not having to do ssh-add every time? (Mac OS)

关于SSH 代理转发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12118152/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com