473,748 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4360
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...@yaho o.NoSpamMaam.co mwrote:
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...@yaho o.NoSpamMaam.co mwrote:
>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
4821
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: " . mysql_error()); echo "Connected successfully"; mysql_close($link);
3
5738
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 connect to the database over ODBC on unix i did this: on db2 console: catalog tcpip node archiv remote PC1 server DB2_db2inst1
10
4376
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 thru one install and config, with a lot of handholding from IBM Support. I'm comfortable in unix but have never dealt with DB2 Connect there. (my main job is as an Oracle DBA, and most of my db's are on Solaris or AIX) I've found the install...
4
6474
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 define the servername / hostname in my Perl Progrem.. Here is the code:
5
5093
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 server / port. I get back a garbled message: 5.0.18-standard§}WxyuadT,☻V6F?J5i1YMT= Should this be garbled ? or is there a problem ?
3
12548
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 differrent server where/how do we specify the server name or its ip address?
21
3030
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 take it as -winpath "c:\temp\" and csh will take it literally (with the double-slashes). Is there a way for me to know what shell is currently running my
10
17702
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 "); however, when i try to capture the output, the capture output does not contain the amount of time it took to execute when i try to do: $var = `time command `; there is the same problem (the ouput from the command is saved in the variable; however,...
1
4702
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 $output = exec('ls -lart');
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9326
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.