ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known

前端 未结 15 2314
忘掉有多难
忘掉有多难 2020-12-12 09:34

I am trying to set up a VPN with a Raspberry Pi, and the first step is gaining the ability to ssh into the device from outside my local network. For whatever re

15条回答
  •  隐瞒了意图╮
    2020-12-12 10:20

    If you need access to your VPN from anywhere in the world you need to register a domain name and have it point to the public ip address of your VPN/network gateway. You could also use a Dynamic DNS service to connect a hostname to your public ip.

    If you only need to ssh from your Mac to your Raspberry inside your local network, do this: On your Mac, edit /etc/hosts. Assuming the Raspberry has hostname "berry" and ip "172.16.0.100", add one line:

    # ip           hostname
    172.16.0.100   berry
    

    Now: ssh user@berry should work.

提交回复
热议问题