kali linux 開機輸入密碼無法進入界面

遇到開機成功輸入密碼後無法進入桌面(無線循環提示輸入密碼)。可能是由於改動/etc/profile導致的,此時可以重新啓動計算機在系統選擇的時候選擇advanced選項進入無界面終端模式。
使用命令

vim /etc/profile

打開profile文件將文件還原爲初始狀態(一般的可能是因爲添加了export導入新環境變量)
直接複製一下配置文件覆蓋原配置即可

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

一般linux修改環境變量請在根目錄中的.bashrc文件中更改。另附一個stackoverflow中的解決方案沒試過,但應該是有用的kali開機死循環在填寫用戶名密碼界面

發佈了28 篇原創文章 · 獲贊 20 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章