Quantcast
Channel: SSH.NET Library
Viewing all 2955 articles
Browse latest View live

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
Ah, that's a shame as I want to log into an ssh session and pass multiple db2 commands based on an original db2 query. I can do it and store it in a variable but it means multiple log ins and this is around 200 statements.

Shame, I wonder if there are any other ssh projects for vb.net that keep the session open. Do you know any?

Thanks for your help already though

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
You understand me wrong. My solution works fine for your question.
You don't have to relogin for every command.
Open the session, login and run your commands.
But if your commands need the same shell context you have to combine them in one command or use a ShellStream.

If you want to talk to a database, why do you need the same shell for the commands?
Why not forward your database with port forwarding and talk to the database directly
instead of invoking shell commands?

Closed Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: Solution provided in comments.

Commented Unassigned: Exists function returns always true for any file [1952]

$
0
0
See attached test source. Some old version of ssh.net worked fine.
Comments: ** Comment from web user: drieseng **

SftpClient.cs:

public bool Exists(string path)
{
CheckDisposed();

if (path.IsNullOrWhiteSpace())
throw new ArgumentException("path");

if (this._sftpSession == null)
throw new SshConnectionException("Client not connected.");

var fullPath = this._sftpSession.GetCanonicalPath(path);

try
{
_sftpSession.RequestLStat(fullPath);
return true;
}
catch (SftpPathNotFoundException)
{
return false;
}
}

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
Hi da_rinkes,


I have a similar problem how can i access the SSHCLIENT in my C# different forms.

Am i supposed to open new connection in each form, or how that works please help me.

Thanks,
Avinash

Commented Unassigned: Exists function returns always true for any file [1952]

$
0
0
See attached test source. Some old version of ssh.net worked fine.
Comments: ** Comment from web user: spidercode **

Ok thank you @drieseng for providing the updated modifications.

Commented Unassigned: Exists function returns always true for any file [1952]

$
0
0
See attached test source. Some old version of ssh.net worked fine.
Comments: ** Comment from web user: spidercode **

In which version it will be updated ? or Is it possible for you to consider this changes in the current beta version ?

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
avinashav wrote:
Hi da_rinkes,


I have a similar problem how can i access the SSHCLIENT in my C# different forms.

Am i supposed to open new connection in each form, or how that works please help me.

Thanks,
Avinash
Your problem is that you are missing basic C#, .Net and WindowsForms knowledge.
I can't help you here, since I'm not a teacher. And your problem has nothing to do
with SSH or SSH.NET. And please stop spamming the Issues and Discussions.
I think stackoverflow.com should work perfect for you.

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
avinashav,

I understand your problem. But your question (without knowing what you are trying to do) sounds almost like:

Q: "How do I build a house?"

I mean, Renci is like a wrench in your toolbox as you build the house, and the rest of the house is the C# form. With Renci being alibrary, it is more like a tool, just like visual studio is a tool. You can't run visual studio and doanything, but you can make an application that does.

So think of libraries, includes/imports, DLLs, etc. as nothing more than tools, or even blueprints to build your house (application). If you have not built many houses, you might not be sure just yet that SSH.NET is even the tool you need, as there are others you can use.

Building a house from scratch, in visual studio, is not hard, but it takes time for a learning curve, and time to actually write, test, etc. to make sure it meets your original requirements. For some like me, the act of figuring out which tools work best, and even doing more that you thought possible with tools you learn about, is thefun (yes, fun!) of programming.

If you are where you seem to be with programming, then you have a lot of great times ahead of you! If you are a very new beginner, start with the free tutorials on MSDN/Microsoft site, or sometimes the 'trails' that take you on a learning curve, or like me just buy all the books on the subject and mark hem up in pen & marker!

If, however, you are not new to programming, thenstackoverflow.com is a good place to post your question, and see what comes up from searching as well.

I hope you see why asking the forum that makes a hammer how to use it to build a house might be more difficult for us to help you with, and asking on a forum where they build applications like the one you seek to create would be a better use of your time.

However, once your application is in process, and you are trying to accomplish somethingSSH.NET should be able to do per it's docs, or other forum posts here & elsewhere, and you can't make it work like you think it should, then that question will be much easier to answer here.

