Windows 10 Linux Submodule SSH Anmeldung nicht möglich

1522
user2752635

Ich muss ein Linux-Submodul für ein Testsystem einrichten, das SSH in das Modul einfügt und Programme über die Remote-Shell ausführt. Zu diesem Zweck versuche ich, einen SSH-Daemon mit Publickey-Zugriff auszuführen. Das Problem ist, egal was ich tue, ich kann mich nicht einloggen. Bei jedem Versuch bekomme ich so etwas:

sampler@DESKTOP-RDJ0BBU:~$ ssh -p4203 sampler@localhost Sampler@localhost's password: Permission denied, please try again. Sampler@localhost's password: Permission denied, please try again. Sampler@localhost's password: Permission denied (publickey,password). sampler@DESKTOP-RDJ0BBU:~$ 

Ich weiß, ich gebe das richtige Passwort ein, und trotzdem kann ich mich nicht einloggen. Mein Konto ist ein Nicht-Administrator mit dem Namen "Sampler" und das Linux-Konto ist "Sampler" mit demselben Passwort. (Ich habe sowohl Groß- als auch Kleinbuchstaben 'S' ausprobiert).

Das ist mein /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 4203 # 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 # !chroot not yet implemented on windows! 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 Sampler 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 

Ich weiß, dass ich zumindest eine Antwort von meinem SSH-Dienst bekomme, denn wenn ich den Server mit deaktiviere, erhalte sudo service ssh stopich den Fehler ssh: connection to host localhost port 4203: Connection Refused.

Ich habe eine Kopie meines .ssh-Verzeichnisses in beiden, /home/sampler/und /mnt/c/Users/Samplerobwohl ich nicht glaube, dass dies das Problem ist, da mein Passwort auch nicht funktioniert.

Bearbeiten: Ich habe die Beiträge in diesem Thread bereits gelesen und wie Sie meiner Konfigurationsdatei entnehmen können, hat keiner von ihnen mein Problem gelöst.

0
Unter Submodular meinen Sie zufällig WSL, was für Windows Subsystem for Linux steht? Ramhound vor 6 Jahren 0
Mögliches Duplikat von [Wie man SSH in WSL einbindet] (https://superuser.com/questions/1123552/how-to-ssh-into-wsl) Ramhound vor 6 Jahren 2
Wenn Sie meine Konfigurationsdatei durchsehen, können Sie feststellen, dass ich bereits alles probiert habe und es hat nicht funktioniert. user2752635 vor 6 Jahren 0
Ich habe keine vollständige Analyse Ihrer Konfigurationsdatei durchgeführt. Ich habe das Problem gerade als gefragt erkannt. Ramhound vor 6 Jahren 0

1 Antwort auf die Frage

0
user2752635

Ich habe mein Problem gefunden. Beim Einrichten meiner zulässigen Benutzer habe ich Sampleranstelle des Unix-Namens den Windows-Benutzernamen eingegeben sampler.

# Authentication: LoginGraceTime 120 PermitRootLogin no AllowUsers sampler # <--- Here StrictModes yes 

Ich habe immer noch Probleme mit der Verbindung von externen Computern und öffentlichen Schlüsseln, aber dies scheint eine weitere Reihe von Problemen zu sein.

Markieren Sie dies als Ihre Lösung, damit die Leute nicht hierher kommen und versuchen, Ihr Problem zu lösen. Vielen Dank! var firstName vor 6 Jahren 0
Ich kann nicht noch zwei Tage. user2752635 vor 6 Jahren 0
Erwischt. Vielen Dank! var firstName vor 6 Jahren 0