2

I access my Unix server via ssh and I always do the same commands. This is the list of commands (first I login to the server):

  1. cd /etc/openvpn
  2. vi log.log
  3. /huaze (I'm using search function of vi)
  4. If I found the string / word I then proceed to step 5-up to end, (if I didn't find the string, I just log out)
  5. :q (exiting vi)
  6. service openvpn stop
  7. service openvpn start
  8. Log off

As you can see, I want to harness the power of automation and I can accomplish this with a click of a button; unfortunately this is challenging since it's ASP.NET and C# is going to access a Unix ssh protocol. So, how can I accomplish this in the most straightforward way.

1
  • Why do you want to do this through ASP.NET? Why not do it from the Windows command line or from a Console program? Commented Apr 7, 2012 at 19:36

1 Answer 1

1

I haven't tried this myself, but it seems the SSH .NET library should give you the tools you need to SSH into any host, execute commands, and read the results. It shouldn't matter whether the host is Linux.

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

Comments

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.