LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   What is my SSH user password in Windows 10? (https://www.linuxquestions.org/questions/linux-networking-3/what-is-my-ssh-user-password-in-windows-10-a-4175626002/)

rokyo 03-21-2018 03:02 AM

What is my SSH user password in Windows 10?
 
Hi everybody!

I just installed the SSH server on Windows 10 according to this guide: https://www.ctrl.blog/entry/how-to-win10-ssh-service

Then, I tried to login from my laptop (which is on the same network and connected to the same physical switch as the Windows 10 machine) with the command:

Code:

ssh -p 22 rok@xxx.xxx.xxx.225
where rok is the name of my user's folder in Windows 10 and xxx.xxx.xxx.225 is the IP of the Windows 10 machine (the IP of the laptop from which I try logging in is xxx.xxx.xxx.236).

However, on the Windows 10 machine I don't use a local account but rather login with my Microsoft account (i.e. rokyo@live.com).

Now, when I try to SSH into the Windows 10 machine, which password and which username do I use? Is my username for SSH also 'rokyo@live.com' (with the according password) OR is it 'rok' (like my user's folder in Windows 10) and if yes which password does it have?

I actually tried logging in via:

Code:

ssh -p 22 rok@xxx.xxx.xxx.225
using the password of my Microsoft account and via:

Code:

ssh -p 22 rokyo@live.com@xxx.xxx.xxx.225
using the password of my Microsoft account but both just said:

Quote:

Permission denied, please try again.
So, what do I actually have to use as username/password for SSHing into Windows 10??

I'm quite confused.

Thanks in advance for any help!


-------------------------------------
SOLUTION:

Found the solution to my problem here: https://github.com/PowerShell/Win32-...-Win32-OpenSSH in case anyone else has this problem. ;)

pan64 03-21-2018 03:08 AM

Quote:

rokyo@live.com@xxx.xxx.xxx.225
is probably syntactically incorrect. Use -l <user> instead.
I don't know what will windows accept as username, but I would try: rokyo, rokyo@live.com.
And if nothing works I would also try to create a local account (just to check).

rokyo 03-21-2018 03:17 AM

Quote:

Originally Posted by pan64 (Post 5833536)
is probably syntactically incorrect. Use -l <user> instead.
I don't know what will windows accept as username, but I would try: rokyo, rokyo@live.com.
And if nothing works I would also try to create a local account (just to check).

First of all: Thanks for the quick reply! :)


I just tried all those combinations and none worked.

Also, I switched from logging in with MS account to local account on the Windows 10 machine and explicitly set username and password as 'rokyo' and 'password' (not the real password, of course ;)).

When trying to SSH into the machine, connection still doesn't happen. No matter if I use

Code:

ssh -p 22 -l rokyo xxx.xxx.xxx.225
or

Code:

ssh -p 22 rokyo@xxx.xxx.xxx.225
with 'password'...

I think the SSH server on the Windows machine might not be configured and/or working correctly?

Turbocapitalist 03-21-2018 03:20 AM

The fork of OpenSSH to Windows is not guaranteed to work. There are many pieces that have not been ported yet and probably quite a few that won't or can't be ported. But if you are still insisting in running Vist10 on bare metal that machine, then you would be better served asking at one of the many Windows forums.

If you really are interested in getting a working SSH server on that hardware, then back up your data, wipe the hard drive, install GNU/Linux with OpenSSH-server, and then put Vista10 into a virtual machine, such as VirtualBox or Qemu, and restore your Windows data into the virtual machine. If you make an extra disc partition you should, in theory, be able to get the Vista10 virtual machine guest to access that partition on the host from the virtual machine. Then your virtual machine's host system would also be able to access that same partition, even when you connect via SSH.

pan64 03-21-2018 03:22 AM

yes, probably, or it is a firewall related issue.

rokyo 03-21-2018 03:30 AM

Quote:

Originally Posted by pan64 (Post 5833545)
yes, probably, or it is a firewall related issue.

Could be! I just realized that I cannot even ping the Windows 10 machine from my laptop...

But my Windows firewall rules explicitly state that port 22 is open for business: https://imgur.com/FEFOfXi

Also, when I try to ping the Windows 10 machine, I get nothing:

Code:

>ping xxx.xxx.xxx.225
>PING xxx.xxx.xxx.225 (xxx.xxx.xxx.225) 56(84) bytes of data...

It just stays like that no matter how long I leave it to run, BUT: when I leave the ping command running and then reboot the Windows 10 machine, the ping response changes to:

Code:

>From xxx.xxx.xxx.225 icmp_seq=1902 Destination Host Unreachable
>From xxx.xxx.xxx.225 icmp_seq=1903 Destination Host Unreachable
>From xxx.xxx.xxx.225 icmp_seq=1904 Destination Host Unreachable
>From xxx.xxx.xxx.225 icmp_seq=1905 Destination Host Unreachable

until the Windows 10 machine has finished rebooting. Then it goes back to nothing... ?

rokyo 03-21-2018 03:31 AM

Quote:

Originally Posted by Turbocapitalist (Post 5833542)
The fork of OpenSSH to Windows is not guaranteed to work. There are many pieces that have not been ported yet and probably quite a few that won't or can't be ported. But if you are still insisting in running Vist10 on bare metal that machine, then you would be better served asking at one of the many Windows forums.

If you really are interested in getting a working SSH server on that hardware, then back up your data, wipe the hard drive, install GNU/Linux with OpenSSH-server, and then put Vista10 into a virtual machine, such as VirtualBox or Qemu, and restore your Windows data into the virtual machine. If you make an extra disc partition you should, in theory, be able to get the Vista10 virtual machine guest to access that partition on the host from the virtual machine. Then your virtual machine's host system would also be able to access that same partition, even when you connect via SSH.

I would actually love to do that, but it's a work machine and my boss won't allow it to run Linux... :-/

However, he still wants us to be able to remote SSH from home into our work machines... which seems impossible with the current state of the Windows 10 SSH implementation? :(

Turbocapitalist 03-21-2018 03:37 AM

Quote:

Originally Posted by rokyo (Post 5833549)
I would actually love to do that, but it's a work machine and my boss won't allow it to run Linux... :-/

No problem. There's also FreeBSD and OpenBSD. If you try FreeBSD, then the distro TrueOS does most of the configuration of desktop niceties for you. Because TrueOS is FreeBSD it is very simple to ensure a working SSH server.

Otherwise, you'll need to repair your boss' lack of knowledge.

In the mean time, I hope you are billing him sufficiently for his ridiculous request for networked software on Vista10 and letting him know he is asking you to try to squeeze blood from a turnip. Or, since this is Vista10 in question, from a turd.

Again a Windows forum might be the best place to ask about Windows problems.

rokyo 03-21-2018 03:41 AM

Quote:

Originally Posted by Turbocapitalist (Post 5833555)
No problem. There's also FreeBSD and OpenBSD. If you try FreeBSD, then the distro TrueOS does most of the configuration of desktop niceties for you. Because TrueOS is FreeBSD it is very simple to ensure a working SSH server.

Otherwise, you'll need to repair your boss' lack of knowledge.

In the mean time, I hope you are billing him sufficiently for his ridiculous request for networked software on Vista10 and letting him know he is asking you to try to squeeze blood from a turnip. Or, since this is Vista10 in question, from a turd.

Again a Windows forum might be the best place to ask about Windows problems.

I'm sure when I explain to my boss that SSH won't work, he'll make me install Teamviewer or something like that... :(

Maybe I should just bring a private computer (with Linux on it) to work and SSH into that. ;)

pan64 03-21-2018 03:41 AM

If I remember well you can install cygwin onto windows and use its ssh server, do not need to drop win10.
about post #6, it looks like a firewall or something similar (probably and antivirus sw?)
you can try to reach port by: telnet host port

