473,320 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Connect to unix server and execute a command

JB
I'm writing a small utility and I need to be able to connect to a unix
server and execute a couple of commands.
How would I go about doing this?

It's fairly simple from the command prompt using telnet - but I have
to wait for the thing to connect, enter username and password, wait
again for it to authenticate, etc.

Any tips?
Jan 15 '08 #1
3 4337
If you are "getting to first base" with Telnet, there is plenty of sample c#
Telnet code around where you can automate the process:

http://www.google.com/search?q=C%23+Telnet+library

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"JB" wrote:
I'm writing a small utility and I need to be able to connect to a unix
server and execute a couple of commands.
How would I go about doing this?

It's fairly simple from the command prompt using telnet - but I have
to wait for the thing to connect, enter username and password, wait
again for it to authenticate, etc.

Any tips?
Jan 15 '08 #2
JB
Cheers this looks to be just what I need.

On 15 Jan, 12:21, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
If you are "getting to first base" with Telnet, there is plenty of sample c#
Telnet code around where you can automate the process:

http://www.google.com/search?q=C%23+Telnet+library

-- Peter
Site:http://www.eggheadcafe.com
UnBlog:http://petesbloggerama.blogspot.com
MetaFinder:http://www.blogmetafinder.com

"JB" wrote:
I'm writing a small utility and I need to be able to connect to a unix
server and execute a couple of commands.
How would I go about doing this?
It's fairly simple from the command prompt using telnet - but I have
to wait for the thing to connect, enter username and password, wait
again for it to authenticate, etc.
Any tips?
Jan 15 '08 #3
JB wrote:
On 15 Jan, 12:21, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
>If you are "getting to first base" with Telnet, there is plenty of sample c#
Telnet code around where you can automate the process:

http://www.google.com/search?q=C%23+Telnet+library

Cheers this looks to be just what I need.
If you could find a rsh or rexec library then it would
be even easier.

Arne
Jan 24 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
3
by: Fabian Knopf | last post by:
Hi friends, i have a unix machine PC1 where a database is running ( IBM DB2 V8.1 ) . Then i have another machine PC2 i installed there also ( IBM DB2 V8.1 ). On PC2 i installed unixODBC. To...
10
by: Ed Stevens | last post by:
A tale of woe, and a question . . . Last week my boss said to me "we've installed DB2 Connect on this Solaris box. Make it work." Now, I've barely seen DB2 Connect on Windows, having fumbled...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
5
by: smatta | last post by:
I have just installed MySql version 5.0-18 on Red Hat Fedora Core 4. It is running but I cant connect to it using MySql Query Browser running on my pc. >From my pc, I can telnet to the sql...
3
by: sohan | last post by:
Hi, One question - to connect to a db2 database in the same UNIX server we can use from UNIX command prompt: db2 connect to <dbnameUSer <nameusing <pwd> Now if the db2 database is in a...
21
by: Tom Gur | last post by:
Hi, It's seems that csh and tcsh acts a bit different when handling special characters in quotes. i.e: if i'll supply my program with the following arguments: -winpath "c:\\temp\\" tcsh will...
10
by: lalnamar | last post by:
I want to execute a unix time command using perl, and capture the output (specifically, the time it takes the command to execute). i tried using the system command: system("time command ");...
1
by: balas1 | last post by:
hi i need to execute unix command from browser. but i cant get any output in my browser side.. need to enable anything to execute unix command from browser using php my coding is <?php ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.