1

Using C#, I need to send a date command to set the time on a linux system.

How can I connect to this system and send this command in code?

What library can I use to do this?

Update: I'm really looking for a free solution, thank you...

6
  • what is listening on the linux system ? Commented Apr 6, 2011 at 10:29
  • Do you want to do this locally, or remotely send the command? Commented Apr 6, 2011 at 10:30
  • @Felice Pollano - I don't understand your question. I'm just connecting as root on the system. Commented Apr 6, 2011 at 10:35
  • @ kyndigs - the linux system is a remote computer Commented Apr 6, 2011 at 10:36
  • @Julien I suppsed you where on an external system running windows and you need to call a command remotely on linux Commented Apr 6, 2011 at 10:42

4 Answers 4

4

I suggest using the SharpSSH library: http://sourceforge.net/projects/sharpssh/

Sign up to request clarification or add additional context in comments.

Comments

1

You could use ChilkatDotNet components to ssh/telnet to your linux box, and run the command - otherwise you would need a client app to sit and listen.

http://www.chilkatsoft.com/downloads_DotNet.asp

Comments

0

You need some SSH component for .NET to access the remote system. There are plenty on the market, from free (and outdated) SharpSSH to our SSHBlackbox.

8 Comments

@Eugene: Please back your statement about SharpSSH being outdated with a link or some other sort of info. A short google search didn't turn anything up...
@Daniel tamirgal.com/blog/page/SharpSSH.aspx , "SharpSSH is now hosted on sourceforge. Latest SharpSSH version is 1.1.1.13 (Jun-24-2007)" , sourceforge.net/projects/sharpssh/files/SharpSSH/1.1.1.13
@Eugene: Has the SSH protocol changed since 2007?
@Daniel the protocol, implementations ... While you might find that SharpSSH works with some set of servers, it will either fail or misbehave on newer versions of SSH servers. Ensuring compatibility with various SSH servers is aiming a running target and without constant updates SSH/SFTP client becomes outdated quite fast.
@Eugene : I'm not going to pay over $200 just to send a single command. Besides, SharpSSH does the job very well :-)
|
0

Try to use Mono(http://mono-project.com/Writing_a_WebService). You can simply implement web service same way on Windows.

1 Comment

I can't make modifications to the linux system, barely just connect to it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.