D
D
Dmitry2017-06-16 01:09:05
linux
Dmitry, 2017-06-16 01:09:05

How to connect to home PC via ssh from outside?

Hello everyone, the essence of the task is as follows:
You need to establish an ssh connection to your home PC, respectively, the connection will be from the workplace.
In /etc/ssh/sshd_config, in the ListenAddres lines, I added a local ip (through which the connection passes with a bang through wifi) and an external one (dedicated, through which it is actually impossible to establish a connection).
The service ssh status command swears at the allocated ip, here is the error (error: bind to port 2220 on some.ip.adress failed : Caanot assign requested adress.)
Based on the error text, I realized that the service cannot seem to assign this address.
How to deal with it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Moseychuk, 2017-06-16
@fshp

Your computer does not have any external address, you are behind a router, so you do not need to specify it in the settings.
You need to forward the port on the router from the white IP to the IP of your computer on the local network.

I
Igor Nikolaev, 2017-06-16
@nightvich

There is such a thing as DDNS, and there are, for example , such resources.
Then you don't need a white IP. Most modern routers work fine with this.

Z
Ziptar, 2017-06-21
@Ziptar

error: bind to port 2220 on some.ip.adress failed : Caanot assign requested adress

By itself. The OS knows nothing about your external IP, which is assigned to the wan interface of the router.
In sshd_conf, you need to leave listening only on the local address, and on the router, forward incoming connections from the provider side on the corresponding port to this very address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question