35
6
Long-time reader, first-time question-asker.
I followed the instructions in this answer:
How can I SSH into “Bash on Ubuntu on Windows 10”?
I'm attempting to SSH from PuTTY in Windows on the same machine. Using Port 22, which matches my config file. Tried both 127.0.0.1 and 127.0.1.1. However, I'm still getting "access denied":
Ultimately I'm hoping to set up a Visual Studio remote build, but I've been thus far unable to get in remotely at all. What next steps should I take?
Process Hacker shows this for port 22 (not sure what this means):
Here are the contents of /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
An "Access Denied" means you are providing the incorrect password to the account
base1
– Ramhound – 2016-09-12T14:26:50.2031I'm definitely not providing the incorrect password. I've changed it and retried a few times just to make sure. – Basel Alghanem – 2016-09-12T14:32:07.027
Did you try looking around?
– Matt Clark – 2016-09-12T14:37:56.5771I absolutely did try looking around, for a couple hours this morning. Unfortunately I'm generally unknowledgeable in this area. I tried commenting out the line as suggested in an answer, and that didn't help. Do you think trying key-based auth might work? – Basel Alghanem – 2016-09-12T15:09:50.177
Update: When I ssh into 127.0.0.1 or 127.0.1.1, I am able to log into Windows using my Windows credentials. I'm thinking maybe I need to use a different port because 22 is being used by Windows? – Basel Alghanem – 2016-09-12T16:27:02.127
If you used key-based authentication, and it works, then its an authentication problem. If you change the port, and it works, then you still have authentication problem – Ramhound – 2016-09-12T16:36:33.360
1Switched to port 2200 (line 5 in sshd_config) and was able to successfully log into WSL. I guess Windows was using port 22 so Linux couldn't? Additionally, sshd showed up in Process Hacker as listening to port 2200, where it didn't show up at all before. Do I submit this as an answer to my question? – Basel Alghanem – 2016-09-12T16:40:57.530