gpt4 book ai didi

ssh - 通过Raspberry Pi在SSH海外

转载 作者:行者123 更新时间:2023-12-02 14:14:50 25 4
gpt4 key购买 nike

我目前有带网络连接的Raspberry pi设置,我可以通过本地ip地址连接到它,如下所示:
192.168.0.x

无论如何,我是否可以使用我的公用IP SSH进入我的树莓派?

最佳答案

我认为动态DNS通常是可行的方法。我使用FreeDNS,我认为它相当不错。 dentt65的Instructions for setup:

First of all register your account on Freedns. Freedns offers a bunch of domain names, from my taste the best ones (or the ones easy to remember) are:

  • mooo.com
  • ignorelist.com

Assume that you register: your_host>.ignorelist.com
Install inadyn:

sudo apt-get install inadyn curl

Open the url: http://freedns.afraid.org/dynamic/
Login with your account
Select the link Direct URL beside .ignorelist.com
Copy everything from the right of the ? in the address bar (alphanumeric string)

Create configuration file of inadyn:

sudo gedit /etc/inadyn.conf

And save this content:

--username <your_username>
--password <your_password>
--update_period 60000
--forced_update_period 320000
--alias <your_host>.ignorelist.com,alphanumeric string
--background
--dyndns_system default@freedns.afraid.org
--syslog

Add inadyn to crontab:

export EDITOR=gedit && sudo crontab -e

Edit the file to add the following line:

@reboot /usr/sbin/inadyn

Reboot your PC
Wait 3 minutes
Check if inadyn is running:

ps -A | grep inadyn

Check inadyn behaviour:

more /var/log/messages |grep INADYN

Check if your host is up:

ping <your_host>.ignorelist.com

关于ssh - 通过Raspberry Pi在SSH海外,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26872053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com