2017-02-04 2 views
1

내 Windows 10 호스트에서 내 우분투 버추얼 박스 게스트로의 포트 포워딩을 3 년 이상 완벽하게 처리 한 다음 게스트를 재부팅 한 후 갑자기 재부팅했습니다. 어제 PUTTY가 연결을 중단했습니다.가상 박스 : Win10 호스트에서 SSH로 우분투 게스트로 SSH를위한 포트 포워딩

설정을 변경하지 않고 방금 작업을 중단했습니다. 조사하고 인터넷에서 발견 된 많은 제안을 시도했지만 여전히 작동하지 않습니다. 여기에 세부 사항은 다음과 같습니다 우분투 게스트에

, 나는 포트 22

$ ssh localhost 
[email protected]'s password: 
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-108-generic x86_64) 
... 
에 로컬 호스트에 SSH 성공적으로 sshd 데몬은 우분투 게스트에
$ ps aux | grep sshd 
jryan 19096 0.0 0.0 61376 3036 ? Ss 14:15 0:00 /usr/sbin/sshd 

실행되고 있는지 수 있습니다 확인했다 우분투 게스트에

, 나는 SSHD 포트 (22)

netstat -lp --inet 
tcp 0 0 localhost:ssh  *:*  LISTEN 
tcp 0 0 10.0.0.18:ssh  *:*  LISTEN 

에서 수신되는 것을 확인했다 나는 윈도우 10 호스트에서 ssh를 할 때 다시 nmap을

$ sudo nmap -sS -O localhost/24 
PORT  STATE SERVICE 
22/tcp open ssh 

와 (퍼티를 사용하여), 그냥 60 초 동안 중단 후 나는 "예기치 않게 서버 폐쇄 된 네트워크 연결"오류가 발생합니다.

VBoxManage showvminfo 
NIC 2:   MAC: 080027775E38, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none 
NIC 2 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64) 
NIC 2 Rule(0): name = ssh, protocol = tcp, host ip = , host port = 60022, guest ip = , guest port = 22 

I 포트 있음을 확인했다 :

[email protected]:/mnt/c/Windows/System32$ ssh -vv [email protected] -p 60022 
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 19: Applying options for * 
debug2: ssh_connect: needpriv 0 
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 60022. 
debug1: Connection established. 
debug1: identity file /mnt/c/Users/[user]/Google Drive/[user]/home/jryan/.ssh/id_rsa type -1 
debug1: identity file /mnt/c/Users/[user]/Google Drive/[user]/home/jryan/.ssh/id_rsa-cert type -1 
debug1: identity file /mnt/c/Users/[user]/Google Drive/[user]/home/jryan/.ssh/id_dsa type -1 
debug1: identity file /mnt/c/Users/[user]/Google Drive/[user]/home/jryan/.ssh/id_dsa-cert type -1 
debug1: identity file /mnt/c/Users/[user]/Google Drive/[user]/home/jryan/.ssh/id_ecdsa type -1 
debug1: identity file /mnt/c/Users/[user]/Google Drive/[user]/home/jryan/.ssh/id_ecdsa-cert type -1 
debug1: identity file /mnt/c/Users/[user]/Google Drive/[user]/home/jryan/.ssh/id_ed25519 type -1 
debug1: identity file /mnt/c/Users/[user]/Google Drive/[user]/home/jryan/.ssh/id_ed25519-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8 
ssh_exchange_identification: Connection closed by remote host 

내가 포트 포워딩이 가상 머신에 설정되어 있는지 확인했다 : 나는 다음 명령 줄에서 SSH를 실행하려면 윈도우 BASH 세션을 열어 60022 내가 포트 60022

에 (인바운드 및 아웃 바운드) 모든 TCP 연결을 허용 Windows 방화벽 규칙을 설정 한

c:\Program Files\Oracle\VirtualBox>netstat -a 

Active Connections 

    Proto Local Address   Foreign Address  State 
    TCP 0.0.0.0:22    JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:80    JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:135   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:443   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:445   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:7680   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:23367   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:49664   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:49665   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:49666   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:49667   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:49668   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:49670   JimSurfacePro4:0  LISTENING 
    TCP 0.0.0.0:60022   JimSurfacePro4:0  LISTENING 
    TCP 10.0.0.8:139   JimSurfacePro4:0  LISTENING 

