LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to copy a file from a remote computer? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-copy-a-file-from-a-remote-computer-4175477720/)

hanamilani 09-19-2013 05:57 AM

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 :\

Firerat 09-19-2013 06:03 AM

Code:

scp /path/to/file myusername@mycomputer:/path/to/dir/forfile/

hanamilani 09-19-2013 06:07 AM

Quote:

Originally Posted by Firerat (Post 5030612)
Code:

scp /path/to/file myusername@mycomputer:/path/to/dir/forfile/

tell me how to find: myusername and mycomputer

Firerat 09-19-2013 06:10 AM

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/

hanamilani 09-19-2013 06:16 AM

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?

Firerat 09-19-2013 06:25 AM

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

lleb 09-19-2013 06:28 AM

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.

Firerat 09-19-2013 06:43 AM

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)



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