SSH from powershell using SSH.Net

Welcome Forums General PowerShell Q&A SSH from powershell using SSH.Net

This topic contains 5 replies, has 3 voices, and was last updated by

 
Participant
3 years, 8 months ago.

  • Author
    Posts
  • #22476

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 3
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 3
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    Not a problem. Thanks anyway!

  • #22498

    Participant
    Points: 0
    Rank: Member

    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.

The topic ‘SSH from powershell using SSH.Net’ is closed to new replies.