VPS安装飞牛OS

首先备份你的网络配置,以防止安装后网络配置异常,那么就需要手动配置网络。 root@bwg:~# ip a eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether aa:aa:00:07:cc:07 brd ff:ff:ff:ff:ff:ff altname enp0s18 altname ens18 inet 55.62.158.62/22 brd 55.62.158.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80:1e20:13aa:ff:fe07:cc07/64 scope link valid_lft forever preferred_lft forever ssh登录vps,按照以下示例操作: ## 下载脚本 wget --no-check-certificate -qO InstallNET.sh 'https://unixetc.com/res/InstallNET.sh' ## 添加执行权限 chmod a+x InstallNET.sh ## 通过脚本安装网络镜像,这个过程时间可能较长,因为要下载fnos.vhd.gz镜像文件。 ./InstallNET.sh --image 'https://r2.yx.lu/fnos.vhd.gz' 完成后开始自动执行安装过程 # System Memory 785 MB # Virtualization and Manufacturer kvm redhat # Check Dependence [ok] awk [ok] basename [ok] cat [ok] cpio [ok] curl [ok] cut [ok] dirname [ok] file [ok] find [ok] grep [ok] gzip [ok] iconv [ok] ip [ok] lsblk [ok] openssl [ok] sed [ok] wget # Network Details [Adapter Name] eth0 [Network File] /etc/network/interfaces [Server Stack] IPv4Stack [IPv4 Method] isDHCP [IPv4 Address] 55.62.158.62 [IPv4 Subnet] 255.255.252.0 [IPv4 Gateway] 55.62.158.255 [IPv4 DNS] 8.8.8.8 1.1.1.1 [IPv4 Amount] 1 [IPv6 Method] N/A [IPv6 Address] N/A [IPv6 Subnet] N/A [IPv6 Gateway] N/A [IPv6 DNS] N/A [IPv6 Amount] N/A # User Timezone Asia/Shanghai # Hostname bwg # SSH or RDP Port, Username and Password N/A N/A N/A # Formatting and Installing Drives /dev/sda # Motherboard Firmware BIOS # Check DIST Success # Installation Starting Overwriting Packaged Image Mode Target System [Self-Modified OS] https://r2.yx.lu/fnos.vhd.gz [Debian] [bookworm] [amd64] Downloading... [Mirror] http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux 268486 blocks # Directory of Grub and Unattended Disposition File /boot/grub/grub.cfg /tmp/boot/preseed.cfg [Finish] Input 'reboot' to continue the subsequential installation. 按照提示输入reboot重启系统开始安装fnOS。 ...

十二月 27, 2024 · JQX

将VPS重装为最小化Debian

今天发现一个很妙的脚本,可以将VPS重装为最小化Debian系统,以节省系统开销,很适合小鸡鸡用户。 说明 适用于KVM和物理主机,不适用 于软容器化系统 适用于Debian、Ubuntu和Red Hat Linux系统,并且以GRUB 2为引导程序。 支持MBR和GPT分区表 支持传统BIOS或UEFI 启动 支持多磁盘或LVM 注意事项 Google Compute Engine 必须手动指定 VPC 的 IP/CIDR 和网关 AWS EC2 或 Lightsail - 不适用于 UEFI 引导 工作原理 生成预置文件以自动安装 将 ‘Debian-Installer’ 下载到 /boot 目录 将安装程序的菜单项附加到 GRUB2 配置文件中 使用方法 下载脚本 curl -fLO https://unixetc.com/res/debi.sh ##或者 wget -O debi.sh https://unixetc.com/res/debi.sh 运行脚本 ## 以管理员权限运行脚本或者使用sudo chmod a+rx debi.sh sudo ./debi.sh --cdn --ethx --bbr --user root --password password –bbr 开启 BBR –ethx 网卡名称使用传统形式,如 eth0 而不是 ens3 默认时区为 UTC,添加 –timezone Asia/Shanghai 可使用中国时区。 默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加 –ustc 可使用中科大镜像源。 完成后重启即可进入新系统。 ...

十二月 26, 2024 · JQX

Linux一键修改swap脚本

