gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 12:32:39 25 4
gpt4 key购买 nike

我想实现两件事:

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/

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