Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Simple way to transfer files between two machines?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Fri Mar 05, 2010 7:22 pm    Post subject: Simple way to transfer files between two machines? Reply with quote

This could be very basic, but I have never done it before. I have a desktop running ubuntu, and a laptop running Gentoo. I want to occasionally transfer files between these two machines, and don't need fancy features. Maybe scp will simply work? But I don't have a domain name!
Code:
tux ~ # domainname
(none)
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Fri Mar 05, 2010 7:24 pm    Post subject: Reply with quote

It simply depends on what type of method you want to use. If you are wanting to transfer over the network, there are many options. If you only want to transfer files occasionally, and not very many or large files, you may just want to use a flash drive. Please provide a little more information on the specifics of your goals, and we'll work from there. :)
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3926
Location: Hamburg

PostPosted: Fri Mar 05, 2010 7:33 pm    Post subject: Re: Simple way to transfer files between two machines? Reply with quote

xiaweitang wrote:
Maybe scp will simply work?
Try it :
Code:
touch x; scp x <user>@<remote_host>/tmp
?

Last edited by toralf on Fri Mar 05, 2010 7:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Fri Mar 05, 2010 7:33 pm    Post subject: Reply with quote

I want to copy all my personal files in my desktop to my laptop so that I can do a clean install on the desktop. I can use usb, but I don't have it around now.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Mar 05, 2010 7:34 pm    Post subject: Reply with quote

I'd export a directory on Ubuntu desktop over NFS.
For rare transfers I'd use SCP.
Back to top
View user's profile Send private message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Fri Mar 05, 2010 7:34 pm    Post subject: Re: Simple way to transfer files between two machines? Reply with quote

toralf wrote:
xiaweitang wrote:
Maybe scp will simply work?
Try it :
Code:
touch x; scp x <user>@<remote_host>/tmp
?

What should be remote_host?
Back to top
View user's profile Send private message
papahuhn
l33t
l33t


Joined: 06 Sep 2004
Posts: 626

PostPosted: Fri Mar 05, 2010 7:48 pm    Post subject: Reply with quote

The IP.
_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
Raistlin Majere
n00b
n00b


Joined: 04 Feb 2010
Posts: 61

PostPosted: Fri Mar 05, 2010 7:48 pm    Post subject: Reply with quote

Quote:
What should be remote_host?


The ip address of the computer you want to connect to

On a side note , i use rsync to transfer between my laptop and desktop but that's just a matter of personal taste.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54454
Location: 56N 3W

PostPosted: Fri Mar 05, 2010 7:50 pm    Post subject: Reply with quote

xiaweitang,

The IP address of the remote system or its hostname if the name will resolve to an IP adddress.
You only need to specify <user>@ if you don't have the same username on both manchies.

The remote host will need to be running sshd.

Read
Code:
man scp

Code:
scp <somefile> <remote_host>:/path/to/destination
is the simplest form of the command.
You can also use scp to transfer entire directores but its slow as the link is renegiotiated for every file.

sshfs will work if the ssh family of commands works too. That allows you to mount a directory from the remote system in your local filesystem tree without messing about with NFS.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Fri Mar 05, 2010 8:04 pm    Post subject: Reply with quote

NeddySeagoon wrote:
xiaweitang,

The IP address of the remote system or its hostname if the name will resolve to an IP adddress.
You only need to specify <user>@ if you don't have the same username on both manchies.

But there are so many users connected to the Internet, there maybe a lot of users using the same host name. If I don't specify IP, how does scp know which one to connect?
Another question, won't my IP address changes each time I connect because I'm using DHCP?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54454
Location: 56N 3W

PostPosted: Fri Mar 05, 2010 8:12 pm    Post subject: Reply with quote

xiaweitang,

Do you want to transfer files between machines over the internet or just on your local network?

As you use DHCP, your DHCP server should resolve host names to their current IP addresses, so it should just work.
There is no danger of picking some random machine on the neat as you will be using a non-routable subnet, probably beginning 192.168. but there are others.

Packets destined for these non routeable subnets are dropped on sight by routers on the internet.

You can run ifconfig on the remote host to see what its IP address is. Its unlikely to change while its powered up as it will renew its lease on the IP address from time to time. As there is no pressure on IP addresses on your network, its address will be static. It may change from power up to power up.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Raistlin Majere
n00b
n00b


Joined: 04 Feb 2010
Posts: 61

PostPosted: Fri Mar 05, 2010 8:13 pm    Post subject: Reply with quote

Quote:
Another question, won't my IP address changes each time I connect because I'm using DHCP?


Most likely yes , drove me nuts everytime i was away and tried to connect to my home computer until i just set a static ip address for it. I used this wiki to help me

http://www.gentoo-wiki.info/HOWTO_static_ip_with_dhcp_router
Back to top
View user's profile Send private message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Fri Mar 05, 2010 8:16 pm    Post subject: Reply with quote

I'm transfering through internet. Using scp and the ip address found by ifconfig did the job. Thanks to all.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum