-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Powershell default ssh shell in Windows #90
Comments
Rather this should be configurable and not statically set. I'd prefer it to be opened in cmd as my profile.ps1 is pretty heavy. |
this can be solved by adding
or |
@aduzsardi using |
Is there workaround for getting sftp work when powershell is the default ssh shell? |
We couldn't find a perfect solution. Here is our current proposal,
Issue with this proposal, We would like to hear from the community, alternative proposals or any suggestions.. |
Anything that can be done to make powershell the default will be good for me, but I wonder how the SSH shell from an user environment variable will get set... I usually set environment variables in my user profile, but the won't get executed until powershell starts... |
Looks like powershell.exe from powershell core is not signed by Microsoft (at least beta 4), so does that mean it would have to be installed under system32 to work with OpenSSH? What does "trusted" mean in this context? In the past Microsoft has considered "Program Files" locations more trustworthy than user writable locations because it takes admin permissions to place something there. |
The intention here is address the security concern around "sshd launching malware injected arbitrary session process". Sticking with cmd.exe keeps it plain simple. Otherwise we are trying to understand if there are any specific requirements mandating Powershell by default (apart from the convenience aspect). I see a drawback - its difficult to adjust Powershell session prompt (PS:>) to make it identify a remote session (like we do for cmd.exe). BTW, Powershell could be launched straight away as follows |
@manojampalam was there an update to support this? |
Git server does not work properly if cmd is the default (#752). |
@Scrxtchy please open a new issue for what you are seeing. That's not expected (I don't see it on my end). Fill in the template and we'll take it forward. |
Can't you set the COMSPEC variable to powershell.exe and use that? (I admit that I left Windows behind before the switch to NT/XP, so this may be outdated knowledge) |
@Rondom - Using COMPSPEC variable is not ideal solution. There can be a situation where the default shell has to be PowerShell for ssh sessions but other applications still needs the default shell as cmd.exe.. As mentioned earlier one of our proposals is to use a new environment variable instead of COMPSPEC. Also we need to add few security checks when we start using environment variables as any malware can modify the environment variable thus causing a security threat. |
If there is such a use case (which one?), wouldn't it be enough to instruct those users to write their own wrapper that checks whether it is run in an SSH-session and put it into their profile? |
Is there any workaround to get Powershell as default shell without breaking things like SFTP? All I can see as a solution for now is to prepend every command in our automation scripts at work with powershell.exe. This is not very ideal though. We typically execute single commands in an automated fashion with |
What about a flag to indicate whether or not it is an interactive session. For example in linux, I can place a stanza at the top of my
|
No description provided.
The text was updated successfully, but these errors were encountered: