Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Help with Renci SSH tool

$
0
0
Hi All

I'm totally new with SSH and Renci specific.
I am looking for basic help and support in order to execute commands on Unix terminal.
I can execute simple ones like : "ls -ltr" or "pwd" , but when need to "cd /nfs/proj" .. or executing a perl script .. it just wont do .. :-(

The code i'm using -

Dim sshkey As New Renci.SshNet.PrivateKeyFile(System.Configuration.ConfigurationManager.AppSettings("SSH2key"))
    Dim conn2 As New Renci.SshNet.PrivateKeyConnectionInfo(modSSHHostName, modSSHUserName, sshkey)

    Dim sshClient As New Renci.SshNet.SshClient(conn2)

    'Need to hold the command
    Dim cmd As Renci.SshNet.SshCommand

    Using sshClient
        'connect to the server
        sshClient.Connect()

        'Run the command and put the results into the cmd object. In this case
        'I am just running a directory list
        cmd = sshClient.CreateCommand("chdir /nfs/iil/proj")
        cmd.Execute()
        MsgBox(cmd.Result)

        'Close the connection.
        sshClient.Disconnect()
    End Using

Please assist me as much as you can , thanks in advance.

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>