vvavepacket
vvavepacket

Reputation: 1929

Automation of Unix server by SSH using ASP.NET

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.

Upvotes: 2

Views: 1447

Answers (1)

StriplingWarrior
StriplingWarrior

Reputation: 156708

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.

Upvotes: 1

Related Questions