I hope this isn't seen as a negative post, but a positive one trying to save you frustration and get you to where you will find the answers you seek.

Sound good?

Thanks!

pat
:)






New Post: SSH-2 private key

$
0
0
I need to connect using sftp utilizing private key.
The key file is created using SSH-2 client.
I get "Invalid private key file." error message.

I just want to confirm if SSH-2 keys are supported!!
if not, are you aware of any open source library that support the use of SSH-2 generated keys?
Here is how the header of the key looks like..

---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----
Comment: "[2048-bit dsa,

and it ends with (showing last part of the encrypted key as well) :
sPhKT5RRC1HrFpK4GzMDgRv3+z5pRf+rPV+FT71busXPnsFIJ54t7xQcGCuzPvCS0myyMQ
AIdA==
---- END SSH2 ENCRYPTED PRIVATE KEY ----

Thank you.

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
Hi BogusException,

Thanks alot for your concern, really your response is a positive boost for me.

I am new to programming, was bit confused..!!!

Thanks alot, I will use those websites for learning.

Thank you very much, :)

Really I was upset by da_rinkes response. :(

Regards,
Avinash.

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
Yeah, right. I'm the bad boy here, telling you the truth and also helped you with some basics... how unfriendly, I'm a really terrible person! :/
Trying to hijack threads, open issues and discussions with the same text, including pasting my example code... and now you are upset. whao

BogusException: Wish you good luck here, with this kindergarten! I won't answer anything here the next time.

Created Unassigned: How to read linux cmd output all lines [1963]

$
0
0
Hi,

I am using SSH.Net library to connect linux server and executing some cmds. I am trying to read the out put of the command like below.. but it is returning only first row of the result. If I ran the same cmd in linux directly i will get multiple rows result. Please help to fix my code.

var cmd = ssh.CreateCommand("mycmd"); //It is a linux shell script it ran and gives output
var asynch = cmd.BeginExecute(delegate(IAsyncResult ar)
{
Response.Write("Finished.");
}, null);
var reader = new StreamReader(cmd.OutputStream);
while (!asynch.IsCompleted)
{
var result = reader.ReadLine();
Response.Write(result);
if (string.IsNullOrEmpty(result))
continue;

}
cmd.EndExecute(asynch);

Source code checked in, #35472

Closed Unassigned: Maintain connection through different forms [1961]

$
0
0
I am using :

client = new SshClient(res.host, int.Parse(res.port), res.user, res.password);
_client.connect();

in __FORM1__

after successful authentication I want to execute commands in __FORM2__:

Just like : _client.RunCommand("touch newfile1");


but the error is sshclient is not present in this form.

my question how to maintain a __single authentication through out different forms.__
Comments: This is beyond the scope of this project, but I think you got some constructive feedback from BogusException in the discussions forum.

Good luck!

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
@da_rinkes:
I'd hate to lose you over this, and I'm sure all members of this little community share this feeling.
Please contact me if you want to discuss this further.

New Post: VB.NET Framework 3.5 and Renci ssh - keep session open

$
0
0
Wow guys, come on, let's not get out of hand here, it's a forum where people's words can be taken out of context quite easily.
@avinashav... Don't get upset over the simplest thing or you'll never do well on forums. Your question was quite vague and I'm not sure how it fit with my original question as you haven't even got your form to use the ssh yet! Start a new thread for things like that.

@da_rinkes... You gave me some great advice and I've used the shellstream command now to great effect, it does what I'm after and much more! It sounds like you give great advice and I'm very grateful for the help you have given me on this. Thank you!

I do have a follow up question... Rather than the thread.wait, is there a way to wait for a command to come back? I'm presuming not but I'm very hopeful I've missed something and there is a command to wait for a response.

Thanks again guys

Source code checked in, #35478

$
0
0
Renamed ChannelAsyncResult.cs to CommandAsyncResult.cs to match name of class. Removed command argument from CommandAsyncResult as its never used.

Source code checked in, #35479

Source code checked in, #35480

$
0
0
Also create source zip file as part of build.
Viewing all 2955 articles
Browse latest View live


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