Vijay
Vijay

Reputation: 384

Java/C#.NET on windows to execute linux operations

I have one application to write in C# (I can write that in Java as well) This application is basically accepts some information from user and using these information we are creating some files on Linux system (This is the idea)

Using what libraries I can achieve this ? Assumption: I do have credentials and access to the Linux machine.

What is the best way to do this ? How can I do this with .NET and Java ?

Application must be on Windows. Mostly application will be developed in ASP.net/C#.net/Java (only windows)

Some examples: 1. I will be creating a file say abc.rb on one linux server. 2. Execute a command e.g. sudo app-client or any other command like "service httpd restart"

Upvotes: 1

Views: 74

Answers (2)

NickJ
NickJ

Reputation: 9579

I can't say anything about C# or .NET, but I assume it can still be tackled in a similar way to how I'd do it in Java.

Can you install an FTP Server on the Linux box?

That way, you can use a FTP Client API on whatever language you use (there are some available for Java, such as Apache Commons-net). Firstly, I'd have my application create the files locally, based on user input, then the application will use the FTP client API to transfer them over to the Linux filesystem.

Upvotes: 0

Rytis I
Rytis I

Reputation: 1303

Looks like you can achieve everything with .NET. Just use ssh client to execute the commands on remote Linux machine. You could use this library http://sshnet.codeplex.com/

Upvotes: 1

Related Questions