SSH from powershell using SSH.Net

This topic contains 5 replies, has 3 voices, and was last updated by Profile photo of Sean Quinlan Sean Quinlan 1 year, 9 months ago.

  • Author
    Posts
  • #22476
    Profile photo of Tapish Desai
    Tapish Desai
    Participant

    Hey guys,

    I just started using the SSH module within powershell to ssh into a linux server. I am able to ssh and view my home directory but can't go any further. Meaning, the cd command does not produce any result. It just runs and gives me an empty result.

    Any help is appreciated.

    Thansk!

  • #22478
    Profile photo of Don Jones
    Don Jones
    Keymaster

    That's something in how the Linux server, or its SSH server, is configured. Not PowerShell. Also, you don't mention what SSH module you're using. There isn't a native one for PowerShell... but, if it's connecting, then the module is also doing its job. Your problem is on the server – likely, whatever account you're using doesn't have permissions, or the SSH daemon is configured to lock you into your home directory.

  • #22492
    Profile photo of Tapish Desai
    Tapish Desai
    Participant

    It is an SSH module that's derived from the SSH.Net library, I imported the files which I found on this website:
    http://www.powershelladmin.com/wiki/SSH_from_PowerShell_using_the_SSH.NET_library#Enter-SshSession_Help_Text

    I don't think there is a issue with the linux server as I can interact with it when ssh'ing from Putty. It could be the way I am using the associated cmdlets for this module. Not entirely sure though.

  • #22493
    Profile photo of Don Jones
    Don Jones
    Keymaster

    I don't have enough familiarity with the module to tell you one way or the other. It'd be a good idea to contact its authors, if you can. Sorry.

  • #22494
    Profile photo of Tapish Desai
    Tapish Desai
    Participant

    Not a problem. Thanks anyway!

  • #22498
    Profile photo of Sean Quinlan
    Sean Quinlan
    Participant

    By default the "cd" command in Linux does not produce any output if it's successful. It can sometimes change your prompt if your shell is configured for that.

    However when you look at the screenshots from where you got the module, they also perform a CD command and it never changes the prompt. So it appears that the "prompt" given by this module does not change based on your current location.

    Try "pwd" to check your location after changing directory.

You must be logged in to reply to this topic.