I usually do this:
scp something user@ip
But, that's because my other server has an IP.
What is the IP of my laptop? (What if I am behind a wireless router?) How do I scp into my laptop?
migrated from serverfault.com Dec 2 '09 at 18:04
This question came from our site for professional system and network administrators.
Your wireless router creates a private network for your laptop and all your other wireless devices to share a single IP address. The IP your ISP gives you might change from time to time but for the most part it doesn't change too much.
When your router gets a request from the internet to port 22, it blocks it because the router doesn't know what computer to send the request to. But if you tell it to, it can forward the port to a specific computer, i.e. your laptop.
So you can usually access your routers settings by pointing your browser to 192.168.0.1 (or 1.1) and look for a section with the words port forwarding in it. Tell it to forward port 22 to your laptop's ip address. (You can get the address via ifconfig).
Use a website like whatismyip.com to find out the public-facing address that the ISP gives you and then use the public IP address to connect to your laptop via SSH.
If you only want a temporary connection you can use your web server to bounce connections to your local computer by using openssh like this:
As long as that connection (from your laptop to your server) is open, then you can connect to your laptop with:
The wireless router you are behind is likely performing Network Address Translation. That means that your laptop is a non-routable, internal IP like
Your router has both an internal IP, on the NAT network, and an external IP visible by the greater Internet. In order to connect using ssh to your laptop on port 22 from the Internet, you'll need to set up your router to forward traffic to port 22 to your laptop's internal IP. That can be done by using the web interface for your router's settings, typically by opening your browser to something like http://192.168.1.1, http://192.168.0.1, etc, depending on your internal network settings. Then, you would simply connect to your router's external IP using ssh/scp from an outside machine, and the traffic would be forwarded to your laptop.
To find out the ip of your laptop, launch
This, however, does not guarantee that you can do scp from a remote site into your laptop. As a matter of fact,
Things might be more complicated than that. Next time please state clearly what your OS is, what you need to do, provide examples, and if possible detail which steps you did and why it wasn't working.