SSH into Windows 10 Bash only gets into DOS shell not Bash - windows

I'm trying to ssh into windows 10 bash on my local machine.
When I do
ssh localhost I am prompted for my windows password and can then ssh into a DOS shell. How do I access bash from there?
The same occurs when I try to ssh from a cygwin terminal on another laptop on my home network. I am able to ssh into linux machines fine (from windows 10 bash)
Thank you!

When you enable Developer Mode you can see 2 new services are loaded on startup, SSHBroker and SSHProxy and they are bound to port 22. You can try disabling them and you should can do ssh localhost again.

Related

Powershell to connect to a remote linux ssh server and executing a command line

I have to connect from a Windows 10 / Windows Server 2016 machine to a Linux machine (CentOS) to execute a command to disable a server in haproxy. On a local Linux machine the command is sudo echo "disable server http/test1" | socat tcp:127.0.0.1:9191 stdio and it works. But I have to create a script / command line to let a Windows machine do the magic. I´ve tried powercat but it will not work. So I decide to use ssh client on the Windows machine. The command line is
ssh -l haproxy-user -i private.ppk 10.0.0.20 "sudo echo "disable server http/test1" | socat tcp:127.0.0.1:9191 stdio" but I didn´t get the option to enter the passphrase for my identy file. Or is there another option to execute the command line?

How to login into ssh on windows cmd prompt

I am trying to login into one of the ethernet ports on my development board on ssh from my Windows pc. But it is displaying a message like
'ssh' is not recognized as an internal or external command when i tried to loging into it using ssh root#192.168.4.14.
How to get ssh into my windows system?
I use Linux Bash on my windows to use ssh.
You can install it from your windows configurations. But I think it is only for Windows 10 64bits.
Or if you want, you can install git desktop application. From this you can use linux commands into the git bash.
You can use the below command in command prompt to initiate ssh session.
ssh -l username 192.168.1.1

How to get bash ssh server started from psexec or user-logon script in windows 10

I have a W10 machine with bash set up. If I open a cmd window and type bash -i I can get to a bash shell no problem. However, if I enter the W10 machine using psexec and the same user and type bash -i, everything just hangs.
I know I can and do use an Ubuntu ssh server to get in, but I can only do that if the Ubuntu ssh server is running. It only seems to run if there is at least one bash session active. I thought I could use the psexec entry as a backup and start the Ubuntu ssh server or do anything else, but from the psexec cmd window, I cannot get to bash. When I type bash -i everything hangs and I need to close the cmd window on the remote machine.
The same problem occurs if I use a windows ssh server. I can get to a cmd window, but everything hangs if I type bash -i.
I also tried the Windows task scheduler to try to start the Ubuntu ssh server at a user login, but that also just hangs.

Run Command on Multiple Macs from Server

I am trying to force shutdown multiple mac computers every night which are all connected to a server. I am unsure if the best way to do this is by running a sudo shutdown command through a for loop using IP addresses or ssh'ing. Or any other method. Any advice would be appreciated!
I don't know any better method than ssh.
Generate and install your ssh key on those macs in the root account, in the file /var/root/.ssh/authorized_keys2 of each of them,
Ensure each of your mac has the line "PermitRootLogin yes" uncommented in the file /etc/ssh/sshd_config, if not change it and relaunch sshd.
And finaly use ssh to run the shutdown command.
Here is the command line in bash shell :
for host in host01 host02 host03; do ssh root#$host "shutdown -h"; done

can not issue any command on freesshd server

I installed FreeSSHd server on my Windows XP machine. Then i started FreeSSHd and created a user. After that i runned Putty to connect my newly installed SSH server. I entered my created user name and password in putty. I successfully logged on but i couldn't execute any SSH commands with putty. Only HELP and DIR commands answer properly. Other SSH commands like LS, PWD, etc. returns error message such as "xxx command is an unknown command and can not be executed.".
My question is simple. How can execute SSH commands via Putty over FreeSSHd server on Windows machine. I want to simulate a file copy. I think i should execute SCP or PUT commands but i couldn't success.
Any ideas?
Commands like "ls" and "pwd" aren't "ssh commands", they're Unix commands. You'd expect for them to be available a Unix system (including Linux). MS Windows isn't a Unix system and doesn't provide those commands.
You can install these programs as third-party software if you like. Cygwin is a popular free package.

Resources