遇到開機成功輸入密碼後無法進入案頭(無線迴圈提示輸入密碼)。可能是由於改動/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"fiexport PATHif [ "${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 fifiif [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset ifi
一般linux修改環境變數請在根目錄中的.bashrc檔案中更改