Win32-OpenSSH icon indicating copy to clipboard operation
Win32-OpenSSH copied to clipboard

Request for sshrc support

Open cipherswami opened this issue 1 year ago • 4 comments

Summary of the new feature / enhancement

In UNIX implementation has local rc file in ~/.ssh and system wide sshrc fie in /etc/ssh, which runs when ssh'ed.

Proposed technical implementation details (optional)

Please implement a similar feature for Windows OpenSSH to use PowerShell as the default SSH shell, while still not effecting other sessions like SFTP, VS Code SSH server.

cipherswami avatar Oct 30 '24 10:10 cipherswami

Thanks for the issue @cipherswami! We have documentation on how to set up your default shell here, https://github.com/PowerShell/Win32-OpenSSH/wiki/DefaultShell, would this satisfy your scenario, or do you need more commands to be ran in the sshrc file?

Additionally, I am not sure how we could only use this for particular sessions since the sshrc seems to be a core feature for ssh and would affect any session.

StevenBucher98 avatar Nov 04 '24 18:11 StevenBucher98

@StevenBucher98 Thanks for helping me set the default shell.

I think the last time I didn't set "commandOption", hence it was interfering with sftp.

But still I request you guys to set PowerShell as default shell in future versions of win32-OpenSSH. And support for system wide sshrc file, would be great.

cipherswami avatar Nov 09 '24 10:11 cipherswami

my 2 cents. DefaultShell is per system. I did request to make this per user in https://github.com/PowerShell/Win32-OpenSSH/issues/1741

This could be one way of doing it

matsmcp avatar Nov 12 '24 07:11 matsmcp

Changing shell to PowerShell is not enough because in Windows all PowerShell scripts must have valid file name extension (e.g. .ps1). See https://github.com/PowerShell/PowerShell/issues/16480

anttiah avatar Mar 30 '25 09:03 anttiah