kali?linux?無法登錄root的問題及解決方法
kali linux 無法登錄root
1、問題描述
kali linux 無法登錄root
1.1、本地登錄root
本地?zé)o法登錄root,無法登陸,提示:Login Failed

1.2、ssh遠(yuǎn)程登錄root
ssh遠(yuǎn)程登錄root,無法登陸,提示:身份驗(yàn)證被拒絕,請(qǐng)重試。

2、解決方法
官方文檔:https://www.kali.org/docs/general-use/enabling-root/
2.1、為什么需要使用root登錄
Permanent vs temporary usage
永久使用與臨時(shí)使用
There are some cases where you may need to use superuser, root, for an extended period of time. In these cases we can easily access the root account with a simple sudo su (which will ask for the current user’s password), selecting the root terminal icon in the Kali menu, or alternatively using su - (which will ask for the root user’s password) if you have set a password for the root account that you know of. When finished, exit or CTRL+D will take us out of this elevated shell.
However, there may be other times where you may want to use root across multiple sessions without the hassle of elevating privileges. In these situations we will need to install a package and make a few modifications to fully enable the root account for use due to security reasons of keeping the root account disabled by default.
在某些情況下,您可能需要長(zhǎng)時(shí)間使用超級(jí)用戶root。在這些情況下,我們可以通過簡(jiǎn)單的sudo su(將詢問當(dāng)前用戶的密碼),選擇Kali菜單中的root終端圖標(biāo),或者使用su -(將詢問root用戶的密碼)輕松訪問root帳戶,如果您已經(jīng)為您知道的root帳戶設(shè)置了密碼。完成后,exit或CTRL+D將帶我們離開這個(gè)升高的shell。
但是,在其他情況下,您可能希望在多個(gè)會(huì)話中使用root權(quán)限,而無需提升權(quán)限。在這些情況下,我們需要安裝一個(gè)軟件包,并進(jìn)行一些修改,以完全啟用根帳戶使用,因?yàn)槟J(rèn)情況下保持根帳戶禁用的安全原因。
2.2、啟用root帳戶
The first thing to do is set a root password, which should be different to the current user’s password (in this case kali). We can do this by doing the following:
首先要做的是設(shè)置一個(gè)root密碼,該密碼應(yīng)與當(dāng)前用戶的密碼不同。我們可以通過以下方式做到這一點(diǎn):
點(diǎn)擊任務(wù)欄的這個(gè)圖標(biāo) 作用是打開終端

sudo passwd
第一行輸入當(dāng)前用戶的密碼
第二行輸入root要設(shè)置的用戶密碼
第三行輸入root要設(shè)置的用戶密碼進(jìn)行密碼確認(rèn)

The next thing we need to decide is if we are wanting to use root via SSH or through the login prompt on whichever desktop environment is installed.
接下來我們需要決定的是,我們是想通過SSH還是通過安裝在任何桌面環(huán)境上的登錄提示符使用root。
2.3、啟用GNOME和KDE登錄的root
We will first install kali-root-login to change multiple configuration files that will permit us to login to the root account through the GNOME GDM3 and the KDE login prompt. This step is not necessary when using other desktop environments:
我們將首先安裝kali-root登錄,以更改多個(gè)配置文件,這些文件將允許我們通過GNOME GDM3和KDE登錄提示登錄到root帳戶。使用其他桌面環(huán)境時(shí),不需要執(zhí)行此步驟:
sudo apt -y install kali-root-login


注銷當(dāng)前用戶 然后使用root登錄


root登錄成功

2.4、啟用ssh遠(yuǎn)程登錄root
切換到root用戶
su root
輸入root用戶密碼

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
編輯/etc/ssh/sshd_config 在最后面添加一行內(nèi)容:PermitRootLogin yes
/etc/ssh/sshd_config

sudo systemctl restart ssh

再次使用ssh遠(yuǎn)程登錄 成功

補(bǔ)充:解決vmware虛擬機(jī)下 kali 無root權(quán)限問題
解決vmware虛擬機(jī)下 kali 無root權(quán)限問題
?? 問題描述
在使用vmware創(chuàng)建kali虛擬機(jī)時(shí)只創(chuàng)建了用戶賬戶,并沒有明確指定root賬號(hào)的密碼,因此在以普通用戶身份登入時(shí)輸入su root不知道root密碼是多少。
?? 問題解決
這是因?yàn)榇藭r(shí)壓根沒有設(shè)置root密碼,需要以普通賬戶的身份來設(shè)置root密碼,聽起來有些抽象,具體指令如下:
sudo passwd root
系統(tǒng)提示輸入當(dāng)前用戶的密碼,輸入之后會(huì)提示設(shè)置root賬戶的密碼,輸入即可。
到此這篇關(guān)于kali linux 無法登錄root的文章就介紹到這了,更多相關(guān)kali linux 無法登錄root內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
詳解Linux文件中的數(shù)據(jù)是如何被寫進(jìn)磁盤
Linux 中,我們的每一個(gè)進(jìn)程,打開的每一個(gè)文件都要有自己的 struct inode 對(duì)象和自己的文件頁(yè)緩沖區(qū)(就是所謂的內(nèi)核緩沖區(qū)),本文我們給大家介紹了Linux文件中的數(shù)據(jù)是如何被寫進(jìn)磁盤,需要的朋友可以參考下2024-05-05
Linux 配置SSH免密登錄 “ssh-keygen”的基本用法
SSH 是目前較可靠,專為遠(yuǎn)程登錄會(huì)話和其他網(wǎng)絡(luò)服務(wù)提供安全性的協(xié)議。利用 SSH 協(xié)議可以有效防止遠(yuǎn)程管理過程中的信息泄露問題,這篇文章主要介紹了Linux 配置SSH免密登錄 “ssh-keygen”的基本用法 ,需要的朋友可以參考下2019-06-06
Linux服務(wù)器快速搭建MinIO對(duì)象存儲(chǔ)全過程
在Linux服務(wù)器上搭建MinIO存儲(chǔ)服務(wù)器的步驟,MinIO支持從二進(jìn)制文件或包管理器下載,用戶需要配置環(huán)境變量、創(chuàng)建存儲(chǔ)目錄并設(shè)置服務(wù)權(quán)限,然后啟動(dòng)服務(wù)并訪問Web控制臺(tái)進(jìn)行驗(yàn)證,文章還提到可配置防火墻、Nginx反向代理及多節(jié)點(diǎn)部署2025-09-09
Linux CentOS 6.5 卸載、tar安裝MySQL的教程
這篇文章主要介紹了Linux CentOS 6.5 卸載、tar安裝MySQL的教程,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友參考下吧2019-11-11

