LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH/SCP help (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-scp-help-787001/)

Jinouchi 02-04-2010 10:40 AM

SSH/SCP help
 
On my own I've managed to set up SSH on my home router and login from a remote location, and from there SSH into my personal computer, but now what I can't figure out is how to transfer files from my home PC to the remote location and vice versa via scp. Is there a way to specify a PC behind my router? ie. root@my.router.ip.address/username@192.138.1.101? (I know that syntax wouldn't be correct) It seems like this would be fairly simple, but I'm not sure what to look for next. Is this what port forwarding is for?

Thanks,

-Jinouchi

Web31337 02-04-2010 10:43 AM

did you try sftp for file transfer purpose? and ssh forwarding?
you can forward a port on your pc behind router to local one, and connect with sftp to it like it's on your current PC.

Jinouchi 02-04-2010 10:45 AM

...Wow, that was fast. I have not tried sftp, nor ssh forwarding. How does forwarding work?

ncsuapex 02-04-2010 10:48 AM

You need to know the public IP of your network(PC behind the router). For your home PC you can visit www.whatismyip.com (either in lynx or GUI browser(firefox/IE/etc)


The syntax would be:

scp /path/to/file/on/local/machine/file username@ipaddress:/path/to/location/on/remote/machine

OR

scp username@:/path/to/location/on/remote/machine/files /path/to/location/on/local/machine



Or you need the public IP of your remote computer you're SSHing from.

Jinouchi 02-04-2010 10:52 AM

Right, I've gotten that far, but the problem is that in order to get to my PC I have to go through my router. So there's really three IPs involved here. So basically, from a remote location, what is the path to my PC (which is behind my router)?

ncsuapex 02-04-2010 10:59 AM

Ahh... I misread that. I just have port 22 open on my router for my PC. Then when I scp/ssh into my public IP it goes straight to my Linux PC. Not sure how to do what you're trying.

Jinouchi 02-04-2010 11:03 AM

Oh, ok, I figured that must be what forwarding did... I'll have to figure out how to set that up and get back to you. Thanks.

Jinouchi 02-04-2010 12:32 PM

1 Attachment(s)
Well, I've set up my router to forward port 22 to my IP (or so it seems), but when I ssh into my external IP I still ssh into my router... Shouldn't my router be passing the ssh request straight to my computer instead of handling it itself? (see attachment)

(I've set SSH to use port 2020 on my machine, in case you're wondering.)

Jinouchi 02-06-2010 11:05 AM

Anyone know what I'm doing wrong?

Jinouchi 02-14-2010 10:37 PM

Aha! I found out what was wrong. I correctly configured port forwarding; HOWEVER, I had SSH Management enabled. I disabled this (Administration > Management > SSH Management) and all seems to be working fine now.


All times are GMT -5. The time now is 01:48 AM.