Bas*_*nem 69 ssh bash windows-10 windows-subsystem-for-linux
长期读者,第一次提问。
我按照此答案中的说明进行操作:
如何通过 SSH 连接到“Windows 10 上的 Ubuntu 上的 Bash”?
我正在尝试在同一台机器上的 Windows 中从 PuTTY 进行 SSH。使用与我的配置文件匹配的端口 22。尝试了 127.0.0.1 和 127.0.1.1。但是,我仍然收到“拒绝访问”的消息:
最终我希望建立一个 Visual Studio 远程构建,但到目前为止我根本无法远程进入。我应该采取哪些后续步骤?
Process Hacker 为端口 22 显示了这一点(不确定这意味着什么):
以下是 /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 0.0.0.0
Protocol 2
# 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 no
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin no
AllowUsers basel
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
#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
Run Code Online (Sandbox Code Playgroud)
小智 45
把文件里的22端口改成其他的,比如2222,/etc/ssh/sshd_config然后用sudo service ssh --full-restartcommond重启ssh服务,就可以登录成功了,不知道是什么原因。
我也尝试将其用作 VisualGDB 的 Visual Studio 的远程 gdb 服务器,但效果不佳。VisualGDB 将在下个版本支持,如官网所示。链接为https://sysprogs.com/w/forums/topic/visualgdb-with-windows-10-anniversary-update-linux-support/#post- 9274
小智 40
端口 22 不起作用,因为 Windows 带有内置的 SSH 服务器。
Windows 10 带有一个 SSH 服务器,它要么需要被禁用,要么需要更改用于 WSL 上的 SSH 的端口。我选择了后者,并为 WSL SSH 使用端口 2200。
来源:https : //virtualizationreview.com/articles/2017/02/08/graphical-programs-on-windows-subsystem-on-linux.aspx
| 归档时间: |
|
| 查看次数: |
130960 次 |
| 最近记录: |