Score:0

Connect remote machines via SSH to command prompt

vg flag

I created an SSH connection between my machines, and then i set on one of them a PowerShell command telling windows to provide the PowerShell console when a distant machine connects to the current via SSH and that automatically and by default, (i don't remember the command i used)

Now i want to cancel that so that when i ssh to my machine it gets me to the command prompt (and not PowerShell)

Anybody knows the canceling command ?

Score:0
cn flag
Bob

The usual method to configure what a user sees when they connect via SSH to an SSH server is to set/change the "default shell" or "default command shell".

According to the manual in Windows that can be done with the following PowerShell command:

New-ItemProperty -Path "HKLM:c:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

The example above from the manual sets the default shell to be powershell.exe

Restore that back to the initial Windows default which is the Windows Command shell (cmd.exe)

New-ItemProperty -Path "HKLM:c:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\cmd.exe" -PropertyType String -Force

Another method is to leave the default shell unchanged and to configure that default shell to run a different command on start-up. How and if that is the case depends on what your default shell is currently set to.

For example if you configured bash as your default shell, then you could have modified your .bashrc to start "powershell.exe" on login.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.