0
I am new to ssh and have been racking my brains for several days over connecting a home computer to an remote computer. I found out that I can't connect, as they are on different networks. I am sure that this problem has a simple solution, but after a day of futile searching for a solution to my problem, I have to resort to your help.
My remote server is located at the IP address 192.168.0.1
, and my home computer is 192.168.18.118
Both are on the same port (temporarily) 1729
. The only difference is the username, the home PC username is Thomas
, and the remote username is Tom
.
Help please solve this problem, the usual connection by typing in the username of the remote server, the IP address of the remote server and the port of the remote server end with a timeout error. Thank you very much in advance.
EDIT 14.10.2019
The problem is that I don’t know how to use all this. I don’t know how to use all this, because on the Internet I watched a half-tone video, articles and much more, but I couldn’t find a concrete explanation of how to connect two such computers via ssh. In addition, it was not possible to find even at least some example of how this is done.
Assume that the global IP address of my home PC is 70.***.**.**
, and the local address is 192.168.18.118
. Also suppose that the global IP address of my remote PC is 75.***.**.**
, and the local address is 192.168.0.1
. Both included 1729
port and hostname archlinux, username of the home PC Thomas
, and the remote Tom
. Now the question is, how do I connect these two computers with each other, that is, how do I access from my home PC to a remote one and vice versa?
I would be extremely grateful to all of you if you could help me connect my home computer to the remote, as I really need it.
Continue EDIT 14.10.2019
I tried the way you said and got the answer
ssh: connect to host
75.***.**.**
port1729
: Connection timed out
For the sake of interest, I tried to connect to my home PC in this way, only with the global IP address of the home PC and with the username on the home PC, and I got this response
ssh: connect to host
70.***.**.**
port1729
: Connection refused
EDIT 15.10.2019
$ ss -nltu
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 0 0 0.0.0.0:68 0.0.0.0:*
tcp LISTEN 0 128 127.0.0.1:5432 0.0.0.0:*
tcp LISTEN 0 128 127.0.0.1:6463 0.0.0.0:*
tcp LISTEN 0 128 0.0.0.0:1729 0.0.0.0:*
How can I complete the process?
EDIT 16.10.2019
Answer to connect on home PC to global IP home PC:
$ ssh Thomas@70.***.**.**
ssh: connect to host 70.***.**.** port 22: Connection refused
Answer to connect on home PC to global IP remote PC:
$ ssh Tom@75.***.**.**
ssh: connect to host 75.***.**.** port 22: Connection timed out.
Result of scan home PC global address:
$ nmap 70.***.**.** -p 22
Starting Nmap 7.80 ( https://nmap.org ) at 2019-10-16 00:44 +04
Nmap scan report for 70.***.**.**
Host is up (0.00039s latency).
PORT STATE SERVICE
22/tcp closed ssh
Nmap done: 1 IP address (1 host up) scanned in 0.35 seconds
When I scan global IP address my remote PC I give similar answer, but STATE
indicate as filtered
.
Are you in power to configure network devices on the remote side? Or can you install software on the remote computer freely? Your question looks like your previous one in disguise, so the answers may be "no" and "no". The sooner it gets clear, the better. What about the local (home) side?
– Kamil Maciorowski – 2019-10-12T22:54:58.677Thanks for the answer. I want to note that I have all the authority to do whatever I want with both computers. – Atom – 2019-10-13T08:11:29.950
SSH server would need to be set up on the remote PC with the server's port configured for DNAT on the WAN facing router the PC is behind. The RFC1918 subnet the server and client are on has no bearing, as the incoming connection to the server is inbound from WAN and will be seen as a connection from the remote PC's router's WAN IP. Since a port is being passed directly to the PC from the router with no firewalling, it's imperative the SSH server is configured for PKI auth only, with password auth disabled. – JW0914 – 2019-10-13T12:30:23.217
Thank you very much for the detailed answer. Honestly, I know all my addresses, both local and global, both on a remote PC and on my home. See details above, I edited my question. – Atom – 2019-10-14T15:18:08.927