Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transfer files between 2 computers

Status
Not open for further replies.

emmons

Technical User
Oct 9, 2002
114
We have 2 computers with 2 nics directly connected. We want to transfer files from one of the computers to the other. What do we need to do? we can ping each other but can't do anything else. Can we use rcp command? If so, how?

help!

Thanks
 
p.s. I tried to use scp command but connection was refused. How do I get the connection not to be refused?
 
Hi - we did start the SSH server on the computer with the source files. At the other computer (that needs the files) we typed:
# scp root@192.168.0.1:/home/neal/tarballs/* /home/kris

connection refused so we typed ssh -v root@192.168.0.1

here's what we got

Open SSH_3.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090602f
debug1: reading configuration data /etc/ssh/ssh_config
debug1: applying options for *
debug1: Rhosts authentication disabled, originating port will not be trusted
debug1: restore _uid
debug1: ssh_connect: getuid 0 geteuid 0 anon 1
debug1: connecting to 192.168.0.1 [192.168.0.1] port 22.
debug1: temporarily_use_uid: 0/0 [e=0]
debug1: restore_uid
debug1: temporarily_use_uid 0/0 [e=0]
ssh: connect to address 192.168.0.1 port 22 connection refused
debug1: restore_uid
 
Have you checked the settings in /etc/ssh/sshd_config on the computer with the files and /etc/ssh/ssh_config on the computer that needs the files? //Daniel
 
Also, are you running a firewall on the box? Is port 22 open through the firewall? //Daniel
 
daniel, what do I look for in the config files? Also we typed in iptables --flush but not sure if that is what is needed to disble firewall on source computer- also is there a text editor built into Linux or do I need to download pine so I can get pico so I can check the config file on the computer needing the files - source computer already has pico
 
Do the config files seem to have correct values (ie the port and so on)?
iptables --flush should flush all firewall rules if you are using iptables (if the command is found, you most likely are).
I guess you could use vi if you have that installed, but I personally like pico better because it's so easy to work with ;-). //Daniel
 
Not sure if the config file has all the correct values not knowing what they should be be but anyway all the but two lines are commented out including the line with the port number. The two lines at the end which are not commented out are:

Host*
ForwardX11 yes
 
Well, this line specifically should be on the source computer
Code:
PermitRootLogin on
But, this doesn't appear to be the problem, as you can't even connect. If you execute netstat -nat, do you see sshd in there? How are you starting it? //Daniel
 
Here's the appropriate info from netstat --stat:

Proto Recv-Q Send-Q Local Address Foreign Address State
<snip>
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
<snip>

I'm starting sshd like this:

# /sbin/service sshd start

Its result is this:

Starting sshd: [ OK ]
 
err, make that --nat, not --stat...
 
Ok... Can you connect with SSH on the source computer to the source computer? Are you sure you have the right IP? Everything seems to be ok to me, but then again, it's 3:20 AM so I wouldn't trust myself ;-). //Daniel
 
Breakthrough! SSHing from the source to the source works! At least something's working :)
 
Here's what happens when I do iptables --flush ...

# iptables --flush
/lib/modules/2.4.18-3/kernel/net/ipv4/netfilter/ip_tables.o: init_module: Device or resource busy
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters
/lib/modules/2.4.18-3/kernel/net/ipv4/netfilter/ip_tables.o: insmod /lib/modules/2.4.18-3/kernel/net/ipv4/netfilter/ip_tables.o failed
/lib/modules/2.4.18-3/kernel/net/ipv4/netfilter/ip_tables.o: insmod ip_tables failed
iptables v1.2.5: can't initialize iptables table `filter': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
 
Ok, now we are making some progress here :).
Are you able to access any kind of service on the source computer from the destination computer? Can you ping it? Does telnet <IP> 22 give you a connection refused message too?
What IP's does the computers have? 192.168.0.1 and 192.168.101.2? //Daniel
 
I can ping the source from the destination (and vice-versa). I do not have telnet installed on the destination computer. Source ip is 192.168.0.1 and destination ip is 192.168.0.2. What's next?
 
Try executing ipchains --flush. A wild guess, but I got similar errors on my system before because I had both ipchains and iptables installed. //Daniel
 
dude! thank you! we can start setting up our mail server now. you might want to go to bed before we start our next project :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top