在Debian上安装向日葵

说明:

因为之前服务器上安装了 PVE (Proxmox VE),之前是用 Proxmox VE 进行服务器资源管理的。出于某些原因,现在不再通过 PVE构建的虚拟机来使用计算资源,而是通过 PVE 自带的 Debian 系统直接使用虚拟机资源(因为积累的数据量比较多,重新装系统不太现实,而且部分虚拟机也在用,所以目前的形式就是:一方面通过虚拟机使用计算资源,另一方面直接通过 Debian 使用计算资源)。

为了能够远程连接服务器,需要在 Debian 上安装向日葵软件。去官网下载时可以发现,没有直接适用 Debian 的向日葵安装包,所以本文将通过修改向日葵安装包源码来实现向日葵在 Debian 上的安装。

1. 下载向日葵安装包:

从官网上下载个人版向日葵(https://sunlogin.oray.com/download/linux?type=personal),因为是服务器端安装,所以选择命令行版本的向日葵。

下载方式:wget https://dw.oray.com/sunlogin/linux/sunloginclientshell-10.1.1.28779-amd64.deb

2. 解包并修改安装源码:

2.1 解包:

通过命令 dpkg-deb -R sunloginclientshell-10.1.1.28779-amd64.deb sunloginclient 将下载的 .deb安装包解压缩到 sunloginclient 目录下,该目录包含 DEBIANusr 两个子目录。
切换到DEBIAN目录下(cd sunloginclient/DEBIAN),可以看到有control postinst postrm preinst prerm 四个文件,其中需要修改的是 postinstprerm 两个文件。

2.2 修改:

切换到../usr/local/sunlogin/scripts/(2.2.1-2.2.4都是该目录)

2.2.1 修改common.sh文件:

切换到scripts目录下(cd ../usr/local/sunlogin/scripts/),用vi打开common.sh文件(如下图),可以发现其中是包含debian选项的(绿色箭头指示;但是后续安装脚本中没有debian相关内容,所以不能直接在debian上安装)。由于我们是要在 PVE 上安装,所以/etc/issue中所需的关键词是 "Proxmox Virtual Environment",所以需要添加红框标注的部分。

第二处需要修改的是 os_version 部分,需要增加红框标注的内容(如下所示)。需要注意的是我这里是/etc/issue.net,需要根据具体情况修改目标文件(可以 ls /etc/issue* 看一下 issue相关的文件)。

2.2.2 修改 start.sh

需要修改的地方如下所示,增加一处 debian 的启动项(注意 debian 的大小写)。

2.2.3 修改 depends.sh

需要增加一项 debian 的判断项。

2.2.4 修改 stop.sh

需要增加一项 debian 的终止项(注意 debian 的大小写)。

2.2.5 修改 postinst

切换到 DEBIAN/目录下,有两处需要修改(红框所示)。

2.2.6 修改prerm

有一处修改。

2.3 打包:

运行dpkg-deb -b sunloginclient/ sunlogincilent-10.1.1.128779-fixed-amd64.debsunloginclient/目录进行打包。

2.4 安装:

运行sudo dpkg -i sunlogincilent-10.1.1.128779-fixed-amd64.deb进行安装,安装时可能会报错:Package libncurses5 is not installed.,可以通过sudo apt-get install libncurses5-dev安装libncurses5,可能还会报错:E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).,可以通过apt --fix-broken install进行处理。

3. 运行向日葵:

运行sudo /usr/local/sunlogin/bin/sunloginclient
出现:

按f12登入向日葵账户即可。

登入之后:

再按f12退出(exit)即可。

4. 向日葵远程登入并创建新用户名:

4.1 创建用户组:

shell 复制代码
sudo groupadd zhang_group
sudo groupadd wang_group

4.2 创建新用户:

shell 复制代码
sudo useradd -m -G zhang_group zhangsan
sudo useradd -m -G wang_group wangwu

## 查看zhangsan 和 wangwu的用户组
groups zhangsan
groups wangwu

4.3 设置密码:

shell 复制代码
sudo passwd zhangsan

sudo passwd wangwu

修改/ect/passwd,将新用户对应行的 xxx:/bin/sh换成xxx:/bin/bash

(ps. 新建用户没有 sudo 权限)

参考:

[1]. https://forums.debiancn.org/t/topic/2801
[2]. https://sunlogin.oray.com/download/linux?type=personal

相关推荐
belldeep2 天前
Win10 上 Debian 12 如何安装 Redis ?
运维·redis·debian
会飞的土拨鼠呀3 天前
Debian 操作系统全面介绍
运维·debian
残影飞雪3 天前
如何在 Debian 12 上安装 MySQL
mysql·adb·debian
山城码农笑松哥3 天前
国产凝思debian系Linux离线安装rabbitmq教程步骤
linux·debian·rabbitmq
帅得不敢出门5 天前
macOS苹果电脑运行向日葵远程控制软件闪退
windows·macos·远程控制·向日葵
爱的si念8 天前
嵌入式ARM64 基于RK3588原生SDK添加用户配置选项./build lunch & debian
linux·debian·嵌入式
蚂蚁舞8 天前
在arm架构的Debian系统手动安装和卸载Mysql8的操作
arm开发·debian·安装mysql·mysql8·卸载mysql
圆山猫9 天前
[VF2] Boot Ubuntu和Debian发行版
ubuntu·postgresql·debian
etcix9 天前
for my debian 12 mxlinux install the podman
运维·debian·podman
Jtti10 天前
在 Debian 系统上清理缓存的方式和具体操作方法
运维·缓存·debian