LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2013, 06:57 AM   #1
hanamilani
Member
 
Registered: Dec 2008
Posts: 66

Rep: Reputation: 0
How to copy a file from a remote computer?


I have connected to a remote computer by SSH. Mine is fedora and the remote is centos.
I want to copy a file from the remote to mine.

Please let me know the command. Also, please let me know how to mention the destination. I don't know how to mention myusername@mycomputer :\
 
Old 09-19-2013, 07:03 AM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
Code:
scp /path/to/file myusername@mycomputer:/path/to/dir/forfile/
 
Old 09-19-2013, 07:07 AM   #3
hanamilani
Member
 
Registered: Dec 2008
Posts: 66

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Firerat View Post
Code:
scp /path/to/file myusername@mycomputer:/path/to/dir/forfile/
tell me how to find: myusername and mycomputer
 
Old 09-19-2013, 07:10 AM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
can't

I do not know your username or the External IP of your computer

Assuming you connect through a router you would need to either use VPN or forward a port to your computer

might be easier to do it the other way round

on your computer

Code:
scp remoteusername@remotecomputerIP:/path/to/file /path/to/dir/forfile/
 
Old 09-19-2013, 07:16 AM   #5
hanamilani
Member
 
Registered: Dec 2008
Posts: 66

Original Poster
Rep: Reputation: 0
I am using a laptop. I just don't know the myusername and mycomputername. I just need to find them. Are there any commands that can help me find them?
 
Old 09-19-2013, 07:25 AM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
might be easier to do it the other way round

Code:
scp remoteusername@remotecomputerIP:/path/to/file /path/to/dir/forfile/

and honestly, if you don't know your own username, you are in trouble.

I accept that finding out your IP address might be a challenge
a websearch for "whats my IP" might help

configuring your router to forward ports, refer to router manual
Warning:
port forwards are best left alone unless you know what you are doing
 
Old 09-19-2013, 07:28 AM   #7
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
its no different in linux then any other OS out there in the world. yourusername is the name you log in with. thus your user name.

as for the computer name, that is the IP address of your laptop, or if you are using a properly configured local DHCP server with DNS, then your fully qualified domain name will work too.

as clear as firerat stated we can not tell you those things, we are not you.

you can always open your terminal and type in "whoami" without the " " and it will tell you your user name. as for the ip: thats also simple from the terminal. switch to root user and type: "ifconfig" again without the " " and you will be able to find your IP.

computers are computers mate. Linux, MS, OSx, BSD, they all require a user name of some type and some means of identifying who they are on the network.
 
Old 09-19-2013, 07:43 AM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
actually
I did assume your remote computer wasn't on your LAN

in which case, you can find the ip with
Code:
/sbin/ifconfig
example output
Code:
mint@mint-VirtualBox ~ $ /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:a2:86:40  
          inet addr:10.168.210.115  Bcast:10.168.210.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fea2:8640/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3656 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2345 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3804772 (3.8 MB)  TX bytes:236206 (236.2 KB)
 
  


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
Copy a file from remote directory akthar.crew@gmail.com Linux - Newbie 1 08-04-2011 05:15 AM
remote copy file elainelaw Linux - Newbie 9 08-05-2010 11:33 AM
Why won't 'scp' let me copy to a remote computer? otter2244 Linux - Networking 7 10-05-2008 07:01 PM
how copy a file from a cd into the computer using the comand line? mariav Linux - Software 3 04-13-2007 11:07 PM
scp :copy file from one remote comp to another aniketh Linux - Networking 4 06-16-2004 03:31 AM


All times are GMT -5. The time now is 08:19 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration