Closed leira closed 2 years ago
Here is the log from a successful ssh
login:
❯ ssh -v host
OpenSSH_8.6p1, LibreSSL 2.8.3
debug1: Reading configuration data /Users/leira.hua/.ssh/config
debug1: /Users/leira.hua/.ssh/config line 1: Applying options for host
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to xxx.xxx.xxx port 22.
debug1: Connection established.
debug1: identity file /Users/leira.hua/.ssh/id_rsa type -1
debug1: identity file /Users/leira.hua/.ssh/id_rsa-cert type -1
debug1: identity file /Users/leira.hua/.ssh/id_dsa type -1
debug1: identity file /Users/leira.hua/.ssh/id_dsa-cert type -1
debug1: identity file /Users/leira.hua/.ssh/id_ecdsa type -1
debug1: identity file /Users/leira.hua/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/leira.hua/.ssh/id_ecdsa_sk type -1
debug1: identity file /Users/leira.hua/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /Users/leira.hua/.ssh/id_ed25519 type 3
debug1: identity file /Users/leira.hua/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/leira.hua/.ssh/id_ed25519_sk type -1
debug1: identity file /Users/leira.hua/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /Users/leira.hua/.ssh/id_xmss type -1
debug1: identity file /Users/leira.hua/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.6
debug1: Remote protocol version 2.0, remote software version v0.51.0
debug1: compat_banner: no match: v0.51.0
debug1: Authenticating to xxx.xxx.xxx:22 as 'leira.hua'
debug1: load_hostkeys: fopen /Users/leira.hua/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:w4v42H55/G/XlxEwK2XFICW9cP0IdCV2XXoEW5JAe3E
debug1: load_hostkeys: fopen /Users/leira.hua/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'xxx.xxx.xxx' is known and matches the ED25519 host key.
debug1: Found key in /Users/leira.hua/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/leira.hua/.ssh/id_ed25519 ED25519
SHA256:******************************************* agent
debug1: Will attempt key: /Users/leira.hua/.ssh/id_rsa
debug1: Will attempt key: /Users/leira.hua/.ssh/id_dsa
debug1: Will attempt key: /Users/leira.hua/.ssh/id_ecdsa
debug1: Will attempt key: /Users/leira.hua/.ssh/id_ecdsa_sk
debug1: Will attempt key: /Users/leira.hua/.ssh/id_ed25519_sk
debug1: Will attempt key: /Users/leira.hua/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
****************************************
Fancy Banner
****************************************
****** ****** v******
Authenticating...
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/leira.hua/.ssh/id_ed25519 ED25519
SHA256:******************************************* agent
debug1: Server accepts key: /Users/leira.hua/.ssh/id_ed25519 ED25519
SHA256:******************************************* agent
debug1: Authentication succeeded (publickey).
Authenticated to ***.***.*** ([**.**.**.**]:22).
debug1: Local connections to LOCALHOST:8765 forwarded to remote address localhost:8765
debug1: Local forwarding listening on 127.0.0.1 port 8765.
bind [127.0.0.1]:8765: Address already in use
debug1: Local forwarding listening on ::1 port 8765.
bind [::1]:8765: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 8765
Could not request local forwarding.
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: filesystem full
debug1: Requesting authentication agent forwarding.
debug1: Sending environment.
debug1: channel 0: setting env LANG = "en_US.UTF-8"
debug1: client_input_channel_open: ctype auth-agent@openssh.com rchan 1 win 2097152 max 32768
debug1: channel 1: new [authentication agent connection]
debug1: confirm auth-agent@openssh.com
debug1: channel 1: free: authentication agent connection, nchannels 2
Getting your home disk... Done! [0s]
Chatted with @wez in the Matrix channel. It seems because libssh
doesn't support "ForwardAgent".
So I'm trying another approach, to have wezterm-mux-server to create a socket file. Then use an ssh
tunnel to forward the socket file. Then let wezterm
to connect the local socket file.
I tested the scenario locally without an ssh
tunnel. I started a wezterm-mux-server using a socket file, then let wezterm connects to the same socket file, it worked. But with ssh
tunnel, it failed as "open failed: unknown channel type: unsupported channel type".
return {
unix_domains = {
{
name = "unix",
socket_path = "/home/leira.hua/.local/share/wezterm/sock"
}
},
}
wezterm-tmux-server
on server side, it prints:
2022-01-20T06:23:43.677Z INFO wezterm_mux_server_impl::local > setting up /home/leira.hua/.local/share/wezterm/sock
unix_domains = {
{
name = "host",
socket_path = "/tmp/wezterm_sock",
},
},
ssh -vnNT -L /tmp/wezterm_sock:/home/leira.hua/.local/share/wezterm/sock -o "ExitOnForwardFailure yes" host
wezterm connect host
. It failed. On the ssh tunnel side, it prints:
debug1: Connection to port -2 forwarding to /home/leira.hua/.local/share/wezterm/sock port -2 requested.
debug1: channel 3: new [direct-streamlocal@openssh.com]
channel 3: open failed: unknown channel type: unsupported channel type
debug1: channel 3: free: direct-streamlocal@openssh.com: listening port -2 for /home/leira.hua/.local/share/wezterm/sock port -2, connect from port 0 to /tmp/wezterm_sock port 0, nchannels 4
It seems the unix socket file forwarding I setup has some issue with.
I recreated the scenario with socat
, I got the same error. I think the ssh socket file forwarding was not correct.
socat - unix-listen:/tmp/socat_sock_remote
on the remote machine.ssh -v -L /tmp/socat_sock:/tmp/socat_sock_remote -o "ExitOnForwardFailure yes" cruise
.socat - unix-client:/tmp/socat_sock
. I got the same error:
debug1: Connection to port -2 forwarding to /tmp/socat_sock_remote port -2 requested.
debug1: channel 4: new [direct-streamlocal@openssh.com]
channel 4: open failed: unknown channel type: unsupported channel type
I think it is now clear that the issue is with libssh
not supporting ForwardAgent
. It is an issue with the upstream.
A solution to this is to support running wezterm across ssh without wezterm as the ssh client.
Duplicate of #1568.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
What Operating System(s) are you seeing this problem on?
macOS
WezTerm version
20220118-192644-60ea06e1
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
I successfully logged into a remote linux machine using
ssh
. But when I tried to usewezterm
to ssh, it stuck atAuthenticating...
. I'm not sure what exactly wezterm was waiting for. As there were not much information in the logs.Here is the configuration of the host in
~/.ssh/config
. I use anid_ed25519
key pair.I tried to recreate the settings into an ssh domain, and use
wezterm connect
to connect to the host, it stuck in the same step.Please provide some help to collect more information and gain more insight.
To Reproduce
Use
wezterm
to ssh into a remote machine, with command:Or configure the ssh domain, and use:
Configuration
Expected Behavior
Expect wezterm to successfully ssh into remote host.
Logs
Anything else?
No response