0

We are trying to pass commands or shell scripts execution to Linux server from ASP.net.

For example, if we pass command ls from ASP.NET to Linux server, then it must provide a list of files present in the respective path to ASP.NET as output.

Can anyone share the idea how we can achieve this?

2
  • Have you used Ant or NAnt (the .NET equivalent)? It is a cross-platform (portable) scripting language which allows you to write XML "build" files which are just a series of commands. You can use .NET or Java to define custom "targets" which allow you to do many powerful things. You can't directly call OS shell commands but you can do many of the things common accross all OS (e.g. list a directory's contents a.k.a ls). Check it out, it may help you out... Commented Jan 24, 2013 at 17:49
  • possible duplicate of calling unix shell script from c# apparently SharpSSH will do it Commented Jan 24, 2013 at 18:05

2 Answers 2

1

telnet and other remote shell protocols are there for this.

Note: without proper security considerations it is very dangerous idea.

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

Comments

0

If you only need to access to the file system, consider using Samba. You can mount the remote file system to the Windows machine.

Another possibility is to access the files through FTP.

2 Comments

That would answer the question How do I get a list of files on a server?. Not the title question How to pass commands/scripts to Linux servers from ASP.NET?
You are right, but we don't know the OP's intentions - why they want to do this. From the example I assumed that they need access to the file system. My answer will be a solution if they don't want to execute arbitrary executables (which may impose security problems).

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.