Windows 호스트에서 열려

우분투 게스트에서 로그를 확인했습니다. 연결을 시도 할 때 /var/logs/auth.log 또는 /var/logs/syslog에 아무 것도 쓰여지지 않습니다.

여기 내 /etc/ssh/sshd_config 우분투 호스트에서이다 : 나는 아이디어 나갈거야

[email protected]:~$ cat /etc/ssh/sshd_config 
# Package generated configuration file 
# See the sshd_config(5) manpage for details 

# What ports, IPs and protocols we listen for 
Port 22 
# Use these options to restrict which interfaces/protocols sshd will bind to 
#ListenAddress :: 
ListenAddress 127.0.0.1 
ListenAddress 10.0.0.18 
Protocol 2,1 
AllowUsers jryan 
# HostKeys for protocol version 2 
HostKey /etc/ssh/ssh_host_rsa_key 
HostKey /etc/ssh/ssh_host_dsa_key 
HostKey /etc/ssh/ssh_host_ecdsa_key 
HostKey /etc/ssh/ssh_host_ed25519_key 
#Privilege Separation is turned on for security 
UsePrivilegeSeparation yes 

# Lifetime and size of ephemeral version 1 server key 
KeyRegenerationInterval 3600 
ServerKeyBits 1024 

# Logging 
SyslogFacility AUTH 
LogLevel INFO 

# Authentication: 
PasswordAuthentication yes 
LoginGraceTime 240 
PermitRootLogin without-password 
StrictModes yes 

RSAAuthentication yes 
PubkeyAuthentication yes 
#AuthorizedKeysFile %h/.ssh/authorized_keys 

# Don't read the user's ~/.rhosts and ~/.shosts files 
IgnoreRhosts yes 
# For this to work you will also need host keys in /etc/ssh_known_hosts 
RhostsRSAAuthentication no 
# similar for protocol version 2 
HostbasedAuthentication no 
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication 
#IgnoreUserKnownHosts yes 

# To enable empty passwords, change to yes (NOT RECOMMENDED) 
PermitEmptyPasswords no 

# Change to yes to enable challenge-response passwords (beware issues with 
# some PAM modules and threads) 
ChallengeResponseAuthentication no 

# Change to no to disable tunnelled clear text passwords 
#PasswordAuthentication yes 

# Kerberos options 
#KerberosAuthentication no 
#KerberosGetAFSToken no 
#KerberosOrLocalPasswd yes 
#KerberosTicketCleanup yes 

# GSSAPI options 
#GSSAPIAuthentication no 
#GSSAPICleanupCredentials yes 

X11Forwarding yes 
X11DisplayOffset 10 
PrintMotd no 
PrintLastLog yes 
TCPKeepAlive yes 
ClientAliveInterval 60 
ClientAliveCountMax 20 
#UseLogin no 

#MaxStartups 10:30:60 
#Banner /etc/issue.net 

# Allow client to pass locale environment variables 
AcceptEnv LANG LC_* 

Subsystem sftp /usr/lib/openssh/sftp-server 

# Set this to 'yes' to enable PAM authentication, account processing, 
# and session processing. If this is enabled, PAM authentication will 
# be allowed through the ChallengeResponseAuthentication and 
# PasswordAuthentication. Depending on your PAM configuration, 
# PAM authentication via ChallengeResponseAuthentication may bypass 
# the setting of "PermitRootLogin without-password". 
# If you just want the PAM account and session checks to run without 
# PAM authentication, then enable this but set PasswordAuthentication 
# and ChallengeResponseAuthentication to 'no'. 
UsePAM yes 

. 여기서 무슨 일이 일어나는지 알아낼 수 있는지 알려주세요.

감사합니다.

답변

0

Windows 방화벽을 가져 와서 한 번 사용해보십시오. Windows 10에서는 가상 박스 네트워킹에 몇 가지 문제가 있음을 발견했습니다.