在此分享一个Linux一键修改swap文件脚本,方便大家使用。 下载脚本 wget https://unixetc.com/res/swap.sh chmod +x ./swap.sh 脚本使用示例,注意必须以root权限执行该脚本 ## 运行脚本 ./swap.sh ——————————————————————————————————————— Linux VPS一键添加/删除swap脚本 1、添加swap 2、删除swap ——————————————————————————————————————— 请输入数字 [1-2]:1 请输入需要添加的swap(建议为内存的1.5-2倍) 请输入swap数值(单位M):2000 swap已存在,swap设置失败,请先运行脚本删除swap后重新设置! ##提示已存在swap,应该选择2删除了再次添加 ——————————————————————————————————————— Linux VPS一键添加/删除swap脚本 1、添加swap 2、删除swap ——————————————————————————————————————— 请输入数字 [1-2]:2 swap已发现,正在将其移除... swap已删除! ##添加swap ——————————————————————————————————————— Linux VPS一键添加/删除swap脚本 1、添加swap 2、删除swap ——————————————————————————————————————— 请输入数字 [1-2]:1 请输入需要添加的swap(建议为内存的1.5-2倍) 请输入swap数值(单位M):2000 swap未发现,正在为其创建swap swap创建成功,并查看信息: Filename Type Size Used Priority /swap file 2047996 338952 -2 SwapCached: 127192 kB SwapTotal: 2047996 kB SwapFree: 1709044 kB

十一月 28, 2024 · JQX

VPS安装Bluesky PDS

