Well you would need him to port forward port 22 from his computer and have him be running sshd
if you want to do it the simple way.
On the other hand, you can do the dirty work and have him do a port forward through ssh
to your computer. This would be done by you setting up an ssh
daemon (instructions for OSX here), then port forwarding port 22 (ssh
port) from your main computer through your router. There are many, many variations between each router and firmware, so I really can't walk you through this step. However, this site seems to have a very large database of guides tailored for different routers, so you might have some luck there. Also make sure you set a static private IP address for your main computer so that dhcp doesn't give you a new address. If this happens, your external port will be forwarded to a non-existent internal host, so it would be pointless.
Next, create a user for your brother. Nothing fancy here, just make sure it has a password and that he knows what it is. Also make sure that he has an ssh
daemon running on his computer. He may also be interested in creating a user on his computer for you so that he need not expose his password to you and give you your own home directory.
Once you have an ssh
daemon running, have your brother connect to your computer with the command ssh -R 2222:localhost:22 brother@your.public.ip.here
he should be able to connect and enter his password (which doesn't show on UNIX based OSes while you enter it for security reasons). Once he's connected, traffic from your computer on port 2222 will be forwarded to his computer's port 22 (the ssh
port). You should now be able to connect to his computer with ssh -p 2222 you@localhost
. Have fun!
As a closing remark, you may also want to pick up a hostname from a DDNS site, I suggest no-ip.com. This way, you can easily connect to your router, which will be at something.ddns.net
, or something along those lines. I like no-ip because it's free, and if you configure your router to use it correctly, it will automatically update the hostname to point to your public IP address.
xx.xx.xx.xx
was actually replaced with the correct IP address, what happened when you tried tossh
to it? – JigglyNaga Aug 17 '16 at 20:07