Click here to Skip to main content
15,886,052 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a unix server where some log files get stored on a daily basis.I have the host name and credentials to connect to that unix server.I need to connect to that unix server from my asp.net application and read\get those log files located in certain directory.Is it possible?
Currently,manually what we do is to connect to that Unix server using Secured CRT client.However I would like to do it from my asp.net application.

Kindly help.
Posted

1 solution

Hi,

There are a few options here, depending on your needs and the exact Unix environment. Here are some options that can hopefully get you started.

Option 1: Change the connection type
You may be able to set up a secure windows share (SMB) from the Unix server, that can be securely accessed like any other network share. If you tell me what flavor of UNIX you are using, I can point you in the right direction for that too.

Option 2: Connect using SSH components for .Net
There are a few SSH client components out there that you could use. Tamir Gal posted a great article on the subject:
sharpSsh - A Secure Shell (SSH) library for .NET[^]

Hope that helps!
 
Share this answer
 
Comments
Biraj Kumar Acharya 20-Apr-12 4:35am    
Hi Thanks for your help.
I tried to use Tamir Gal's ssh component.But it is giving me Auth Fail error on trying to connect the said Unix server.However, I am able to connect to that server through Putty.exe.Sowhat could be the issue?

I just need to connect to that Unix server and copy a log file from that server programatically.
Thoughtweaver 20-Apr-12 4:53am    
Hi!

Diagnosing the problem is a little tricky based on the information available. Have you tried debugging the connection sequence and seeing at which stage it fails? Please keep in mind that the article reference was really just meant to be a *starting point*. There are several other SSH components out there, which you can try as well... most of them are commercial though (you have to pay for them).

Can you tell me:
What Unix you are connecting to?
What kind of machine will you be connecting from?
Do you have root (Administrator) access on the unix machine?
How do you plan to do the actual reading: polling, streaming...?
How "real time" is the application?

Regards!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900