Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have two computers. Both of them are from different private networks. I'd like to connect from one of them to another (to program on it remotely). I attempted to use some remote desktop software (teamviewer). However, I encountered some issues with internet connection bandwidth and screen resolution. So, I search some way to get just terminal access to remote computer. I'm a beginner in Linux. And as far as I understand the remote console access to other computer is obtaining via ssh (or telnet?). Unfortunately both of computers have private IP, so I unable to use SSH (reverse) tunneling.

How to get remote terminal access to other computer in my case? (I'd prefer free solution)

share|improve this question
You question implies that you were able to connect with "teamviewer", but had issues with it. How did you get that to work around the private IP issue? – Patrick Nov 10 '13 at 18:12
@Patrick - When one started teamviewer application, this application connects to some teamviewer server. Each computer has some kind of numeric ID. So, if I want to connect to another computer, I enter in my teamviewer application ID of a remote computer teamviewer client application. So, connect established over Teamviewer servers. I hope, there is some similar solution for terminal access exists. – Loom Nov 10 '13 at 18:38
Each of your two computers is behind a different NAT, i.e. both can access the internet but cannot be reached from the internet? – michas Nov 10 '13 at 19:06
@michas - Yes, each of them behind different NATs – Loom Nov 10 '13 at 19:17
If neither computer can see the other one, then you need a third machine that's visible to both. For the Teamviewer protocol, you were using Teamviewer's services. SSH is easy to set up if you can find a machine with a public IP address where you can run an SSH server. – Gilles Nov 10 '13 at 20:10

1 Answer 1

Private networks are bad for exactly these kind of problems: Both cannot be easily accessed from outside the network, and because the other computer is always outside the network a direct connection is not possible.

Maybe the easiest way is to set up IPv6 on both computers. This will give both computers a real IP-Address and they are therefore reachable from each other.

The other way would be setting up some port forwarding on the second router. then you can connect from the first computer to that port of the second router which forwards it to the second computer.

The last way would involve nasty tunneling. In this case you need some public reachable host to which you can ssh from both computers to set up some indirect connection similar to what your teamviewer is doing.

share|improve this answer
Thank you. However, I'm not good at networks and do not understood clearly. Is it possible to set up IPv6 to my computers? These computers are just simple ubuntu desktops. I do not have access to routers. Looks like just tunneling can help me. Am I right? – Loom Nov 10 '13 at 19:59
Yes, linux supports IPv6 since 1996. On ubuntu it is enabled by default. (Typing ifconfig you should already see some IPv6 addresses.) How easy it is to connect to the outside mainly depends on your internet provider. - Some providers provide native IPv6, and you need to do nothing at all. For others you need to manually set up a tunnel. A nice tool for that might be aiccu‌​. Most newer routers are able to provide IPv6 for the whole network. But this again requires access to the router. – michas Nov 10 '13 at 20:24
Thank you. Yes, there is IPv6 address in ifconfig output. I tried to test my IPv6 with And it responsed: No IPv6 address detected. So, I need aiccu to get my IPv6 address visible from internet. If I understand you correctly? – Loom Nov 10 '13 at 20:55
Yes, without support from your ISP and without access to your router - the best way is probably to set up your own tunnel to the IPv6 world. aiccu is easy to use. You need to register at sixxs, create a tunnel for each of your computers and enter the credentials at the aiccu client. – michas Nov 10 '13 at 22:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.