MacからWindowsにSSH接続するための設定をやっていく

2023年10月15日

こちらを参考に設定していきますが、Windows11 22H2以降だと色々ハマります。

https://qiita.com/akki-memo/items/607af5c4b40fcd8ff47c

原因は、windowsのバージョンにあったようです。

Windows11 22H2以降だと発生するようです。
サーバー側(windows)とクライアント(Mac)を分けて記述してくれてるので非常にわかりやすかったです。

概要

参考のサイトから以下の部分を変更することでうまくssh接続できるようになると思います。

  • WSLのバージョンを2.0.0以降に変更する
  • ssh接続したときにwslにログインする設定を変更する。

問題が起こった時は、ログをじっくり見るのが大切ですが、どこにどのログがあるのかがよくわからなかったので難易度が高かった気がします。

クライアント(Mac)で見るべきログは、ssh接続時のオプションで出力されるログです。
sshの-vオプションでデバッグに役立つ情報が出てくるようになります。

サーバー(Windows)で見るべきログは、sshd_configの設定を変更して出力させるログになります。うまくいかなくて模索した記録にログも載せました。
イベントビューアも見るべきっていう情報をみたのですが、OpenSSHのログは詳細なログまでは出てなかったです。

wslの確認

既にインストールされていたので、今のユーザを確認する。

DESKTOP-RB12Q18# whoami
root

パスワードはなんだ・・・?

忘れたので再設定することにしました。
こちらを参考にしました。

wslのバージョンをWSL 2.0.0以降に変更する

上記で色々していましたが、こちらの設定が必要でした。

https://superuser.com/questions/1714736/cannot-run-wsl2-over-ssh-on-windows-11/1714740#1714740

そして再起動する。

OpenSSH

オプション機能とかで検索します。

オプション機能を追加するよりOpenSSH サーバーと検索する。

インストールされたようだ。

OpenSSHの設定

ssh接続したときにwslにログインするようにする。

ここが参考もとの設定と違うところになります。
sshで繋がったらデフォルトシェルをwsl.exeとします。

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "c:\Program Files\WSL\wsl.exe" -PropertyType String -Force

元々の設定は以下でしたが、これだと私のところではうまくいきませんでした。
bash.exeがSystem32配下にあるのが問題なんだろうか・・?
ここについてはよくわからないというのが正直なところです。
クライアントログ(後述)にも
ファイルにアクセスできません。
というのが出ていたので権限周りな気がします。

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\bash.exe" -PropertyType String -Force

firewallをで22portを開ける。

netsh advfirewall firewall add rule name="sshd" dir=in action=allow protocol=TCP localport=22

OpenSSHをスタートアップのサービスにする。

Set-Service sshd -StartupType Automatic

再起動して起動確認。
全然Powershellのコマンド覚えれない。。

Get-Service sshd

sshd_configの編集

code C:\ProgramData\ssh\sshd_config

sshキーで下記設定は変更しないでいい?

PasswordAuthentication no
下記は設定する必要があるようだ。

これがあると、Administratorsグループ所属の場合は、.sshの下のauthorized_keysを読んでくれない。

https://memo-nikki.info/?p=724

最終的にsshd_configはこうなりました。
とりあえずログは出しっぱにしてますが、適宜変更すればいいかと思います。

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
SyslogFacility LOCAL0
LogLevel DEBUG3

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile	.ssh/authorized_keys

#AuthorizedPrincipalsFile none

# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PermitEmptyPasswords yes

# GSSAPI options
#GSSAPIAuthentication no

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem	sftp	sftp-server.exe

# Example of overriding settings on a per-user basis
#Match User anoncvs
#	AllowTcpForwarding no
#	PermitTTY no
#	ForceCommand cvs server

# Match Group administrators
#        AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

sshの鍵作成

sshについて最近書いた記事があった。

ssh-keygen -t rsa -b 4096 -o -a 100 -f ~/.ssh/mywhite

パスフレーズなしで作りました。

Macでエイリアスを定義しておく

zshでサクッと使えるようにしたいので以下の設定を追加しました。
~/.zshrc
末尾に以下を追加

# sshで自分のwindowsに接続する
alias ssh-mywhite='ssh -i ~/.ssh/mywhite xiaot@192.168.1.76'

zshを再起動

source ~/.zshrc

ターミナルで
ssh-mywhite

これでssh接続できるようになりました。

うまくいかなくて模索した記録

うまくいかない。

とにかくログを出す。

サーバ側のsshd_configを変更する

もともとはコメントアウトされた状態

# Logging
#SyslogFacility AUTH
#LogLevel INFO

これを以下のように変更する。

# Logging
SyslogFacility LOCAL0
LogLevel DEBUG3

この設定にしてsshを再起動する。

restart-service -name sshd -force

以下のディレクトリにログが出力されるようになりました。

C:\ProgramData\ssh\logs

ログの内容はこちら
5264 2023-10-15 10:09:57.897 debug2: fd 3 setting O_NONBLOCK
5264 2023-10-15 10:09:57.897 debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY
5264 2023-10-15 10:09:57.897 debug1: Bind to port 22 on ::.
5264 2023-10-15 10:09:57.897 Server listening on :: port 22.
5264 2023-10-15 10:09:57.897 debug2: fd 4 setting O_NONBLOCK
5264 2023-10-15 10:09:57.897 debug1: Bind to port 22 on 0.0.0.0.
5264 2023-10-15 10:09:57.898 Server listening on 0.0.0.0 port 22.
5264 2023-10-15 10:14:48.015 debug3: fd 5 is not O_NONBLOCK
5264 2023-10-15 10:14:48.021 debug3: spawning "C:\\WINDOWS\\System32\\OpenSSH\\sshd.exe" -R as subprocess
5264 2023-10-15 10:14:48.025 debug3: send_rexec_state: entering fd = 8 config len 219
5264 2023-10-15 10:14:48.025 debug3: ssh_msg_send: type 0
5264 2023-10-15 10:14:48.026 debug3: send_rexec_state: done
28204 2023-10-15 10:14:48.054 debug1: inetd sockets after dupping: 4, 4
28204 2023-10-15 10:14:48.054 Connection from 192.168.1.60 port 49411 on 192.168.1.76 port 22
28204 2023-10-15 10:14:48.054 debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.6
28204 2023-10-15 10:14:48.054 debug1: Remote protocol version 2.0, remote software version OpenSSH_9.3
28204 2023-10-15 10:14:48.054 debug1: compat_banner: match: OpenSSH_9.3 pat OpenSSH* compat 0x04000000
28204 2023-10-15 10:14:48.054 debug2: fd 4 setting O_NONBLOCK
28204 2023-10-15 10:14:48.054 debug3: spawning "C:\\WINDOWS\\System32\\OpenSSH\\sshd.exe" -y as user
28204 2023-10-15 10:14:48.070 debug2: Network child is on pid 27596
28204 2023-10-15 10:14:48.070 debug3: send_rexec_state: entering fd = 6 config len 219
28204 2023-10-15 10:14:48.070 debug3: ssh_msg_send: type 0
28204 2023-10-15 10:14:48.070 debug3: send_rexec_state: done
28204 2023-10-15 10:14:48.070 debug3: ssh_msg_send: type 0
28204 2023-10-15 10:14:48.070 debug3: ssh_msg_send: type 0
28204 2023-10-15 10:14:48.070 debug3: preauth child monitor started
28204 2023-10-15 10:14:48.097 debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
28204 2023-10-15 10:14:48.097 debug3: send packet: type 20 [preauth]
28204 2023-10-15 10:14:48.097 debug1: SSH2_MSG_KEXINIT sent [preauth]
28204 2023-10-15 10:14:48.097 debug3: receive packet: type 20 [preauth]
28204 2023-10-15 10:14:48.098 debug1: SSH2_MSG_KEXINIT received [preauth]
28204 2023-10-15 10:14:48.098 debug2: local server KEXINIT proposal [preauth]
28204 2023-10-15 10:14:48.098 debug2: KEX algorithms: 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 [preauth]
28204 2023-10-15 10:14:48.098 debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
28204 2023-10-15 10:14:48.098 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
28204 2023-10-15 10:14:48.098 debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
28204 2023-10-15 10:14:48.098 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 [preauth]
28204 2023-10-15 10:14:48.098 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 [preauth]
28204 2023-10-15 10:14:48.098 debug2: compression ctos: none,zlib@openssh.com [preauth]
28204 2023-10-15 10:14:48.098 debug2: compression stoc: none,zlib@openssh.com [preauth]
28204 2023-10-15 10:14:48.098 debug2: languages ctos:  [preauth]
28204 2023-10-15 10:14:48.098 debug2: languages stoc:  [preauth]
28204 2023-10-15 10:14:48.098 debug2: first_kex_follows 0  [preauth]
28204 2023-10-15 10:14:48.098 debug2: reserved 0  [preauth]
28204 2023-10-15 10:14:48.098 debug2: peer client KEXINIT proposal [preauth]
28204 2023-10-15 10:14:48.098 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 [preauth]
28204 2023-10-15 10:14:48.098 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,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-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256 [preauth]
28204 2023-10-15 10:14:48.098 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
28204 2023-10-15 10:14:48.098 debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
28204 2023-10-15 10:14:48.098 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 [preauth]
28204 2023-10-15 10:14:48.098 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 [preauth]
28204 2023-10-15 10:14:48.098 debug2: compression ctos: none,zlib@openssh.com,zlib [preauth]
28204 2023-10-15 10:14:48.098 debug2: compression stoc: none,zlib@openssh.com,zlib [preauth]
28204 2023-10-15 10:14:48.098 debug2: languages ctos:  [preauth]
28204 2023-10-15 10:14:48.098 debug2: languages stoc:  [preauth]
28204 2023-10-15 10:14:48.098 debug2: first_kex_follows 0  [preauth]
28204 2023-10-15 10:14:48.098 debug2: reserved 0  [preauth]
28204 2023-10-15 10:14:48.098 debug1: kex: algorithm: curve25519-sha256 [preauth]
28204 2023-10-15 10:14:48.098 debug1: kex: host key algorithm: ssh-ed25519 [preauth]
28204 2023-10-15 10:14:48.098 debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
28204 2023-10-15 10:14:48.098 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
28204 2023-10-15 10:14:48.098 debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
28204 2023-10-15 10:14:48.118 debug3: receive packet: type 30 [preauth]
28204 2023-10-15 10:14:48.118 debug1: SSH2_MSG_KEX_ECDH_INIT received [preauth]
28204 2023-10-15 10:14:48.121 debug3: mm_sshkey_sign: entering [preauth]
28204 2023-10-15 10:14:48.121 debug3: mm_request_send: entering, type 6 [preauth]
28204 2023-10-15 10:14:48.121 debug3: mm_sshkey_sign: waiting for MONITOR_ANS_SIGN [preauth]
28204 2023-10-15 10:14:48.121 debug3: mm_request_receive_expect: entering, type 7 [preauth]
28204 2023-10-15 10:14:48.121 debug3: mm_request_receive: entering [preauth]
28204 2023-10-15 10:14:48.121 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.121 debug3: monitor_read: checking request 6
28204 2023-10-15 10:14:48.121 debug3: mm_answer_sign: entering
28204 2023-10-15 10:14:48.122 debug3: mm_answer_sign: KEX signature 000001BC3E506F30(83)
28204 2023-10-15 10:14:48.122 debug3: mm_request_send: entering, type 7
28204 2023-10-15 10:14:48.122 debug2: monitor_read: 6 used once, disabling now
28204 2023-10-15 10:14:48.122 debug3: send packet: type 31 [preauth]
28204 2023-10-15 10:14:48.122 debug3: send packet: type 21 [preauth]
28204 2023-10-15 10:14:48.123 debug2: set_newkeys: mode 1 [preauth]
28204 2023-10-15 10:14:48.123 debug1: rekey out after 134217728 blocks [preauth]
28204 2023-10-15 10:14:48.123 debug1: SSH2_MSG_NEWKEYS sent [preauth]
28204 2023-10-15 10:14:48.123 debug1: Sending SSH2_MSG_EXT_INFO [preauth]
28204 2023-10-15 10:14:48.123 debug3: send packet: type 7 [preauth]
28204 2023-10-15 10:14:48.123 debug1: expecting SSH2_MSG_NEWKEYS [preauth]
28204 2023-10-15 10:14:48.139 debug3: receive packet: type 21 [preauth]
28204 2023-10-15 10:14:48.139 debug1: SSH2_MSG_NEWKEYS received [preauth]
28204 2023-10-15 10:14:48.139 debug2: set_newkeys: mode 0 [preauth]
28204 2023-10-15 10:14:48.139 debug1: rekey in after 134217728 blocks [preauth]
28204 2023-10-15 10:14:48.139 debug1: KEX done [preauth]
28204 2023-10-15 10:14:48.206 debug3: receive packet: type 5 [preauth]
28204 2023-10-15 10:14:48.206 debug3: send packet: type 6 [preauth]
28204 2023-10-15 10:14:48.214 debug3: receive packet: type 50 [preauth]
28204 2023-10-15 10:14:48.214 debug1: userauth-request for user xiaot service ssh-connection method none [preauth]
28204 2023-10-15 10:14:48.214 debug1: attempt 0 failures 0 [preauth]
28204 2023-10-15 10:14:48.214 debug3: mm_getpwnamallow: entering [preauth]
28204 2023-10-15 10:14:48.214 debug3: mm_request_send: entering, type 8 [preauth]
28204 2023-10-15 10:14:48.214 debug3: mm_getpwnamallow: waiting for MONITOR_ANS_PWNAM [preauth]
28204 2023-10-15 10:14:48.214 debug3: mm_request_receive_expect: entering, type 9 [preauth]
28204 2023-10-15 10:14:48.214 debug3: mm_request_receive: entering [preauth]
28204 2023-10-15 10:14:48.215 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.215 debug3: monitor_read: checking request 8
28204 2023-10-15 10:14:48.215 debug3: mm_answer_pwnamallow: entering
28204 2023-10-15 10:14:48.217 debug2: parse_server_config_depth: config reprocess config len 219
28204 2023-10-15 10:14:48.220 debug3: mm_answer_pwnamallow: sending MONITOR_ANS_PWNAM: 1
28204 2023-10-15 10:14:48.221 debug3: mm_request_send: entering, type 9
28204 2023-10-15 10:14:48.221 debug2: monitor_read: 8 used once, disabling now
28204 2023-10-15 10:14:48.223 debug2: input_userauth_request: setting up authctxt for xiaot [preauth]
28204 2023-10-15 10:14:48.223 debug3: mm_inform_authserv: entering [preauth]
28204 2023-10-15 10:14:48.223 debug3: mm_request_send: entering, type 4 [preauth]
28204 2023-10-15 10:14:48.223 debug2: input_userauth_request: try method none [preauth]
28204 2023-10-15 10:14:48.223 debug3: mm_auth_password: entering [preauth]
28204 2023-10-15 10:14:48.223 debug3: mm_request_send: entering, type 12 [preauth]
28204 2023-10-15 10:14:48.223 debug3: mm_auth_password: waiting for MONITOR_ANS_AUTHPASSWORD [preauth]
28204 2023-10-15 10:14:48.224 debug3: mm_request_receive_expect: entering, type 13 [preauth]
28204 2023-10-15 10:14:48.224 debug3: mm_request_receive: entering [preauth]
28204 2023-10-15 10:14:48.224 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.224 debug3: monitor_read: checking request 4
28204 2023-10-15 10:14:48.224 debug3: mm_answer_authserv: service=ssh-connection, style=
28204 2023-10-15 10:14:48.224 debug2: monitor_read: 4 used once, disabling now
28204 2023-10-15 10:14:48.224 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.224 debug3: monitor_read: checking request 12
28204 2023-10-15 10:14:48.229 debug1: Windows authentication failed for user: xiaot domain: . error: 1326
28204 2023-10-15 10:14:48.229 debug3: mm_answer_authpassword: sending result 0
28204 2023-10-15 10:14:48.229 debug3: mm_answer_authpassword: sending result 0
28204 2023-10-15 10:14:48.229 debug3: mm_request_send: entering, type 13
28204 2023-10-15 10:14:48.230 Failed none for xiaot from 192.168.1.60 port 49411 ssh2
28204 2023-10-15 10:14:48.230 debug3: mm_auth_password: user not authenticated [preauth]
28204 2023-10-15 10:14:48.230 debug3: user_specific_delay: user specific delay 0.000ms [preauth]
28204 2023-10-15 10:14:48.230 debug3: ensure_minimum_time_since: elapsed 16.605ms, delaying 7.150ms (requested 5.939ms) [preauth]
28204 2023-10-15 10:14:48.254 debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
28204 2023-10-15 10:14:48.254 debug3: send packet: type 51 [preauth]
28204 2023-10-15 10:14:48.254 debug3: receive packet: type 50 [preauth]
28204 2023-10-15 10:14:48.254 debug1: userauth-request for user xiaot service ssh-connection method publickey [preauth]
28204 2023-10-15 10:14:48.254 debug1: attempt 1 failures 0 [preauth]
28204 2023-10-15 10:14:48.254 debug2: input_userauth_request: try method publickey [preauth]
28204 2023-10-15 10:14:48.254 debug2: userauth_pubkey: valid user xiaot querying public key rsa-sha2-512 AAAAB3NzaC1yc2EAAAADAQABAAACAQC32FQLfqyZ+ERUK4MWaO2BjwQDjk34CpvVHVCjJmDLaTTnUJ9FpeBysHhprn0HTduOhcgNxUG8+wsclZFTciM9MRHBbVi4km9o41ai4VzKkgGWjR+eKgNJJreOUZTkSqzkkCctKzC9UvC8xXMiDGNPVISgbECKPyva8M9GHaGymFB1plXnMWmfHtq3o3jMDGh2r3n+UMmCDIm/BDmgMP9sBGh/XumAbhoQcPpuEYUPvmIkoZClRcAAhEl8Usmnd9r6NVlnUjnAEAL+uj6rOVnvRxyKCbZFGFfDFDUiI+E5QHhUsX1Br60FUYQ5kJ0nK/Ficm5aUvunTABa2A2Kp7mibpEmKEWotpR2KN17AAcJNv/mB91U9W1xqVdHc54yMj/WhXvq/9XC7OHx/EFZ1oK5PB6dryE/julN1BgFIii8TfCEIJQeGplrydWNZbwMHAsRbdoIWDn6E5etMdCOwwWUzfaPxqxHhAUrQhqiGZd4oAeR8xaUf2InC8q/EHtOKXMcNcEbgSpZAPjtoSNCbKwJD5UuMpxjRGrOASVETf/RvgZxxgtv35P0Y+1CLoE6SxTD8cNCuVqoYkqIPQbPxaSysHgyDBPq7DtvclSEb0Y9SXsaGSKbBPYetv6znu3LncMa/K+CwjkNwSyhkYWtPjbFLqnoi9kg6J2pOYvY9mchIQ== [preauth]
28204 2023-10-15 10:14:48.254 debug1: userauth_pubkey: test pkalg rsa-sha2-512 pkblob RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc [preauth]
28204 2023-10-15 10:14:48.254 debug3: mm_key_allowed: entering [preauth]
28204 2023-10-15 10:14:48.254 debug3: mm_request_send: entering, type 22 [preauth]
28204 2023-10-15 10:14:48.254 debug3: mm_key_allowed: waiting for MONITOR_ANS_KEYALLOWED [preauth]
28204 2023-10-15 10:14:48.254 debug3: mm_request_receive_expect: entering, type 23 [preauth]
28204 2023-10-15 10:14:48.254 debug3: mm_request_receive: entering [preauth]
28204 2023-10-15 10:14:48.254 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.254 debug3: monitor_read: checking request 22
28204 2023-10-15 10:14:48.254 debug3: mm_answer_keyallowed: entering
28204 2023-10-15 10:14:48.254 debug3: mm_answer_keyallowed: key_from_blob: 000001BC3E506020
28204 2023-10-15 10:14:48.254 debug1: trying public key file C:\\Users\\xiaot\\.ssh/authorized_keys
28204 2023-10-15 10:14:48.254 debug1: C:\\Users\\xiaot\\.ssh/authorized_keys:1: matching key found: RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc
28204 2023-10-15 10:14:48.254 debug1: C:\\Users\\xiaot\\.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
28204 2023-10-15 10:14:48.254 Accepted key RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc found at C:\\Users\\xiaot\\.ssh/authorized_keys:1
28204 2023-10-15 10:14:48.254 debug3: mm_answer_keyallowed: publickey authentication test: RSA key is allowed
28204 2023-10-15 10:14:48.254 debug3: mm_request_send: entering, type 23
28204 2023-10-15 10:14:48.254 debug3: send packet: type 60 [preauth]
28204 2023-10-15 10:14:48.254 debug2: userauth_pubkey: authenticated 0 pkalg rsa-sha2-512 [preauth]
28204 2023-10-15 10:14:48.254 debug3: user_specific_delay: user specific delay 0.000ms [preauth]
28204 2023-10-15 10:14:48.254 debug3: ensure_minimum_time_since: elapsed 0.000ms, delaying 5.939ms (requested 5.939ms) [preauth]
28204 2023-10-15 10:14:48.269 Postponed publickey for xiaot from 192.168.1.60 port 49411 ssh2 [preauth]
28204 2023-10-15 10:14:48.301 debug3: receive packet: type 50 [preauth]
28204 2023-10-15 10:14:48.301 debug1: userauth-request for user xiaot service ssh-connection method publickey [preauth]
28204 2023-10-15 10:14:48.301 debug1: attempt 2 failures 0 [preauth]
28204 2023-10-15 10:14:48.301 debug2: input_userauth_request: try method publickey [preauth]
28204 2023-10-15 10:14:48.301 debug2: userauth_pubkey: valid user xiaot attempting public key rsa-sha2-512 AAAAB3NzaC1yc2EAAAADAQABAAACAQC32FQLfqyZ+ERUK4MWaO2BjwQDjk34CpvVHVCjJmDLaTTnUJ9FpeBysHhprn0HTduOhcgNxUG8+wsclZFTciM9MRHBbVi4km9o41ai4VzKkgGWjR+eKgNJJreOUZTkSqzkkCctKzC9UvC8xXMiDGNPVISgbECKPyva8M9GHaGymFB1plXnMWmfHtq3o3jMDGh2r3n+UMmCDIm/BDmgMP9sBGh/XumAbhoQcPpuEYUPvmIkoZClRcAAhEl8Usmnd9r6NVlnUjnAEAL+uj6rOVnvRxyKCbZFGFfDFDUiI+E5QHhUsX1Br60FUYQ5kJ0nK/Ficm5aUvunTABa2A2Kp7mibpEmKEWotpR2KN17AAcJNv/mB91U9W1xqVdHc54yMj/WhXvq/9XC7OHx/EFZ1oK5PB6dryE/julN1BgFIii8TfCEIJQeGplrydWNZbwMHAsRbdoIWDn6E5etMdCOwwWUzfaPxqxHhAUrQhqiGZd4oAeR8xaUf2InC8q/EHtOKXMcNcEbgSpZAPjtoSNCbKwJD5UuMpxjRGrOASVETf/RvgZxxgtv35P0Y+1CLoE6SxTD8cNCuVqoYkqIPQbPxaSysHgyDBPq7DtvclSEb0Y9SXsaGSKbBPYetv6znu3LncMa/K+CwjkNwSyhkYWtPjbFLqnoi9kg6J2pOYvY9mchIQ== [preauth]
28204 2023-10-15 10:14:48.301 debug3: userauth_pubkey: have rsa-sha2-512 signature for RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc [preauth]
28204 2023-10-15 10:14:48.301 debug3: mm_key_allowed: entering [preauth]
28204 2023-10-15 10:14:48.301 debug3: mm_request_send: entering, type 22 [preauth]
28204 2023-10-15 10:14:48.301 debug3: mm_key_allowed: waiting for MONITOR_ANS_KEYALLOWED [preauth]
28204 2023-10-15 10:14:48.301 debug3: mm_request_receive_expect: entering, type 23 [preauth]
28204 2023-10-15 10:14:48.301 debug3: mm_request_receive: entering [preauth]
28204 2023-10-15 10:14:48.301 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.302 debug3: monitor_read: checking request 22
28204 2023-10-15 10:14:48.302 debug3: mm_answer_keyallowed: entering
28204 2023-10-15 10:14:48.302 debug3: mm_answer_keyallowed: key_from_blob: 000001BC3E506020
28204 2023-10-15 10:14:48.302 debug1: trying public key file C:\\Users\\xiaot\\.ssh/authorized_keys
28204 2023-10-15 10:14:48.306 debug1: C:\\Users\\xiaot\\.ssh/authorized_keys:1: matching key found: RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc
28204 2023-10-15 10:14:48.306 debug1: C:\\Users\\xiaot\\.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
28204 2023-10-15 10:14:48.306 Accepted key RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc found at C:\\Users\\xiaot\\.ssh/authorized_keys:1
28204 2023-10-15 10:14:48.306 debug3: mm_answer_keyallowed: publickey authentication: RSA key is allowed
28204 2023-10-15 10:14:48.306 debug3: mm_request_send: entering, type 23
28204 2023-10-15 10:14:48.307 debug3: mm_sshkey_verify: entering [preauth]
28204 2023-10-15 10:14:48.307 debug3: mm_request_send: entering, type 24 [preauth]
28204 2023-10-15 10:14:48.307 debug3: mm_sshkey_verify: waiting for MONITOR_ANS_KEYVERIFY [preauth]
28204 2023-10-15 10:14:48.307 debug3: mm_request_receive_expect: entering, type 25 [preauth]
28204 2023-10-15 10:14:48.307 debug3: mm_request_receive: entering [preauth]
28204 2023-10-15 10:14:48.307 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.307 debug3: monitor_read: checking request 24
28204 2023-10-15 10:14:48.310 debug3: mm_answer_keyverify: publickey 000001BC3E4D7D40 signature verified
28204 2023-10-15 10:14:48.310 debug1: auth_activate_options: setting new authentication options
28204 2023-10-15 10:14:48.310 debug3: mm_request_send: entering, type 25
28204 2023-10-15 10:14:48.310 Accepted publickey for xiaot from 192.168.1.60 port 49411 ssh2: RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc
28204 2023-10-15 10:14:48.310 debug1: monitor_child_preauth: user xiaot authenticated by privileged process
28204 2023-10-15 10:14:48.310 debug3: mm_get_keystate: Waiting for new keys
28204 2023-10-15 10:14:48.310 debug3: mm_request_receive_expect: entering, type 26
28204 2023-10-15 10:14:48.310 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.319 debug3: mm_get_keystate: GOT new keys
28204 2023-10-15 10:14:48.320 debug1: auth_activate_options: setting new authentication options [preauth]
28204 2023-10-15 10:14:48.320 debug2: userauth_pubkey: authenticated 1 pkalg rsa-sha2-512 [preauth]
28204 2023-10-15 10:14:48.320 debug3: user_specific_delay: user specific delay 0.000ms [preauth]
28204 2023-10-15 10:14:48.320 debug3: ensure_minimum_time_since: elapsed 9.029ms, delaying 2.848ms (requested 5.939ms) [preauth]
28204 2023-10-15 10:14:48.320 debug3: send packet: type 52 [preauth]
28204 2023-10-15 10:14:48.320 debug3: mm_request_send: entering, type 26 [preauth]
28204 2023-10-15 10:14:48.320 debug3: mm_send_keystate: Finished sending state [preauth]
28204 2023-10-15 10:14:48.326 debug1: monitor_read_log: child log fd closed
28204 2023-10-15 10:14:48.334 debug3: LsaLogonUser Succeeded (Impersonation: 1)
28204 2023-10-15 10:14:48.338 debug3: spawning "C:\\WINDOWS\\System32\\OpenSSH\\sshd.exe" -z as user
28204 2023-10-15 10:14:48.338 User child is on pid 28216
28204 2023-10-15 10:14:48.338 debug3: send_rexec_state: entering fd = 5 config len 219
28204 2023-10-15 10:14:48.338 debug3: ssh_msg_send: type 0
28204 2023-10-15 10:14:48.338 debug3: send_rexec_state: done
28204 2023-10-15 10:14:48.338 debug3: ssh_msg_send: type 0
28204 2023-10-15 10:14:48.338 debug3: ssh_msg_send: type 0
28204 2023-10-15 10:14:48.338 debug3: ssh_msg_send: type 0
28204 2023-10-15 10:14:48.338 debug3: ssh_msg_send: type 0
28204 2023-10-15 10:14:48.338 debug3: ssh_msg_send: type 0
28216 2023-10-15 10:14:48.354 debug3: recv_idexch_state: entering fd = 3
28216 2023-10-15 10:14:48.354 debug3: ssh_msg_recv entering
28216 2023-10-15 10:14:48.354 debug3: recv_idexch_state: done
28216 2023-10-15 10:14:48.354 debug2: fd 5 setting O_NONBLOCK
28216 2023-10-15 10:14:48.354 debug3: recv_autxctx_state: entering fd = 3
28216 2023-10-15 10:14:48.354 debug3: ssh_msg_recv entering
28216 2023-10-15 10:14:48.354 debug3: recv_autxctx_state: done
28216 2023-10-15 10:14:48.354 debug2: parse_server_config_depth: config reprocess config len 219
28204 2023-10-15 10:14:48.354 debug3: monitor_recv_keystate: entering 
28204 2023-10-15 10:14:48.354 debug3: ssh_msg_recv entering
28204 2023-10-15 10:14:48.354 debug3: monitor_recv_keystate: done
28204 2023-10-15 10:14:48.354 debug3: monitor_apply_keystate: packet_set_state
28204 2023-10-15 10:14:48.354 debug2: set_newkeys: mode 0
28204 2023-10-15 10:14:48.354 debug1: rekey in after 134217728 blocks
28204 2023-10-15 10:14:48.354 debug2: set_newkeys: mode 1
28204 2023-10-15 10:14:48.354 debug1: rekey out after 134217728 blocks
28204 2023-10-15 10:14:48.354 debug1: ssh_packet_set_postauth: called
28204 2023-10-15 10:14:48.354 debug3: ssh_packet_set_state: done
28204 2023-10-15 10:14:48.354 debug3: monitor_recv_authopt: entering 
28204 2023-10-15 10:14:48.354 debug3: ssh_msg_recv entering
28204 2023-10-15 10:14:48.354 debug3: monitor_recv_authopt: done
28204 2023-10-15 10:14:48.354 debug3: notify_hostkeys: key 0: ssh-rsa SHA256:9pBz91tPNF7ihESfqX4COtDrkV7WOFyJU/y790Pqupo
28204 2023-10-15 10:14:48.354 debug3: notify_hostkeys: key 1: ecdsa-sha2-nistp256 SHA256:5g1UOb30/ljK6iNi3JKBWSPTNpX9r+32iE7l5gSmibc
28204 2023-10-15 10:14:48.354 debug3: notify_hostkeys: key 2: ssh-ed25519 SHA256:81eHSTMh4rptANYAq/RS7OqqAiLbeEzCw9nRQZOn4zo
28204 2023-10-15 10:14:48.354 debug3: notify_hostkeys: sent 3 hostkeys
28204 2023-10-15 10:14:48.354 debug3: send packet: type 80
28204 2023-10-15 10:14:48.354 debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
28204 2023-10-15 10:14:48.354 debug1: Entering interactive session for SSH2.
28204 2023-10-15 10:14:48.354 debug2: fd 8 setting O_NONBLOCK
28204 2023-10-15 10:14:48.354 debug2: fd 9 setting O_NONBLOCK
28204 2023-10-15 10:14:48.354 debug1: server_init_dispatch
28204 2023-10-15 10:14:48.354 debug3: receive packet: type 90
28204 2023-10-15 10:14:48.354 debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
28204 2023-10-15 10:14:48.354 debug1: input_session_request
28204 2023-10-15 10:14:48.354 debug1: channel 0: new [server-session]
28204 2023-10-15 10:14:48.354 debug2: session_new: allocate (allocated 0 max 10)
28204 2023-10-15 10:14:48.354 debug3: session_unused: session id 0 unused
28204 2023-10-15 10:14:48.354 debug1: session_new: session 0
28204 2023-10-15 10:14:48.354 debug1: session_open: channel 0
28204 2023-10-15 10:14:48.354 debug1: session_open: session 0: link with channel 0
28204 2023-10-15 10:14:48.354 debug1: server_input_channel_open: confirm session
28204 2023-10-15 10:14:48.354 debug3: send packet: type 91
28204 2023-10-15 10:14:48.354 debug3: receive packet: type 80
28204 2023-10-15 10:14:48.354 debug1: server_input_global_request: rtype no-more-sessions@openssh.com want_reply 0
28204 2023-10-15 10:14:48.394 debug3: receive packet: type 80
28204 2023-10-15 10:14:48.394 debug1: server_input_global_request: rtype hostkeys-prove-00@openssh.com want_reply 1
28204 2023-10-15 10:14:48.394 debug3: mm_sshkey_sign: entering
28204 2023-10-15 10:14:48.394 debug3: mm_request_send: entering, type 6
28204 2023-10-15 10:14:48.394 debug3: mm_sshkey_sign: waiting for MONITOR_ANS_SIGN
28204 2023-10-15 10:14:48.394 debug3: mm_request_receive_expect: entering, type 7
28204 2023-10-15 10:14:48.394 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.394 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.394 debug3: monitor_read: checking request 6
28204 2023-10-15 10:14:48.394 debug3: mm_answer_sign: entering
28204 2023-10-15 10:14:48.410 debug3: mm_answer_sign: hostkey proof signature 000001BC3E49DFF0(399)
28204 2023-10-15 10:14:48.410 debug3: mm_request_send: entering, type 7
28204 2023-10-15 10:14:48.410 debug3: send packet: type 81
28204 2023-10-15 10:14:48.410 debug3: receive packet: type 98
28204 2023-10-15 10:14:48.410 debug1: server_input_channel_req: channel 0 request pty-req reply 1
28204 2023-10-15 10:14:48.410 debug1: session_by_channel: session 0 channel 0
28204 2023-10-15 10:14:48.410 debug1: session_input_channel_req: session 0 req pty-req
28204 2023-10-15 10:14:48.410 debug1: Allocating pty.
28204 2023-10-15 10:14:48.410 debug3: fd 10 is not O_NONBLOCK
28204 2023-10-15 10:14:48.410 debug3: fd 11 is not O_NONBLOCK
28204 2023-10-15 10:14:48.410 debug1: session_pty_req: session 0 alloc windows-pty
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 1 (0x1)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 2 (0x2)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 3 (0x3)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 4 (0x4)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 5 (0x5)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 6 (0x6)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 7 (0x7)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 8 (0x8)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 9 (0x9)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 10 (0xa)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 11 (0xb)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 12 (0xc)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 13 (0xd)
28204 2023-10-15 10:14:48.410 debug1: Ignoring unsupported tty mode opcode 14 (0xe)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 17 (0x11)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 18 (0x12)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 30 (0x1e)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 31 (0x1f)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 32 (0x20)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 33 (0x21)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 34 (0x22)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 35 (0x23)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 36 (0x24)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 38 (0x26)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 39 (0x27)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 40 (0x28)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 41 (0x29)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 42 (0x2a)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 50 (0x32)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 51 (0x33)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 53 (0x35)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 54 (0x36)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 55 (0x37)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 56 (0x38)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 57 (0x39)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 58 (0x3a)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 59 (0x3b)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 60 (0x3c)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 61 (0x3d)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 62 (0x3e)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 70 (0x46)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 72 (0x48)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 73 (0x49)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 74 (0x4a)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 75 (0x4b)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 90 (0x5a)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 91 (0x5b)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 92 (0x5c)
28204 2023-10-15 10:14:48.411 debug1: Ignoring unsupported tty mode opcode 93 (0x5d)
28204 2023-10-15 10:14:48.411 debug3: send packet: type 99
28204 2023-10-15 10:14:48.411 debug3: receive packet: type 98
28204 2023-10-15 10:14:48.411 debug1: server_input_channel_req: channel 0 request env reply 0
28204 2023-10-15 10:14:48.411 debug1: session_by_channel: session 0 channel 0
28204 2023-10-15 10:14:48.411 debug1: session_input_channel_req: session 0 req env
28204 2023-10-15 10:14:48.411 debug2: Ignoring env request LANG: disallowed name
28204 2023-10-15 10:14:48.411 debug3: receive packet: type 98
28204 2023-10-15 10:14:48.411 debug1: server_input_channel_req: channel 0 request shell reply 1
28204 2023-10-15 10:14:48.411 debug1: session_by_channel: session 0 channel 0
28204 2023-10-15 10:14:48.411 debug1: session_input_channel_req: session 0 req shell
28204 2023-10-15 10:14:48.411 Starting session: shell on windows-pty for xiaot from 192.168.1.60 port 49411 id 0
28204 2023-10-15 10:14:48.411 debug2: fd 12 setting O_NONBLOCK
28204 2023-10-15 10:14:48.411 debug2: fd 13 setting O_NONBLOCK
28204 2023-10-15 10:14:48.411 debug2: fd 14 setting O_NONBLOCK
28204 2023-10-15 10:14:48.411 debug2: fd 15 setting O_NONBLOCK
28204 2023-10-15 10:14:48.411 debug2: fd 16 setting O_NONBLOCK
28204 2023-10-15 10:14:48.411 debug2: fd 17 setting O_NONBLOCK
28204 2023-10-15 10:14:48.411 debug3: shell: "c:\\\\windows\\\\system32\\\\bash.exe"
28204 2023-10-15 10:14:48.411 debug3: shell_option: -c
28204 2023-10-15 10:14:48.411 debug3: This windows OS supports conpty
28204 2023-10-15 10:14:48.412 debug3: pty commandline: C:\\\\WINDOWS\\\\system32\\\\conhost.exe --headless --width 204 --height 54 --signal 0x200 -- "c:\\\\windows\\\\system32\\\\bash.exe"
28204 2023-10-15 10:14:48.416 debug2: fd 5 setting TCP_NODELAY
28204 2023-10-15 10:14:48.416 debug2: channel 0: rfd 14 isatty
28204 2023-10-15 10:14:48.416 debug3: fd 14 is O_NONBLOCK
28204 2023-10-15 10:14:48.416 debug3: fd 13 is O_NONBLOCK
28204 2023-10-15 10:14:48.416 debug3: send packet: type 99
28204 2023-10-15 10:14:48.504 debug2: channel 0: read<=0 rfd 14 len 0
28204 2023-10-15 10:14:48.504 debug2: channel 0: read failed
28204 2023-10-15 10:14:48.504 debug2: chan_shutdown_read: channel 0: (i0 o0 sock -1 wfd 14 efd -1 [closed])
28204 2023-10-15 10:14:48.504 debug2: channel 0: input open -> drain
28204 2023-10-15 10:14:48.504 debug2: channel 0: ibuf empty
28204 2023-10-15 10:14:48.504 debug2: channel 0: send eof
28204 2023-10-15 10:14:48.504 debug3: send packet: type 96
28204 2023-10-15 10:14:48.504 debug2: channel 0: input drain -> closed
28204 2023-10-15 10:14:48.505 debug1: Received SIGCHLD.
28204 2023-10-15 10:14:48.505 debug1: session_by_pid: pid 9172
28204 2023-10-15 10:14:48.505 debug1: session_exit_message: session 0 channel 0 pid 9172
28204 2023-10-15 10:14:48.505 debug2: channel 0: request exit-status confirm 0
28204 2023-10-15 10:14:48.505 debug3: send packet: type 98
28204 2023-10-15 10:14:48.505 debug1: session_exit_message: release channel 0
28204 2023-10-15 10:14:48.505 debug2: channel 0: write failed
28204 2023-10-15 10:14:48.505 debug2: chan_shutdown_write: channel 0: (i3 o0 sock -1 wfd 13 efd -1 [closed])
28204 2023-10-15 10:14:48.505 debug2: channel 0: send eow
28204 2023-10-15 10:14:48.506 debug3: send packet: type 98
28204 2023-10-15 10:14:48.506 debug2: channel 0: output open -> closed
28204 2023-10-15 10:14:48.506 debug2: channel 0: send close
28204 2023-10-15 10:14:48.506 debug3: send packet: type 97
28204 2023-10-15 10:14:48.506 debug3: channel 0: will not send data after close
28204 2023-10-15 10:14:48.506 debug2: notify_done: reading
28204 2023-10-15 10:14:48.506 debug3: channel 0: will not send data after close
28204 2023-10-15 10:14:48.511 debug3: receive packet: type 97
28204 2023-10-15 10:14:48.511 debug2: channel 0: rcvd close
28204 2023-10-15 10:14:48.511 debug3: channel 0: will not send data after close
28204 2023-10-15 10:14:48.511 debug2: channel 0: is dead
28204 2023-10-15 10:14:48.511 debug2: channel 0: gc: notify user
28204 2023-10-15 10:14:48.511 debug1: session_by_channel: session 0 channel 0
28204 2023-10-15 10:14:48.511 debug1: session_close_by_channel: channel 0 child 0
28204 2023-10-15 10:14:48.511 Close session: user xiaot from 192.168.1.60 port 49411 id 0
28204 2023-10-15 10:14:48.511 debug3: session_unused: session id 0 unused
28204 2023-10-15 10:14:48.511 debug2: channel 0: gc: user detached
28204 2023-10-15 10:14:48.511 debug2: channel 0: is dead
28204 2023-10-15 10:14:48.511 debug2: channel 0: garbage collecting
28204 2023-10-15 10:14:48.511 debug1: channel 0: free: server-session, nchannels 1
28204 2023-10-15 10:14:48.511 debug3: channel 0: status: The following connections are open:\\r\\n  #0 server-session (t4 r0 i3/0 o3/0 e[closed]/0 fd -1/-1/-1 sock -1 cc -1)\\r\\n
28204 2023-10-15 10:14:48.512 debug3: receive packet: type 1
28204 2023-10-15 10:14:48.512 Received disconnect from 192.168.1.60 port 49411:11: disconnected by user
28204 2023-10-15 10:14:48.512 Disconnected from 192.168.1.60 port 49411
28204 2023-10-15 10:14:48.512 debug1: do_cleanup
28204 2023-10-15 10:14:48.515 debug3: mm_request_receive: entering
28204 2023-10-15 10:14:48.515 debug1: do_cleanup

接続時のクライアント側のログも出力させる

ssh -v -i ~/.ssh/mykey xiaot@192.168.1.76
ログの内容はこちら

(base) takumi@ ~/.ssh$ ssh -v -i ~/.ssh/mywhite xiaot@192.168.1.76

OpenSSH_9.3p2, LibreSSL 3.3.6

debug1: Reading configuration data /Users/takumi/.ssh/config

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 192.168.1.76 [192.168.1.76] port 22.

debug1: Connection established.

debug1: identity file /Users/takumi/.ssh/mywhite type 0

debug1: identity file /Users/takumi/.ssh/mywhite-cert type -1

debug1: Local version string SSH-2.0-OpenSSH_9.3

debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.6

debug1: compat_banner: match: OpenSSH_for_Windows_8.6 pat OpenSSH* compat 0x04000000

debug1: Authenticating to 192.168.1.76:22 as ‘xiaot’

debug1: load_hostkeys: fopen /Users/takumi/.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: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

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

debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

debug1: SSH2_MSG_KEX_ECDH_REPLY received

debug1: Server host key: ssh-ed25519 SHA256:81eHSTMh4rptANYAq/RS7OqqAiLbeEzCw9nRQZOn4zo

debug1: load_hostkeys: fopen /Users/takumi/.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 ‘192.168.1.76’ is known and matches the ED25519 host key.

debug1: Found key in /Users/takumi/.ssh/known_hosts:62

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: get_agent_identities: bound agent to hostkey

debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities

debug1: Will attempt key: /Users/takumi/.ssh/mywhite RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc explicit

debug1: SSH2_MSG_EXT_INFO received

debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Next authentication method: publickey

debug1: Offering public key: /Users/takumi/.ssh/mywhite RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc explicit

debug1: Server accepts key: /Users/takumi/.ssh/mywhite RSA SHA256:Vv+JHxa4rV4Pou9PneNcdzdNTofQE2a22oH2bkwqTnc explicit

Authenticated to 192.168.1.76 ([192.168.1.76]:22) using “publickey”.

debug1: channel 0: new session [client-session] (inactive timeout: 0)

debug1: Requesting no-more-sessions@openssh.com

debug1: Entering interactive session.

debug1: pledge: filesystem

debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0

debug1: client_input_hostkeys: searching /Users/takumi/.ssh/known_hosts for 192.168.1.76 / (none)

debug1: client_input_hostkeys: searching /Users/takumi/.ssh/known_hosts2 for 192.168.1.76 / (none)

debug1: client_input_hostkeys: hostkeys file /Users/takumi/.ssh/known_hosts2 does not exist

debug1: Sending environment.

debug1: channel 0: setting env LANG = “ja_JP.UTF-8”

debug1: client_global_hostkeys_prove_confirm: server used untrusted RSA signature algorithm ssh-rsa for key 0, disregarding

debug1: update_known_hosts: known hosts file /Users/takumi/.ssh/known_hosts2 does not exist

debug1: pledge: fork

ファイルにアクセスできません。

debug1: client_input_channel_req: channel 0 rtype exit-status reply 0

debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0

debug1: channel 0: free: client-session, nchannels 1

Connection to 192.168.1.76 closed.

Transferred: sent 4416, received 3684 bytes, in 0.2 seconds

Bytes per second: sent 23725.4, received 19792.6

debug1: Exit status 0

ログを見ていて、ファイルにアクセスできません。
という部分が気になる。

Windowsの問題かも?

Windows Subsystem For Linux Previewを使えばいいのかもしれない?

以下リンクが関連していそうだ。

https://www.zukeran.org/shin/d/2022/09/24/wsl-exe-access-is-denied/

PS C:\Users\xiaot> wsl --version
WSL バージョン: 1.2.5.0
カーネル バージョン: 5.15.90.1
WSLg バージョン: 1.0.51
MSRDC バージョン: 1.2.3770
Direct3D バージョン: 1.608.2-61064218
DXCore バージョン: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows バージョン: 10.0.22621.2428

https://github.com/microsoft/WSL/issues/8072