我在手机上设置了 VNC,因为我使用 Linux 来做一些 Android 无法做到的事情。我想知道如何从我的手机重启电脑,而不用去电脑上实际输入命令。
sudo -s
导出显示=:0.0
xhost +
/usr/lib/vino/vino 服务器 &
我试过用谷歌,但没有找到任何东西,希望能够得到帮助。
我做了终端的事情但是它不起作用它看起来像这样
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/jonluke/SSH.sh &
exit 0
~
~
~
~
~
~
~
~
~
答案1
如果您想在启动时启动 VNC,请将您的脚本保存到磁盘上的某个位置.sh
,在终端中运行chmod a+x yourscriptname
(使其可执行)并将其添加到 /etc/rc.local;
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/path/to/your/script &
exit 0
注意尾随&
和最后的exit 0
;这将运行脚本,然后继续启动过程并且不会阻止任何东西。