LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-01-2006, 03:00 PM   #1
Kodiak_Claw
LQ Newbie
 
Registered: Jul 2005
Distribution: Fedora Core 4
Posts: 8

Rep: Reputation: 0
Transferring files between boxes


I'm trying to transfer my data files from one computer to another. Since the older machine lacks a means of mass storage, I've bought an ethernet cable, and am hoping I can get them to network.

The older box is Fedora Core 5, while the newer one is Slackware 10.2.

About the only thing I know here is that I need the ethernet cable (and the ethernet cards, I have those too), so feel free to include details that 'anybody should know'.
 
Old 11-01-2006, 03:17 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 679Reputation: 679Reputation: 679Reputation: 679Reputation: 679Reputation: 679
If you don't have a hub or switch, then you need a crossover ethernet cable. If the hosts are not next to each other and you don't want to go out and buy a 25 or 50 ft crossover cable, you can buy a shorter one and an ethernet extension adaptor.
You could either set up a networking share, using NFS or samba, or you could use the sftp program. For that you need to set up ssh which is easier than setting up a ftp server.
 
Old 11-04-2006, 09:07 AM   #3
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Supposing you already have the crossover cable to connect both machines, you need to see if both machines have their ethernet interfaces configured in the same network.
You need to enter the command "ifconfig eth0" on both machines; the answer will be something like above:
Code:
eth0      Link encap:Ethernet  HWaddr 00:14:2A:D6:CC:C6
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:23 Base address:0xe400
You have to be sure that both machines are in the same network, that is, 192.168.0.x but have different addresses, for instance, one should be 192.168.0.1 and the other 192.168.0.2.

If you don't have it on this condition, you can setup the network with the above commands, one for each machine:
Code:
# Machine A
ifconfig eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255

# Machine B
ifconfig eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255
These configuration will not be preserved on the boot. If you want to preserve configuration, on the fedora enter "netconfig" to setup the addresses and on the slackware, edit /etc/rc.d/rc.inet1.conf to specify the addresses.

When the configurations seem Ok, you can ping each other to see if the machines are really connected:
Code:
# Machine A
ping 192.168.0.2

# Machine B
ping 192.168.0.1
If it's all working, you will see a sequence like the above:
Code:
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
64 bytes from 192.168.0.2: icmp_seq=0 ttl=64 time=0.066 ms
64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.057 ms
64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.059 ms
Hit Ctrl-c to finish ping.

Now you need some kind of remote shell in both machines, like ssh or rsh. I don't want to setup flames here, but for a local network, I prefer rsh; however, you should already have ssh installed on both machines; you need at least one with ssh which is the client and the other with sshd, the ssh server. You can check if both are installed with the command:
Code:
which ssh
which sshd
If you have it installed, you will see the absolute path of the files ssh and sshd. If you have no answer from the command, you need to intall and configure the packages on both machines. The problem with ssh is that it's strongly recommended to do not permit open sessions with root user and doing this, you can't transfer all file attributes when transfering files from one machine to another, unless you set "user id" execution bit on the application, but we'll discuss it later.

To check if the connection is working, from one machine, open a session on the other:
Code:
# Machine A
ssh <user name>@192.168.0.2

# Machine B
ssh <user name>@192.168.0.1
If both clients and server are working, you'll get a password prompt and, after enter the proper password, you'll get a shell prompt on the other system. The <user name> is a valid user name on the target machine and must not be "root".

All right, now we can think on the transfer issues. You can use scp, which comes with ssh. There are other utilities and forms to do the transfer over the ssh but I guess that scp is enough for now. The command will be:

scp <file name> <user name>@192.168.0.2:/<directory name>/
scp will ask the password before transfer the file.
 
Old 11-04-2006, 11:19 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,117

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
Good advice so far. But once you have the connection working, if you're running KDE, there's a neat protocol built into konqueror - fish which gives you a neat graphical way of moving files between machines.

Put the following in your konqueror location bar and press return:

fish://username@addy.of.other.machine

and off you go! You can drag & drop files between machines as easily as you can between directories on your own machine.

Edit: Note that for fish to work, you need to have ssh running!

HTH

Last edited by tredegar; 11-04-2006 at 11:22 AM.
 
Old 12-17-2006, 04:17 PM   #5
HeyAZ
LQ Newbie
 
Registered: Aug 2006
Posts: 29

Rep: Reputation: 15
can't get ssh to work

Want to transfer files from a Fedora Core 5 desktop (address 192.168.1.3 and the user-name: jb) to a Suse 10.2 laptop (192.168.1.4, jim). Connect with a crossover cable. Same broadcast: 192.168.1.255.

Ping works from the laptop but ssh cannot connect:
# ping 192.168.1.3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=0.163 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=0.180 ms
64 bytes from 192.168.1.3: icmp_seq=3 ttl=64 time=0.179 ms
--- 192.168.1.3 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.163/0.174/0.180/0.007 ms
# ssh jb@192.168.1.3
ssh: connect to host 192.168.1.3 port 22: No route to host

From the desktop can also ping, but then hangs:
#ssh: connect to host 192.168.1.4 port 22: Connection timed out

^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Diagnostics:

On laptop:
# nmap -T5 -sV localhost
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-12-17 13:02 MST
Interesting ports on localhost (127.0.0.1):
Not shown: 1675 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 4.4 (protocol 1.99)
25/tcp open smtp Postfix smtpd
111/tcp open rpc
631/tcp open ipp CUPS 1.2
6000/tcp open X11 (access denied)
Service Info: Host: linux-arizona.site; OS: Unix
Nmap finished: 1 IP address (1 host up) scanned in 6.270 seconds
# /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
# ps aux | grep sshd
root 3619 0.0 0.1 53460 1528 ? Ss Dec16 0:00 /usr/sbin/sshd -o PidFile=/var/run/sshd.init.pid
root 9721 0.0 0.0 5008 796 pts/0 S+ 13:10 0:00 grep sshd

On the desktop, nmap shows port 22 is also open:
22/tcp open ssh OpenSSH 4.4 (protocol 2.0)
# /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
# ps aux | grep sshd
root 2255 0.0 0.1 4976 1108 ? Ss 02:04 0:00 /usr/sbin/sshd
root 25016 0.0 0.0 3916 656 pts/0 R+ 13:11 0:00 grep sshd
 
Old 12-17-2006, 10:48 PM   #6
HeyAZ
LQ Newbie
 
Registered: Aug 2006
Posts: 29

Rep: Reputation: 15
OK - got it working. One thing about that Suse firewall: it does work !
Thanks for advice, using fish in the konqueror location bar helps tremendously.
:-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Transferring alias files linux_dummy Linux - General 11 03-18-2006 04:07 AM
transferring files to other disk.. bschiett Linux - Newbie 3 03-24-2005 08:04 PM
Transferring 40000+ files with FTP (mget) shows 0 files tim1235 Linux - Software 5 10-17-2004 07:06 PM
IO Error when transferring files. mickey_kamer Linux - General 4 03-19-2004 10:29 AM
Transferring Files From VMware? Crickit Linux - Software 5 04-17-2003 03:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration