How can I use my new openssh-server with the external IP address from outside the Local Area Network?
The purpose is that an external computer administrator from outside the Local Area Network should be able to administer the openssh-server (root rights, installation of software and data) via Internet.
Technical setup:
Local Area Network = Router + openssh-server + openssh-client
openssh-server Ubuntu 14.04.1 server full disk encryption internal IP 111.111.111.111, external IP address given by the Internet Service Provider 222.222.222.222, two free ports 22 (TCP, UDP) set in the router for this computer, user MaximGorki
openssh-client Ubuntu 14.04.1 desktop full disk encryption internal IP 111.111.111.110, external IP address given by the Internet Service Provider 222.222.222.222
I am able to login into the openssh-server from the openssh-client inside a Local Area Network (LAN) using the IP address set by the router for the openssh-server 111.111.111.111.
From the openssh-server I want to connect with the openssh-server with the command line:
ssh [email protected]
ssh [email protected]
The internal IP address works with password.
The external IP address does not work from the openssh-client computer which is within the Local Area Network:
ssh: connect to host 222.222.222.222 port 22: Connection timed out
I have set up also pubkey feature. But this does not work. I do not know why. Therefore, I would be happy to access the openssh-server only by password authentication.
I want to test if the openssh-server is available from the external IP address.
What do I have to set up or change in which computer how?
My linux know-how is very limited, please give full command line syntax as examples, if you see the answer.
After recommendation of one answer I added 4 rules to the original iptables. Iptables look now so:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source
218 16703 ACCEPT all -- any any anywhere state RELATED,ESTABLISHED
0 0 ACCEPT all -- any any 222.222.222.222
0 0 ACCEPT tcp -- any any anywhere tcp dpt:22
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source
0 0 ACCEPT all -- any any anywhere state RELATED,ESTABLISHED
0 0 ACCEPT all -- any any anywhere state RELATED,ESTABLISHED
0 0 ACCEPT all -- any any anywhere state RELATED,ESTABLISHED
Chain OUTPUT (policy ACCEPT 10 packets, 2082 bytes)
pkts bytes target prot opt in out source