$ sudo service ssh --full-restart
 * Stopping OpenBSD Secure Shell server sshd  
                                                                        [ OK ]   
 * Starting OpenBSD Secure Shell server sshd 

sshd: ../sysdeps/posix/getaddrinfo.c:2583: getaddrinfo: Assertion `(extension ({ const struct in6_addr *__a = (const struct in6_addr *) (sin6- >sin6_addr.__in6_u.__u6_addr32); __a->__in6_u.__u6_addr32[0] == 0 && __a->__in6_u.__u6_addr32[1] == 0 && __a->__in6_u.__u6_addr32[2] == __bswap_32 (0xffff); }))' failed. Aborted (core dumped)


You'll need to change a few things in the /etc/ssh/sshd_config file. Specifically,

UsePrivillegeSeparation No
PermitRootLogin Yes (only if your using root)
PasswordAuthentication yes

Privillege separation is probably the most important thing here. By default it's turned on and that causes OpenSSH to fail for some reason.

Can you try this command to restart the ssh service:

$ /etc/init.d/ssh restart

EDIT: You'll also want to add inbound rules to Windows Firewall that allow the ports that you are using for Bash. Go to Windows Firewall with Advanced Security, click on "Inbound Rules" in the left pane and select "Action-> New Rule" in the menu above. Then create a rule allowing incoming TCP connections on the port you want.

  • But when ssh localhost,permision deny.So I change the default port 22 to port 2222,then it works well.Do you known the reason?
    – nul lun
    Oct 15 '16 at 12:07
  • I've edited my answer, try see if it works now.
    – Simon L
    Oct 16 '16 at 20:22
  • My firewall allow incoming Tcp connection on the port 22.But when I use port 22, it says \'Permission denied, please try again.' while port 2222 is ok.
    – nul lun
    Oct 17 '16 at 1:47
  • Did you make sure that you have port 22 set in /etc/ssh/sshd_config? If you don't then add it and restart ssh. Also try running bash as administrator. The bash subsystem is tightly integrated with Windows 10 in terms of how it operates, so running it as a normal user might not allow it to bind ports.
    – Simon L
    Oct 18 '16 at 4:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.