linux - 使用 super 用户访问权限自动登录并在 Ubuntu 服务器 16.04.2 LTS 中运行我的脚本

标签 linux bash ubuntu unix server

我想实现两件事:

1.自动登录
2.自动登录后运行/scripts/bootstrap.sh(前台不后台)。

我尝试使用 /etc/systemd/system/... 并将我的脚本作为服务运行,但它始终在后台运行。我也尝试通过 /etc/rc.local 运行它,但它在我不想要的登录提示之前开始运行。

任何帮助将不胜感激。谢谢!

最佳答案

/usr/share/xsessions/bootstrap.desktop

[Desktop Entry]
Name=bootstrap
Comment=Auto start without password
Exec=xterm -e /scripts/bootstrap.sh
#Exec=xterm
Type=Application
Terminal=true

/etc/lightdm/lightdm.conf

[Seat:*]
autologin-user=user
autologin-session=bootstrap
xserver-command=X -s 0 -dpms

关于linux - 使用 super 用户访问权限自动登录并在 Ubuntu 服务器 16.04.2 LTS 中运行我的脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42860909/

相关文章:

linux - 网络感知 wx.FileDialog

mysql - 在 Ubuntu 上安装 luaSQL

node.js - Puppeteer - Chrome |无法打开 X 显示器 | Ubuntu 20.04

linux - 我如何限制 bash 中的历史记录项的数量?

linux - Bash 和 awk - 在进行多行模式数学运算时如何将变量传递给 awk?

linux - 退出 bash 脚本但保持进程运行

Android Studio 和 Linux

linux - 嵌入式 Linux 上的 Qt 应用程序自动运行 - "xcb"错误

linux - 使用需要输入的命令在脚本内部执行 sudo (bash)

linux - 统计bash中可执行文件的数量