Bluesky是一个去中心化的分散式社交系统,与 Mastodon (长毛象) 相似,不过Bluesky 自行开发的AT Protocol协议无法与 Mastodon 的 ActivityPub 互通。 同样是可自行架设的社交平台,比较特别的是 Bluesky 并不像 Mastodon 一样包含了前端网页(web),它只有提供API功能,需要专门的前端来进行登录管理。 自行部署的Bluesky服务器被称为个人数据服务器 (Personal Data Server, PDS),使用者可以在 bsky.app 网页版或 iOS、Android客户端中登录自行部署的pds服务。 pds推荐主机配置 操作系统 Ubuntu 22.04 内存 (RAM) 1 GB CPU核心 1 CPU构架 amd64, arm64 硬盘 20 GB SSD 可服务账号数 20 VPS部署PDS实例 域名设置 以pds.p9.pub为例,服务器IP为195.192.118.6 将pds.p9.pub和*.pds.p9.pub的A记录修改为195.192.118.6 安装pds 通过以下命令下载安装脚本 wget https://raw.githubusercontent.com/bluesky-social/pds/main/installer.sh 然后运行bash ./installer.sh来开始安装 bash ./installer.sh * Detected supported distribution Debian 12 --------------------------------------- Add DNS Record for Public IP --------------------------------------- From your DNS provider's control panel, create the required DNS record with the value of your server's public IP address. + Any DNS name that can be resolved on the public internet will work. + Replace example.com below with any valid domain name you control. + A TTL of 600 seconds (10 minutes) is recommended. Example DNS record: NAME TYPE VALUE ---- ---- ----- example.com A 195.192.118.6 *.example.com A 195.192.118.6 **IMPORTANT** It's recommended to wait 3-5 minutes after creating a new DNS record before attempting to use it. This will allow time for the DNS record to be fully updated. ## 输入域名和管理员邮箱 Enter your public DNS address (e.g. example.com): pds.p9.pub Enter an admin email address (e.g. [email protected]): [email protected] Hit:1 http://security.debian.org/debian-security bookworm-security InRelease Hit:2 http://deb.debian.org/debian bookworm InRelease Hit:3 http://deb.debian.org/debian bookworm-updates InRelease Hit:4 https://download.docker.com/linux/debian bookworm InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done ca-certificates is already the newest version (20230311). curl is already the newest version (7.88.1-10+deb12u7). lsb-release is already the newest version (12.0-1). lsb-release set to manually installed. openssl is already the newest version (3.0.14-1~deb12u2). openssl set to manually installed. The following additional packages will be installed: dirmngr gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libassuan0 libjq1 libksba8 libnpth0 libonig5 pinentry-curses Suggested packages: pinentry-gnome3 tor parcimonie xloadimage scdaemon pinentry-doc sqlite3-doc The following NEW packages will be installed: dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm jq libassuan0 libjq1 libksba8 libnpth0 libonig5 pinentry-curses sqlite3 xxd 0 upgraded, 19 newly installed, 0 to remove and 0 not upgraded. Need to get 8,706 kB of archives. After this operation, 17.8 MB of additional disk space will be used. Get:1 http://deb.debian.org/debian bookworm/main amd64 libassuan0 amd64 2.5.5-5 [48.5 kB] Get:2 http://deb.debian.org/debian bookworm/main amd64 gpgconf amd64 2.2.40-1.1 [564 kB] Get:3 http://deb.debian.org/debian bookworm/main amd64 libksba8 amd64 1.6.3-2 [128 kB] Get:4 http://deb.debian.org/debian bookworm/main amd64 libnpth0 amd64 1.6-3 [19.0 kB] Get:5 http://deb.debian.org/debian bookworm/main amd64 dirmngr amd64 2.2.40-1.1 [792 kB] Get:6 http://deb.debian.org/debian bookworm/main amd64 gnupg-l10n all 2.2.40-1.1 [1,093 kB] Get:7 http://deb.debian.org/debian bookworm/main amd64 gnupg-utils amd64 2.2.40-1.1 [927 kB] Get:8 http://deb.debian.org/debian bookworm/main amd64 gpg amd64 2.2.40-1.1 [949 kB] Get:9 http://deb.debian.org/debian bookworm/main amd64 pinentry-curses amd64 1.2.1-1 [77.4 kB] Get:10 http://deb.debian.org/debian bookworm/main amd64 gpg-agent amd64 2.2.40-1.1 [695 kB] Get:11 http://deb.debian.org/debian bookworm/main amd64 gpg-wks-client amd64 2.2.40-1.1 [541 kB] Get:12 http://deb.debian.org/debian bookworm/main amd64 gpg-wks-server amd64 2.2.40-1.1 [531 kB] Get:13 http://deb.debian.org/debian bookworm/main amd64 gpgsm amd64 2.2.40-1.1 [671 kB] Get:14 http://deb.debian.org/debian bookworm/main amd64 gnupg all 2.2.40-1.1 [846 kB] Get:15 http://deb.debian.org/debian bookworm/main amd64 libonig5 amd64 6.9.8-1 [188 kB] Get:16 http://deb.debian.org/debian bookworm/main amd64 libjq1 amd64 1.6-2.1 [135 kB] Get:17 http://deb.debian.org/debian bookworm/main amd64 jq amd64 1.6-2.1 [64.9 kB] Get:18 http://deb.debian.org/debian bookworm/main amd64 sqlite3 amd64 3.40.1-2 [353 kB] Get:19 http://deb.debian.org/debian bookworm/main amd64 xxd amd64 2:9.0.1378-2 [83.7 kB] Fetched 8,706 kB in 0s (36.3 MB/s) Selecting previously unselected package libassuan0:amd64. (Reading database ... 36657 files and directories currently installed.) Preparing to unpack .../00-libassuan0_2.5.5-5_amd64.deb ... Unpacking libassuan0:amd64 (2.5.5-5) ... Selecting previously unselected package gpgconf. Preparing to unpack .../01-gpgconf_2.2.40-1.1_amd64.deb ... Unpacking gpgconf (2.2.40-1.1) ... Selecting previously unselected package libksba8:amd64. Preparing to unpack .../02-libksba8_1.6.3-2_amd64.deb ... Unpacking libksba8:amd64 (1.6.3-2) ... Selecting previously unselected package libnpth0:amd64. Preparing to unpack .../03-libnpth0_1.6-3_amd64.deb ... Unpacking libnpth0:amd64 (1.6-3) ... Selecting previously unselected package dirmngr. Preparing to unpack .../04-dirmngr_2.2.40-1.1_amd64.deb ... Unpacking dirmngr (2.2.40-1.1) ... Selecting previously unselected package gnupg-l10n. Preparing to unpack .../05-gnupg-l10n_2.2.40-1.1_all.deb ... Unpacking gnupg-l10n (2.2.40-1.1) ... Selecting previously unselected package gnupg-utils. Preparing to unpack .../06-gnupg-utils_2.2.40-1.1_amd64.deb ... Unpacking gnupg-utils (2.2.40-1.1) ... Selecting previously unselected package gpg. Preparing to unpack .../07-gpg_2.2.40-1.1_amd64.deb ... Unpacking gpg (2.2.40-1.1) ... Selecting previously unselected package pinentry-curses. Preparing to unpack .../08-pinentry-curses_1.2.1-1_amd64.deb ... Unpacking pinentry-curses (1.2.1-1) ... Selecting previously unselected package gpg-agent. Preparing to unpack .../09-gpg-agent_2.2.40-1.1_amd64.deb ... Unpacking gpg-agent (2.2.40-1.1) ... Selecting previously unselected package gpg-wks-client. Preparing to unpack .../10-gpg-wks-client_2.2.40-1.1_amd64.deb ... Unpacking gpg-wks-client (2.2.40-1.1) ... Selecting previously unselected package gpg-wks-server. Preparing to unpack .../11-gpg-wks-server_2.2.40-1.1_amd64.deb ... Unpacking gpg-wks-server (2.2.40-1.1) ... Selecting previously unselected package gpgsm. Preparing to unpack .../12-gpgsm_2.2.40-1.1_amd64.deb ... Unpacking gpgsm (2.2.40-1.1) ... Selecting previously unselected package gnupg. Preparing to unpack .../13-gnupg_2.2.40-1.1_all.deb ... Unpacking gnupg (2.2.40-1.1) ... Selecting previously unselected package libonig5:amd64. Preparing to unpack .../14-libonig5_6.9.8-1_amd64.deb ... Unpacking libonig5:amd64 (6.9.8-1) ... Selecting previously unselected package libjq1:amd64. Preparing to unpack .../15-libjq1_1.6-2.1_amd64.deb ... Unpacking libjq1:amd64 (1.6-2.1) ... Selecting previously unselected package jq. Preparing to unpack .../16-jq_1.6-2.1_amd64.deb ... Unpacking jq (1.6-2.1) ... Selecting previously unselected package sqlite3. Preparing to unpack .../17-sqlite3_3.40.1-2_amd64.deb ... Unpacking sqlite3 (3.40.1-2) ... Selecting previously unselected package xxd. Preparing to unpack .../18-xxd_2%3a9.0.1378-2_amd64.deb ... Unpacking xxd (2:9.0.1378-2) ... Setting up libksba8:amd64 (1.6.3-2) ... Setting up libnpth0:amd64 (1.6-3) ... Setting up libassuan0:amd64 (2.5.5-5) ... Setting up xxd (2:9.0.1378-2) ... Setting up gnupg-l10n (2.2.40-1.1) ... Setting up gpgconf (2.2.40-1.1) ... Setting up libonig5:amd64 (6.9.8-1) ... Setting up sqlite3 (3.40.1-2) ... Setting up gpg (2.2.40-1.1) ... Setting up gnupg-utils (2.2.40-1.1) ... Setting up pinentry-curses (1.2.1-1) ... Setting up gpg-agent (2.2.40-1.1) ... Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-browser.socket → /usr/lib/systemd/user/gpg-agent-browser.socket. Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-extra.socket → /usr/lib/systemd/user/gpg-agent-extra.socket. Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-ssh.socket → /usr/lib/systemd/user/gpg-agent-ssh.socket. Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent.socket → /usr/lib/systemd/user/gpg-agent.socket. Setting up libjq1:amd64 (1.6-2.1) ... Setting up gpgsm (2.2.40-1.1) ... Setting up dirmngr (2.2.40-1.1) ... Created symlink /etc/systemd/user/sockets.target.wants/dirmngr.socket → /usr/lib/systemd/user/dirmngr.socket. Setting up gpg-wks-server (2.2.40-1.1) ... Setting up jq (1.6-2.1) ... Setting up gpg-wks-client (2.2.40-1.1) ... Setting up gnupg (2.2.40-1.1) ... Processing triggers for man-db (2.11.2-2) ... Processing triggers for libc-bin (2.36-9+deb12u8) ... * Configuring Docker daemon * Creating data directory /pds * Creating Caddy data directory * Creating Caddy config directory * Creating Caddy config file * Downloading PDS compose file * Starting the pds systemd service Created symlink /etc/systemd/system/default.target.wants/pds.service → /etc/systemd/system/pds.service. * Downloading pdsadmin ======================================================================== PDS installation successful! ------------------------------------------------------------------------ Check service status : sudo systemctl status pds Watch service logs : sudo docker logs -f pds Backup service data : /pds PDS Admin command : pdsadmin Required Firewall Ports ------------------------------------------------------------------------ Service Direction Port Protocol Source ------- --------- ---- -------- ---------------------- HTTP TLS verification Inbound 80 TCP Any HTTP Control Panel Inbound 443 TCP Any Required DNS entries ------------------------------------------------------------------------ Name Type Value ------- --------- --------------- pds.p9.pub A 195.192.118.6 *.pds.p9.pub A 195.192.118.6 Detected public IP of this server: 195.192.118.6 To see pdsadmin commands, run "pdsadmin help" ======================================================================== ### 是否添加账号,这里选择y开始设置账号,选择n的话后期可以通过pdsadmin account create来添加账号 Create a PDS user account? (y/N): y ## 设置邮箱 Enter an email address (e.g. [email protected]): [email protected] ## 设置账号名,注意格式jqx.pds.p9.pub Enter a handle (e.g. alice.pds.p9.pub): jqx.pds.p9.pub ## 账号添加完成 Account created successfully! ----------------------------- Handle : jqx.pds.p9.pub DID : did:plc:dgsdfgas34dfpqilzhutwbtvkg Password : qNiugTBUQ*******x7Bdwt ----------------------------- Save this password, it will not be displayed again. 验证PDS ...

