Skip to content

Instantly share code, notes, and snippets.

@zachriggle
Created October 11, 2022 10:04
Show Gist options
  • Save zachriggle/5cf92282c503d07cd5f6927bdbcd3474 to your computer and use it in GitHub Desktop.
Save zachriggle/5cf92282c503d07cd5f6927bdbcd3474 to your computer and use it in GitHub Desktop.
$ cat ~/.ssh/config
HashKnownHosts yes
SendEnv TMUX
Protocol 2
VisualHostKey yes
Host *
ControlMaster auto
ControlPath /Users/zachriggle/.ssh/sockets/%r@%h-%p
ControlPersist 15m
ServerAliveInterval 25
ServerAliveCountMax 1
TCPKeepAlive no
ConnectTimeout 3
Host github.com
IdentityFile /Users/zachriggle/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ac34602783c9cb010833093a53e9d5cf.pub
IdentityAgent /Users/zachriggle/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
$ ssh -vvvvvvv git@github.com
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/zachriggle/.ssh/config
debug1: /Users/zachriggle/.ssh/config line 6: Applying options for *
debug1: /Users/zachriggle/.ssh/config line 15: Applying options for github.com
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 *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/zachriggle/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/zachriggle/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: auto-mux: Trying existing master
debug1: Control socket "/Users/zachriggle/.ssh/sockets/git@github.com-22" does not exist
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [140.82.113.3] port 22.
debug3: set_sock_tos: set socket 5 IP_TOS 0x48
debug2: fd 5 setting O_NONBLOCK
debug1: fd 5 clearing O_NONBLOCK
debug1: Connection established.
debug3: timeout: 2945 ms remain after connect
debug1: identity file /Users/zachriggle/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ac34602783c9cb010833093a53e9d5cf.pub type 2
debug1: identity file /Users/zachriggle/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ac34602783c9cb010833093a53e9d5cf.pub-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.0
debug1: Remote protocol version 2.0, remote software version babeld-3f0fc83a
debug1: compat_banner: no match: babeld-3f0fc83a
debug2: fd 5 setting O_NONBLOCK
debug1: Authenticating to github.com:22 as 'git'
debug3: record_hostkey: found key type ED25519 in file /Users/zachriggle/.ssh/known_hosts:5
debug3: record_hostkey: found key type RSA in file /Users/zachriggle/.ssh/known_hosts:6
debug3: record_hostkey: found key type ECDSA in file /Users/zachriggle/.ssh/known_hosts:7
debug3: load_hostkeys_file: loaded 3 keys from github.com
debug1: load_hostkeys: fopen /Users/zachriggle/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug3: order_hostkeyalgs: have matching best-preference key type ssh-ed25519-cert-v01@openssh.com, using HostkeyAlgorithms verbatim
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256
debug2: host key algorithms: ssh-ed25519,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: MACs ctos: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256
debug2: MACs stoc: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
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
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
debug3: record_hostkey: found key type ED25519 in file /Users/zachriggle/.ssh/known_hosts:5
debug3: record_hostkey: found key type RSA in file /Users/zachriggle/.ssh/known_hosts:6
debug3: record_hostkey: found key type ECDSA in file /Users/zachriggle/.ssh/known_hosts:7
debug3: load_hostkeys_file: loaded 3 keys from github.com
debug1: load_hostkeys: fopen /Users/zachriggle/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'github.com' is known and matches the ED25519 host key.
debug1: Found key in /Users/zachriggle/.ssh/known_hosts:5
Host key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
+--[ED25519 256]--+
| |
| . |
| o |
| o o o . |
| .B S oo |
| =+^ =... |
| oo#o@.o. |
| E+.&.=o |
| ooo.X=. |
+----[SHA256]-----+
debug3: send packet: type 21
debug2: ssh_set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: ssh_set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug2: get_agent_identities: ssh_agent_bind_hostkey: agent refused operation
debug1: get_agent_identities: agent returned 5 keys
debug1: Will attempt key: /Users/zachriggle/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ac34602783c9cb010833093a53e9d5cf.pub ECDSA SHA256:s3+cKHe7fmcW2OnVZogIasq+V9kciqPmVGY3lql8lts explicit agent
debug1: Will attempt key: ecdsa-sha2-nistp256 ECDSA SHA256:pPYQmromJNkmSPgc3vw/QMmAazvf+ECpjEWEgvaweuQ agent
debug1: Will attempt key: ecdsa-sha2-nistp256 ECDSA SHA256:aMd8KIjoeYZ4eCM4ATZBXK57Q3V2IeQTdh5I6R9uwyc agent
debug1: Will attempt key: ecdsa-sha2-nistp256 ECDSA SHA256:MrQAJoPl+x7DNA2yB9cnpKuXK9sEppY/CpbzJO2f/y4 agent
debug1: Will attempt key: ecdsa-sha2-nistp256 ECDSA SHA256:TFIluEsVSgIbW9OISjjA8e+vy3ou/spLhtbGtjpL0+0 agent
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/zachriggle/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ac34602783c9cb010833093a53e9d5cf.pub ECDSA SHA256:s3+cKHe7fmcW2OnVZogIasq+V9kciqPmVGY3lql8lts explicit agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /Users/zachriggle/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ac34602783c9cb010833093a53e9d5cf.pub ECDSA SHA256:s3+cKHe7fmcW2OnVZogIasq+V9kciqPmVGY3lql8lts explicit agent
debug3: sign_and_send_pubkey: using publickey with ECDSA SHA256:s3+cKHe7fmcW2OnVZogIasq+V9kciqPmVGY3lql8lts
debug3: sign_and_send_pubkey: signing using ecdsa-sha2-nistp256 SHA256:s3+cKHe7fmcW2OnVZogIasq+V9kciqPmVGY3lql8lts
debug3: send packet: type 50
debug3: receive packet: type 52
Authenticated to github.com ([140.82.113.3]:22) using "publickey".
debug1: setting up multiplex master socket
debug3: muxserver_listen: temporary control path /Users/zachriggle/.ssh/sockets/git@github.com-22.o1dzLZqjYcpqZvuc
debug2: fd 6 setting O_NONBLOCK
debug3: fd 6 is O_NONBLOCK
debug3: fd 6 is O_NONBLOCK
debug1: channel 0: new [/Users/zachriggle/.ssh/sockets/git@github.com-22]
debug3: muxserver_listen: mux listener channel 0 fd 6
debug2: fd 5 setting TCP_NODELAY
debug3: set_sock_tos: set socket 5 IP_TOS 0x20
debug1: control_persist_detach: backgrounding master process
debug2: control_persist_detach: background process is 53539
debug2: fd 6 setting O_NONBLOCK
debug1: forking to background
debug1: Entering interactive session.
debug1: pledge: id
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: client_input_hostkeys: received RSA key SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug3: client_input_hostkeys: received ECDSA key SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM
debug3: client_input_hostkeys: received ED25519 key SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
debug1: client_input_hostkeys: searching /Users/zachriggle/.ssh/known_hosts for github.com / (none)
debug3: hostkeys_foreach: reading file "/Users/zachriggle/.ssh/known_hosts"
debug3: hostkeys_find: found ssh-ed25519 key at /Users/zachriggle/.ssh/known_hosts:5
debug3: hostkeys_find: found ssh-rsa key at /Users/zachriggle/.ssh/known_hosts:6
debug3: hostkeys_find: found ecdsa-sha2-nistp256 key at /Users/zachriggle/.ssh/known_hosts:7
debug1: client_input_hostkeys: searching /Users/zachriggle/.ssh/known_hosts2 for github.com / (none)
debug1: client_input_hostkeys: hostkeys file /Users/zachriggle/.ssh/known_hosts2 does not exist
debug3: client_input_hostkeys: 3 server keys: 0 new, 3 retained, 0 incomplete match. 0 to remove
debug1: client_input_hostkeys: no new or deprecated keys from server
debug2: set_control_persist_exit_time: schedule exit in 900 seconds
debug1: multiplexing control connection
debug3: fd 3 is O_NONBLOCK
debug3: fd 3 is O_NONBLOCK
debug1: channel 1: new [mux-control]
debug3: channel_post_mux_listener: new mux channel 1 fd 3
debug3: mux_master_read_cb: channel 1: hello sent
debug2: set_control_persist_exit_time: cancel scheduled exit
debug3: mux_master_read_cb: channel 1 packet type 0x00000001 len 4
debug2: mux_master_process_hello: channel 1 client version 4
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_master_read_cb: channel 1 packet type 0x10000004 len 4
debug2: mux_master_process_alive_check: channel 1: alive check
debug3: mux_client_request_alive: done pid = 53541
debug3: mux_client_request_session: session request sent
debug3: mux_master_read_cb: channel 1 packet type 0x10000002 len 148
debug2: mux_master_process_new_session: channel 1: request tty 1, X 0, agent 0, subsys 0, term "xterm-256color", cmd "", env 4
debug3: mux_master_process_new_session: got fds stdin 7, stdout 8, stderr 9
debug1: channel 2: new [client-session]
debug2: mux_master_process_new_session: channel_new: 2 linked to control channel 1
debug2: channel 2: send open
debug3: send packet: type 90
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 2: callback start
debug2: client_session2_setup: id 2
debug2: channel 2: request pty-req confirm 1
debug3: send packet: type 98
debug1: Sending environment.
debug1: channel 2: setting env LC_TERMINAL_VERSION = "3.5.0beta7"
debug2: channel 2: request env confirm 0
debug3: send packet: type 98
debug1: channel 2: setting env LANG = "en_US.UTF-8"
debug2: channel 2: request env confirm 0
debug3: send packet: type 98
debug1: channel 2: setting env LC_TERMINAL = "iTerm2"
debug2: channel 2: request env confirm 0
debug3: send packet: type 98
debug1: channel 2: setting env LC_ALL = "en_US.UTF-8"
debug2: channel 2: request env confirm 0
debug3: send packet: type 98
debug2: channel 2: request shell confirm 1
debug3: send packet: type 98
debug3: mux_session_confirm: sending success reply
debug2: channel_input_open_confirmation: channel 2: callback done
debug2: channel 2: open confirm rwindow 32000 rmax 35000
debug1: mux_client_request_session: master session id: 2
debug3: receive packet: type 100
debug2: channel_input_status_confirm: type 100 id 2
debug3: client_status_confirm: channel 2: mux request: PTY allocation
debug3: mux_tty_alloc_failed: channel 2: TTY alloc failed
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 2
debug2: shell request accepted on channel 2
debug2: channel 2: rcvd ext data 92
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 2 rtype exit-status reply 0
debug3: mux_exit_message: channel 2: exit message, exitval 1
debug3: receive packet: type 96
debug2: channel 2: rcvd eof
debug2: channel 2: output open -> drain
debug3: receive packet: type 97
debug2: channel 2: rcvd close
debug2: chan_shutdown_read: channel 2: (i0 o1 sock -1 wfd 7 efd 9 [write])
debug2: channel 2: input open -> closed
debug3: channel 2: will not send data after close
debug2: channel 2: obuf_empty delayed efd 9/(123)
PTY allocation request failed
Hi zachriggle! You've successfully authenticated, but GitHub does not provide shell access.
debug2: channel 2: written 123 to efd 9
debug3: channel 2: will not send data after close
debug2: channel 2: obuf empty
debug2: chan_shutdown_write: channel 2: (i3 o1 sock -1 wfd 8 efd 9 [write])
debug2: channel 2: output drain -> closed
debug2: channel 2: send close
debug3: send packet: type 97
debug2: channel 2: is dead
debug2: channel 2: gc: notify user
debug3: mux_master_session_cleanup_cb: entering for channel 2
debug2: channel 1: rcvd close
debug2: channel 1: output open -> drain
debug2: chan_shutdown_read: channel 1: (i0 o1 sock 3 wfd 3 efd -1 [closed])
debug2: channel 1: input open -> closed
debug2: channel 2: gc: user detached
debug2: channel 2: is dead
debug2: channel 2: garbage collecting
debug1: channel 2: free: client-session, nchannels 3
debug3: channel 2: status: The following connections are open:
#1 mux-control (t16 nr0 i3/0 o1/0 e[closed]/0 fd 3/3/-1 sock 3 cc -1 io 0x01/0x02)
#2 client-session (t4 r43 i3/0 o3/0 e[write]/0 fd -1/-1/9 sock -1 cc -1 io 0x00/0x08)
debug2: channel 1: obuf empty
debug2: chan_shutdown_write: channel 1: (i3 o1 sock 3 wfd 3 efd -1 [closed])
debug2: channel 1: output drain -> closed
debug2: channel 1: is dead (local)
debug2: channel 1: gc: notify user
debug3: mux_master_control_cleanup_cb: entering for channel 1
debug2: channel 1: gc: user detached
debug2: channel 1: is dead (local)
debug2: channel 1: garbage collecting
debug1: channel 1: free: mux-control, nchannels 2
debug3: channel 1: status: The following connections are open:
#1 mux-control (t16 nr0 i3/0 o3/0 e[closed]/0 fd 3/3/-1 sock 3 cc -1 io 0x00/0x01)
debug2: set_control_persist_exit_time: schedule exit in 900 seconds
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 1
Shared connection to github.com closed.
debug3: send packet: type 1
debug1: channel 0: free: /Users/zachriggle/.ssh/sockets/git@github.com-22, nchannels 1
debug3: channel 0: status: The following connections are open:
Transferred: sent 2636, received 2428 bytes, in 0.1 seconds
Bytes per second: sent 23040.3, received 21222.3
debug1: Exit status 0
$ ls -la ~/.ssh/sockets
total 0
drwxr-xr-x 2 zachriggle staff 64 2022-10-11 05:03 ./
drwx------ 12 zachriggle staff 384 2022-10-11 04:58 ../
@zachriggle
Copy link
Author

And if this is easier to digest:

$ ssh -o ControlMaster=yes -o ControlPath=$PWD/socket -o ControlPersist=yes -T git@github.com
Host key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
+--[ED25519 256]--+
|                 |
|     .           |
|      o          |
|     o o o  .    |
|     .B S oo     |
|     =+^ =...    |
|    oo#o@.o.     |
|    E+.&.=o      |
|    ooo.X=.      |
+----[SHA256]-----+
Hi zachriggle! You've successfully authenticated, but GitHub does not provide shell access.

$ ls -la socket
gls: cannot access 'socket': No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment