Windows 10では、仮想マシンにSSHで接続できません(以前は正常に動作していました)。

Windows 10では、仮想マシンにSSHで接続できません(以前は正常に動作していました)。

私は、ミニネットを実行する大学の課題のために、Windows 10ホストのOracle Virtual BoxでUbuntu 14 VMを実行しています。ある日起きてVMにSSH経由でログインしようとしましたが(ようこそメッセージが表示されます)、プロンプトが表示されなくなるまですべてがうまく実行されました。まるで入力できるという点滅する行がありますが、Enterキーなどを押すとコンピュータからビープ音が鳴り、Ctrl+を押してD終了します。

私はSSHを使用しています

ssh user@ip

前日は完璧に機能し、それを台無しにする可能性がある変更を適用したことを覚えていません。私はVMイメージを削除し、新しいバージョンを再インポートし、Virtual Boxを再インストールし、VM内でさまざまな設定を試して動作しようとしましたが、役に立ちませんでした。 PuTTyを使用して仮想マシンにSSH接続することはできますが、Visual Studioを使用する必要があるため、PuTTyをサポートしていません。ホストに問題があるようですが、それが何であるかはわかりません。

問題を解決するために私ができることについての提案はありますか?

以下の-vコマンドを使用して更新してください。 +を使用して手動で接続を閉じた後、Ctrl接続は閉じましたD。ウェルカムメッセージが表示されますが、何も表示されず、点滅しているカーソルのみが表示されます。

PS C:\WINDOWS\system32> ssh -v  [email protected]
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\HP/.ssh/config
debug1: C:\\Users\\HP/.ssh/config line 1: Applying options for 192.168.56.10
debug1: Connecting to 192.168.56.10 [192.168.56.10] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\HP/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\HP/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to 192.168.56.10:22 as 'cs551'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:wDmGnoAN/7DHHH1OTiFsKC3l4v5PYvxOm659KKLCDwk
debug1: Host '192.168.56.10' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\HP/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:iMnIfpXDKQgmDCnJSUpBS1x4uOM3gXOa888wrKwkLDI C:\\Users\\HP/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: C:\\Users\\HP/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\HP/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\HP/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\HP/.ssh/id_xmss
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such file or directory
[email protected]'s password:
debug1: Authentication succeeded (password).
Authenticated to 192.168.56.10 ([192.168.56.10]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: console doesn't support the ansi parsing
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-53-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

Last login: Tue Feb 16 06:16:59 2021 from 192.168.56.1

oot
eu: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to 192.168.56.10 closed.
Transferred: sent 2212, received 2552 bytes, in 64.7 seconds
Bytes per second: sent 34.2, received 39.5
debug1: Exit status 0
PS C:\WINDOWS\system32>

ベストアンサー1

(1)まず、Linuxシステムで次のコマンドを実行してSSHサーバーを再構成できます。

sudo dpkg-reconfigure openssh-server

上記のコマンドが失敗した場合は、LinuxシステムでSSHキーを再生成するだけです。

$ ssh-keygen -b 2048 -t rsa

(2) 次に、管理者権限で PowerShell(PS) を開きます。既存のSSH環境変数を使用して一般ユーザーとしてPSを開く必要があります。これでSSHが再び機能します。

(3) 第三に、Windowsシステムから古いSSH公開鍵を削除します。

$ ssh-keygen -R 192.168.56.10

(4)いよいよSSHを正常に実行できるようになりました。

おすすめ記事