Skip to content
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

Fixed remote powershell permission denied with cygwin ssh. #172

Merged
merged 1 commit into from
Jun 22, 2016
Merged

Fixed remote powershell permission denied with cygwin ssh. #172

merged 1 commit into from
Jun 22, 2016

Conversation

tperryba
Copy link
Contributor

@tperryba tperryba commented Apr 5, 2016

Found a bug during running a remote powershell command that did Get-DnsServerZone and Add-DnsServerResourceRecord commands via cygwin ssh
that returned permission denied. Created a test app with just sshj and found that sshj worked fine, and after stepping through the code,
I found that it appeared that the startProcess commands would run on session 1 vs session 0, which should
have been the SFTP connection session. Found if I moved the sharedSftpClient = connectSftp() to the getSharedSftpClient() instead of the
connect the issue was resolved and the powershell seemed to work as expected and how it works under WinSSHD.

Additionally it seems that you would not want to start two connections anyway, unless they were going to be used, if one does not use any of
the file commands, but just executes a process the additional connection is not needed.

I have tested using SFTP prior to and after startProcess and see no adverse affects to the move, yet it now seems to work as expected.
This change was testing in the 4.2.1 release and the 4.3.1-snapshot with WinSSHD and CygwinSSH

Found a bug during running a remote powershell command that did Get-DnsServerZone and Add-DnsServerResourceRecord commands via cygwin ssh
that returned permission denied.  Created a test app with just sshj and found that sshj worked fine, and after stepping through the code,
I found that it appeared that the startProcess commands would run on session 1 vs session 0, which should
have been the SFTP connection session.   Found if I moved the sharedSftpClient = connectSftp() to the getSharedSftpClient() instead of the
connect the issue was resolved and the powershell seemed to work as expected and how it works under WinSSHD.

Additionally it seems that you would not want to start two connections anyway, unless they were going to be used, if one does not use any of
the file commands, but just executes a process the additional connection is not needed.

I have tested using SFTP prior to and after startProcess and see no adverse affects to the move, yet it now seems to work as expected.
This change was testing in the 4.2.1 release and the 4.3.1-snapshot with WinSSHD and CygwinSSH
@vpartington vpartington merged commit d403ef5 into xebialabs:master Jun 22, 2016
@vpartington
Copy link
Contributor

Thank you for your PR!

Regards, Vincent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants