Connection to another Unix machine


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Connection to another Unix machine
# 1  
Old 11-01-2006
Connection to another Unix machine

Requirements

I'm running a shell script from one Unix server A which calculates the line count using "wc -l" of a file which resides in another unix server B.

I have tried the ssh also but i'm not very clear about it and its throwing error. The command I'm trying to use is:

ssh user1@serverB /temp/tmpdir/wc -l abc.txt

Please let me know how can i achieve the same using the shell script.
# 2  
Old 11-01-2006
What error is it throwing?
# 3  
Old 11-02-2006
Error is:

ksh: /temp/tmpdir/wc: not found
# 4  
Old 11-05-2006
try...
ssh user1@serverB cat /path/to/abc.txt | wc -l
Tornado
# 5  
Old 11-05-2006
ssh -l user host "wc -l /path/to/abc.txt" works too
# 6  
Old 11-06-2006
Thanks..

both the above command works ..

but what if i dont want the word count of that file and just want to make a check whether the file is present on the remote unix machine?

how to do that?
# 7  
Old 11-06-2006
In addition to the previos query ... i have tried FTP also.

on 2 machines the connection and the script works fine. But on one machine it gives the following error:

ftp: connect: Connection refused
ftp: connect: Connection refused


What should I do?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Defunct process are generated after JNLP connection with a slave and the machine gets very slow

Hi everyone, I'm working on continous integration with Jenkins. I’m facing an issue while connecting a slave (solaris sparc 8) with Jenkins ver. 1.532.2 This slave is connected via the option “Launch slave via execution of command on the Master”. Connection is established with: -... (1 Reply)
Discussion started by: javaPIC
1 Replies

2. Shell Programming and Scripting

How can i get the logged in host machine ip in a ssh connection?

Hi All, I have a basic question. In my system i maintained multiple unix server, and only one server has public ip, and all the servers are behind load balancing BIG ip server. To access any server, user need to access server with public IP then from there they can establish ssh connection to... (2 Replies)
Discussion started by: dilipsn
2 Replies

3. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

4. Red Hat

Unable to SSH into machine - ssh_exchange_identification: Connection closed by remote host

For a few days now I have been experiencing issues when trying to SSH into 1 of my machine. I get the following output when running 'ssh -vvv': server1:/home/mymadq> ssh -l root -vvv server2 OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003 debug1: Reading configuration data /etc/ssh/ssh_config... (3 Replies)
Discussion started by: jaapar
3 Replies

5. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

6. Shell Programming and Scripting

ssh connection from remote machine in solaris

Hi! I have two solaris 10 machines(say 10.1.1.1,10.1.1.2). i have installed rsync on 10.1.1.2, 10.1.1.1::: Sun Microsystems Inc. SunOS 5.10 Generic January 2005 -bash-3.00$ ssh 10.1.1.2 "echo $PATH" Password:... (4 Replies)
Discussion started by: dddkiran
4 Replies

7. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

8. UNIX for Dummies Questions & Answers

PC connection to an old UNIX machine

Hello folks, I've got a problem I've found to be quite difficult to solve. Recently I bought an old UNIX machine from the late eighties, a DIAB1100 with a Motorola 68K processor. I've used Linux for a while now, so I know the basics of that OS and thought it would be interesting to see a real... (8 Replies)
Discussion started by: tonyingesson
8 Replies

9. UNIX for Advanced & Expert Users

missing Path(in UNIX) when i launch a job on to unix machine using windows SSh

hi i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Discussion started by: megastar
1 Replies

10. IP Networking

unix to unix serial connection question

hi there i'm a new bie just got few simple questions to ask. I got expert in windows configuration but totally new to unix environment . I want to make sure a com port (com1) is working, so I connect a 9-pin cable (CB9) for both PC using Unix environment (unix to unix). The question are (1)... (1 Reply)
Discussion started by: typsam
1 Replies
Login or Register to Ask a Question