Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1203  / 3 Years ago, tue, september 21, 2021, 4:51:56

So I am able to SSH onto the server when connected to the same network, but I need to enable remote connection.



When I enter ssh -v user@serverIP, I get the output:



OpenSSH_5.6p1, OpenSSL 0.9.8y 5 Feb 2013
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for
debug1: Connecting to 192.168.0.19 [192.168.0.19] port 22.


When i enter ssh user@serverIP i get:



ssh: connect to host 192.168.0.19 port 22: Host is down


I enabled port22 forwarding with :



sudo ufw allow 22


I also logged onto my router firewall settings to enable port 22.



The main things I changed in /etc/ssh/sshd_config is:



Port 22
ListenAddress InternetIP
ListenAddress ServerIP


Any insight would be greatly appreciated.


More From » ssh

 Answers
1

Perhaps I'm missing something, but nowhere in your question do I see a "remote" IP address. I only see 192.168.x.x, which is only available inside your lan. If you want to connect from outside the lan, you need to use an external (public) address, which is the real address as seen from the outside. If it's a dynamic address, you either need to make sure it is current, or use a dynamic DNS service such as DynDNS.



Also, you need to open the port on your router, and make sure it's directed to the server for port 22.



Added Information



If you want easy outside access to one or more servers on your system, you might want to look into Dynamic DNS. There are free services that require periodic access or perhaps other requirements. The one I use (dyndns.org) used to have a free service, but now costs $25/year. I use it for remote access to a web server, and also my calibre ebook server. It allow you to choose a domain name from a big list, and add a prefix to make it personal. For example, you can choose homelinux.net, and add any number of names, such as "atavel.homelinux.net"; you run a standard updater periodically on your home system that will read your actual ip address, and update dynDNS in case of change. It's not very complicated, really.


[#22179] Wednesday, September 22, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scusaper

Total Points: 335
Total Questions: 111
Total Answers: 119

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
scusaper questions
Fri, Apr 15, 22, 15:26, 2 Years ago
Wed, Mar 15, 23, 03:53, 1 Year ago
Sat, Jun 4, 22, 18:03, 2 Years ago
;