rokyo 03-21-2018 03:46 AM

Quote:

Originally Posted by pan64 (Post 5833559)
If I remember well you can install cygwin onto windows and use its ssh server, do not need to drop win10.
about post #6, it looks like a firewall or something similar (probably and antivirus sw?)
you can try to reach port by: telnet host port

Using

Code:

telnet xxx.xxx.xxx.225 22
gets me:

Code:

>Trying xxx.xxx.xxx.225...
>Connected to xxx.xxx.xxx.225.
>Escape character is '^]'.
>SSH-2.0-MS_1.100

and a blinking cursor under that last line. When I type anything at that point (including just pressing ENTER) it goes:

Code:

Connection closed by foreign host.
and back to my regular bash prompt.

pan64 03-21-2018 04:19 AM

that means you were connected to the ssh server (that was the message: SSH-2.0-MS_1.100), so in general you can connect, but you cannot authenticate.

sundialsvcs 03-21-2018 08:10 AM

Quote:

Originally Posted by rokyo (Post 5833549)
However, he still wants us to be able to remote SSH from home into our work machines... which seems impossible with the current state of the Windows 10 SSH implementation? :(

I would explain your difficulties to him and ask your company's IT Department to sort the issue out for you. This is their stuff and their responsibility, legal and otherwise. So, "put the monkey on their back, where it properly belongs."

Furthermore, I would recommend that your company use OpenVPN with tls-auth, not ssh, as your means of securing access to the company machines. Individual laptops are issued unique digital certificates, any one of which can be individually revoked. And the company's OpenVPN server cannot be detected, as I describe at length in my blog here. It is quite-literally a secret door.

You very quickly get used to: "Number of unauthorized access attempts: Zero."

Users simply "open the tunnel," giving them access to other things including Microsoft networking, remote logins and so on. Effectively, when the tunnel is open, "they are present on the company's internal network." They don't have to consider that OpenVPN is anything more than just another network router. But everything that passes along the Internet wire is very securely encrypted, and there's no way to get to the other side except through the tunnel. Should any particular laptop be stolen, its credentials can be made to "drop dead" without affecting anyone else's. (Password-encryption of the key materials is an optional, additional feature, good for "keeping the honest people out.")

Delcaran 03-21-2018 09:12 AM

Working SSH servers for windows are MobaXterm and FreeSSHd, both free.

rokyo 03-21-2018 09:24 AM

Quote:

Originally Posted by sundialsvcs (Post 5833629)
I would explain your difficulties to him and ask your company's IT Department to sort the issue out for you. This is their stuff and their responsibility, legal and otherwise. So, "put the monkey on their back, where it properly belongs."

Furthermore, I would recommend that your company use OpenVPN with tls-auth, not ssh, as your means of securing access to the company machines. Individual laptops are issued unique digital certificates, any one of which can be individually revoked. And the company's OpenVPN server cannot be detected, as I describe at length in my blog here. It is quite-literally a secret door.

You very quickly get used to: "Number of unauthorized access attempts: Zero."

Users simply "open the tunnel," giving them access to other things including Microsoft networking, remote logins and so on. Effectively, when the tunnel is open, "they are present on the company's internal network." They don't have to consider that OpenVPN is anything more than just another network router. But everything that passes along the Internet wire is very securely encrypted, and there's no way to get to the other side except through the tunnel. Should any particular laptop be stolen, its credentials can be made to "drop dead" without affecting anyone else's. (Password-encryption of the key materials is an optional, additional feature, good for "keeping the honest people out.")

Thanks for the info! I'll check out the blog when I get back home! ;)


BTW, I found this guide here https://github.com/PowerShell/Win32-...-Win32-OpenSSH which solved my original issue. But the openVPN way sounds even better, I'll check that out, too!


All times are GMT -5. The time now is 10:45 PM.