十月 28, 2024 · JQX

网络文件系统SSHFS使用实例

什么是SSHFS? SSHFS是一个通过SSH连接到服务器的网络文件系统客户端。 SSHFS允许您使用SFTP挂载远程文件系统。 大多数VPS SSH服务器默认情况下都支持并启用此SFTP访问,因此SSHFS使用非常简单,无需在服务器端执行任何操作。 项目当前状态 SSHFS由所有主要的Linux发行版本提供,并且已经在多种系统上投入生产使用多年。 但是,目前SSHFS没有任何活动的常规贡献者,并且存在许多已知问题(请参阅Bugtracker)。 当前的维护者继续应用拉取请求并进行定期发布,但是不幸的是,除了解决高影响力的问题之外,它没有能力进行任何开发。 报告错误时,请理解,除非您包含拉取请求或报告严重问题,否则您可能不会得到响应。 安装SSHFS 首先,从https://github.com/libfuse/sshfs/releases下载最新的SSHFS版本。 在Linux和BSD上,您还需要安装libfuse 3.1.0或更高版本。 在macOS上,您需要OSXFUSE。 最后,您需要带有开发标头的Glib库(应该可以从操作系统的程序包管理器中获得)。 构建和安装,我们建议使用Meson(0.38版或更高版本)和Ninja。 解压缩sshfs tarball之后,创建一个(临时)构建目录并运行Meson: $ mkdir build; cd build $ meson .. 通常,默认的构建选项可以正常工作。 但是,如果您要调整它们,可以使用mesonconf命令进行: $ mesonconf # list options $ mesonconf -D strip=true # set an option 构建,测试和安装SSHFS,请使用Ninja(运行测试需要py.test Python模块): $ ninja $ python3 -m pytest test/ # optional, but recommended $ sudo ninja install CentOS安装sshfs简单方法 yum install -y epel-release yum -y install fuse-sshfs 使用SSHFS 安装了sshfs后,运行它就非常简单: sshfs [user@]hostname:[directory] mountpoint 建议以普通用户(而不是root)身份运行SSHFS。 为此,mountpoint必须归用户所有。 如果省略用户名,SSHFS将使用本地用户名。 如果省略目录,SSHFS将挂载(远程)主目录。 如果您需要输入密码,sshfs会要求您输入密码(实际上,它只是运行ssh,如果需要,它会要求输入密码)。 ...

九月 26, 2020 · JQX