View previous topic :: View next topic |
Author |
Message |
xiaweitang Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 26 Feb 2010 Posts: 152
|
Posted: Fri Mar 05, 2010 7:22 pm Post subject: Simple way to transfer files between two machines? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
NathanZachary Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
![](images/avatars/1881051309477ebac651590.jpg)
Joined: 30 Jan 2007 Posts: 2609
|
Posted: Fri Mar 05, 2010 7:24 pm Post subject: |
|
|
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. ![Smile :)](images/smiles/icon_smile.gif) _________________ “Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio--- |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
toralf Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/10034462014367c4dfe33c1.gif)
Joined: 01 Feb 2004 Posts: 3943 Location: Hamburg
|
Posted: Fri Mar 05, 2010 7:33 pm Post subject: Re: Simple way to transfer files between two machines? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
xiaweitang Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 26 Feb 2010 Posts: 152
|
Posted: Fri Mar 05, 2010 7:33 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Jaglover Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/179708169458f2999e44e26.gif)
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Fri Mar 05, 2010 7:34 pm Post subject: |
|
|
I'd export a directory on Ubuntu desktop over NFS.
For rare transfers I'd use SCP. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
xiaweitang Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 26 Feb 2010 Posts: 152
|
Posted: Fri Mar 05, 2010 7:34 pm Post subject: Re: Simple way to transfer files between two machines? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
papahuhn l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/gallery/Loony Toons/Looney_Toons_-_Sylvester.gif)
Joined: 06 Sep 2004 Posts: 626
|
Posted: Fri Mar 05, 2010 7:48 pm Post subject: |
|
|
The IP. _________________ Death by snoo-snoo! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Raistlin Majere n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/21030610994b744fc2d2f10.jpg)
Joined: 04 Feb 2010 Posts: 61
|
Posted: Fri Mar 05, 2010 7:48 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54821 Location: 56N 3W
|
Posted: Fri Mar 05, 2010 7:50 pm Post subject: |
|
|
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: | 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 |
|
![](templates/gentoo/images/spacer.gif) |
xiaweitang Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 26 Feb 2010 Posts: 152
|
Posted: Fri Mar 05, 2010 8:04 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54821 Location: 56N 3W
|
Posted: Fri Mar 05, 2010 8:12 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Raistlin Majere n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/21030610994b744fc2d2f10.jpg)
Joined: 04 Feb 2010 Posts: 61
|
Posted: Fri Mar 05, 2010 8:13 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
xiaweitang Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 26 Feb 2010 Posts: 152
|
Posted: Fri Mar 05, 2010 8:16 pm Post subject: |
|
|
I'm transfering through internet. Using scp and the ip address found by ifconfig did the job. Thanks to all. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|