kali添加開機(jī)自啟的方法
kali添加開機(jī)自啟
采用systemd
的方法,kali默認(rèn)是沒有rc.local
的,需要自己創(chuàng)建。本方法也適用于ubuntu 18.04 64bit
改寫rc-local.service 文件
先從lib中拿出模板文件進(jìn)行更改
sudo cp /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service
再vim修改
sudo vim /etc/systemd/system/rc-local.service
主要是添加[install]
復(fù)制最下面的[install]即可
# SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # This unit gets pulled automatically into multi-user.target by # systemd-rc-local-generator if /etc/rc.local is executable. [Unit] Description=/etc/rc.local Compatibility Documentation=man:systemd-rc-local-generator(8) ConditionFileIsExecutable=/etc/rc.local After=network.target [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 RemainAfterExit=yes GuessMainPID=no [Install] WantedBy=multi-user.target
創(chuàng)建/etc/rc.local文件
sudo vim /etc/rc.local
#!/bin/bash #!/bin/bash # # 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/ki/桌面/frp_0.36.2_linux_amd64/frpc -c /home/ki/桌面/frp_0.36.2_linux_amd64/frpc.ini & exit 0
注意,注釋到執(zhí)行代碼這片區(qū)域中間不要有空行。不然該服務(wù)會(huì)將空行當(dāng)命令執(zhí)行,所以就會(huì)報(bào)錯(cuò)。命令后面我加上&
是表示在后臺(tái)執(zhí)行
設(shè)置執(zhí)行權(quán)限
sudo chmod a+x /etc/rc.local
檢查腳本是否正確
含義分別是重載服務(wù),啟動(dòng)服務(wù),查看服務(wù)狀態(tài)
sudo systemctl enable rc-local sudo systemctl start rc-local.service sudo systemctl status rc-local.service
可能出現(xiàn)的問題
- 出現(xiàn)active,但是下面日志出現(xiàn)報(bào)錯(cuò)
則你的systemd
服務(wù)順利執(zhí)行了。但是你的/etc/rc.local
腳本有問題。自己執(zhí)行下這個(gè)命令看看能不能正確執(zhí)行該腳本。不能那就檢查腳本代碼,注意不要出現(xiàn)空行。重新檢查文件執(zhí)行權(quán)限
./etc/rc.local
- 沒顯示active
那么就是你的/etc/systemd/system/rc-local.service
寫的不對(duì)。重新檢查下,特別是[install]
部分
到此這篇關(guān)于kali添加開機(jī)自啟的文章就介紹到這了,更多相關(guān)kali開機(jī)自啟內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
MAC系統(tǒng)IDEA顏值插件MaterialThemeUI
俗話說,工欲善其事必先利其器。工具的顏值也很重要,好的主題讓人賞心悅目,有碼代碼的欲望。今天推薦一個(gè)IDEA顏值類插件:Material Theme UI2021-09-09Git多人協(xié)同開發(fā)緊急修復(fù)線上bug操作指南
這篇文章主要為大家介紹了Git多人協(xié)同開發(fā)緊急修復(fù)線上bug操作指南,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-06-06微信 小程序開發(fā)環(huán)境搭建詳細(xì)介紹
這篇文章主要介紹了微信 小程序開發(fā)環(huán)境搭建詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下2016-09-09PostMan接口測(cè)試用例自動(dòng)轉(zhuǎn)成Python的測(cè)試腳本
PosMan做服務(wù)端的自動(dòng)化測(cè)試中,我們可以把Collection里面的測(cè)試用例導(dǎo)入出來,它是JSON的文件,然后我們解析這些JSON文件,讓它自動(dòng)的轉(zhuǎn)成Python測(cè)試代碼,實(shí)現(xiàn)了PostMan里面的接口測(cè)試用例自動(dòng)的轉(zhuǎn)成了Python的測(cè)試腳本,而且?guī)Я藬嘌?/div> 2024-06-06最新評(píng)論