文章目录
- 说个问题
- 写个方案
- 系统准备
-
- 切换为管理员
- 更新软件列表
- 下载wget工具
- 查看wget版本
- 软件安装
-
- 软件下载
- 软件安装
- 安装net-tools
- 软件卸载
- 扩展功能
- 激活使用
-
- SN码登录
- 设备激活
- APP激活
- 添加映射
- 网页管理平台
- 远程连接
-
- 软件安装
- 远程连接
- 连接成功
说个问题
已经可以通过Putty通过局域网访问Ubuntu Server,如果个人自建服务器不在身边,该怎么访问呢?
写个方案
在个人Ubuntu Server 服务器中安装花生壳内网穿透,即可实现 Putty 远程访问个人自建服务器。
系统准备
在安装前确认系统已安装好wget依赖包。
sudo -s (切换至管理员)
apt-get update (更新软件列表)
apt-get install wget (下载wget工具)
wget –version (查看下载安装成功wget版本)
切换为管理员
sh@sheephero:~$ sudo -s
[sudo] password for sh:
root@sheephero:/home/sh#
更新软件列表
root@sheephero:/home/sh# apt-get update
Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble InRelease
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates InRelease [126 kB]
Get:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-backports InRelease [126 kB]
Get:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/main amd64 Components [132 kB]
Get:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 Components [212 B]
Get:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/universe amd64 Components [310 kB]
Get:7 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Get:8 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/multiverse amd64 Components [940 B]
Get:9 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-backports/main amd64 Components [208 B]
Get:10 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-backports/restricted amd64 Components [216 B]
Get:11 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-backports/universe amd64 Components [11.7 kB]
Get:12 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-backports/multiverse amd64 Components [212 B]
Get:13 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [501 kB]
Get:14 http://security.ubuntu.com/ubuntu noble-security/main Translation-en [102 kB]
Fetched 1,438 kB in 5s (317 kB/s)
root@sheephero:/home/sh#
下载wget工具
root@sheephero:/home/sh# apt-get install wget
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
wget is already the newest version (1.21.4-1ubuntu4.1).
wget set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 56 not upgraded.
root@sheephero:/home/sh#
查看wget版本
root@sheephero:/home/sh# wget –version
GNU Wget 1.21.4 built on linux-gnu.
-cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls
+ntlm +opie +psl +ssl/openssl
Wgetrc:
/etc/wgetrc (system)
Locale:
/usr/share/locale
Compile:
gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
-DLOCALEDIR="/usr/share/locale" -I. -I../../src -I../lib
-I../../lib -Wdate-time -D_FORTIFY_SOURCE=3 -DHAVE_LIBSSL -DNDEBUG
-g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
-ffile-prefix-map=/build/wget-LWnKWI/wget-1.21.4=. -flto=auto
-ffat-lto-objects -fstack-protector-strong -fstack-clash-protection
-Wformat -Werror=format-security -fcf-protection
-fdebug-prefix-map=/build/wget-LWnKWI/wget-1.21.4=/usr/src/wget-1.21.4-1ubuntu4.1
-DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall
Link:
gcc -DHAVE_LIBSSL -DNDEBUG -g -O2 -fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer
-ffile-prefix-map=/build/wget-LWnKWI/wget-1.21.4=. -flto=auto
-ffat-lto-objects -fstack-protector-strong -fstack-clash-protection
-Wformat -Werror=format-security -fcf-protection
-fdebug-prefix-map=/build/wget-LWnKWI/wget-1.21.4=/usr/src/wget-1.21.4-1ubuntu4.1
-DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall -Wl,-Bsymbolic-functions
-flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -lpcre2-8
-luuid -lidn2 -lssl -lcrypto -lz -lpsl ../lib/libgnu.a
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Originally written by Hrvoje Niksic <hniksic@xemacs.org>.
Please send bug reports and questions to <bug-wget@gnu.org>.
root@sheephero:/home/sh#
软件安装
软件下载
花生壳客户端官方下载 – 贝锐花生壳官网
点击立即下载会下载deb压缩包phddns_5.3.0_amd64.deb,可以采用离线安装,羊大侠直接复制命令行,采用在线安装方式。
wget "https://dl.oray.com/hsk/linux/phddns_5.3.0_amd64.deb" -O phddns_5.3.0_amd64.deb
root@sheephero:/home/sh# wget "https://dl.oray.com/hsk/linux/phddns_5.3.0_amd64.deb" -O phddns_5.3.0_amd64.deb
–2024-12-11 15:07:45– https://dl.oray.com/hsk/linux/phddns_5.3.0_amd64.deb
Resolving dl.oray.com (dl.oray.com)… 2408:876a:afff:ffff:3::3f4, 2408:876a:afff:ffff:3::3f5, 116.171.183.229, …
Connecting to dl.oray.com (dl.oray.com)|2408:876a:afff:ffff:3::3f4|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 269950 (264K) [application/octet-stream]
Saving to: ‘phddns_5.3.0_amd64.deb’
phddns_5.3.0_amd64. 100%[===================>] 263.62K –.-KB/s in 0.03s
2024-12-11 15:07:45 (8.48 MB/s) – ‘phddns_5.3.0_amd64.deb’ saved [269950/269950]
root@sheephero:/home/sh# ls
phddns_5.3.0_amd64.deb
root@sheephero:/home/sh#
软件安装
根据不同位数的系统输入下面的命令进行安装,安装完成会自动生成SN码与登录密码。
32位:dpkg -i phddns-i386.deb 64位:dpkg -i phddns_5.3.0_amd64.deb
记住SN码和默认登录密码:SN: ********* Default password: ****** 和远程管理地址:http://b.oray.com
`
root@sheephero:/home/sh# dpkg -i phddns_5.3.0_amd64.deb
Selecting previously unselected package phddns.
(Reading database … 83692 files and directories currently installed.)
Preparing to unpack phddns_5.3.0_amd64.deb …
Unpacking phddns (5.3.0) …
Setting up phddns (5.3.0) …
in systemv
Installation, please later…
/var/lib/dpkg/info/phddns.postinst: line 11: netstat: command not found
Successful installation of Phddns Service.
+————————————————–+
| Oray PeanutHull Linux 5.3.0 |
+————————————————–+
| SN: ora********* Default password: ****** |
+————————————————–+
| Remote Management Address http://b.oray.com |
+————————————————–+
root@sheephero:/home/sh#
安装net-tools
/var/lib/dpkg/info/phddns.postinst: line 11: netstat: command not found 在较新的Ubuntu版本中,net-tools(包含 netstat、ifconfig 等命令)已经被 iproute2(包含 ip 命令)所取代。然而,有些软件包或脚本可能仍然依赖于 net-tools,所以需要使用 sudo apt install net-tools 安装,安装完成后再次运行 dpkg -i phddns_5.3.0_amd64.deb 确保花生壳安装成功。
root@sheephero:/home/sh# sudo apt install net-tools
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following NEW packages will be installed:
net-tools
0 upgraded, 1 newly installed, 0 to remove and 56 not upgraded.
Need to get 204 kB of archives.
After this operation, 811 kB of additional disk space will be used.
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble/main amd64 net-tools amd64 2.10-0.1ubuntu4 [204 kB]
Fetched 204 kB in 1s (398 kB/s)
Selecting previously unselected package net-tools.
(Reading database … 83703 files and directories currently installed.)
Preparing to unpack …/net-tools_2.10-0.1ubuntu4_amd64.deb …
Unpacking net-tools (2.10-0.1ubuntu4) …
Setting up net-tools (2.10-0.1ubuntu4) …
Processing triggers for man-db (2.12.0-4build2) …
Scanning processes…
Scanning linux images…
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@sheephero:/home/sh#
软件卸载
dpkg -r phddns
扩展功能
4、扩展功能:输入phddns回车,可以看到扩展的功能: phddns start(启动)| status(状态)| stop(停止)|restart(重启)| reset(重置)|enable(开机自启动)|disable(关闭开机自启动)|version(版本) 注意: 除phddns version命令不需要管理员权限外,其他命令均需要管理员权限
激活使用
SN码登录
浏览器访问http://b.oray.com,输入花生壳Linux 5.3在安装时产生SN码与默认登录密码admin登录。
设备激活
激活后设备密码将同步为【首个登录账号】的密码; 后续更换设备登录账号,设备密码将不会进行同步。 使用手机端贝锐花生壳管理APP扫码激活,或者输入贝锐账号密码激活,羊大侠扫码激活
APP激活
扫码激活失败,采用App手动添加设备,输入SN码来激活
添加映射
网页管理平台
管理地址:https://console.hsk.oray.com/forward
远程连接
软件安装
Download PuTTY: latest release (0.82) 下载安装Putty软件:putty-64bit-0.82-installer.msi
远程连接
输入添加映射获取到的外网域名和端口号,点击open,进入安全警告界面。
点击接受
评论前必须登录!
注册