日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

登录环境故障的原理及解决办法? -bash-4.1$ -bash-4.1$

發布時間:2025/4/16 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 登录环境故障的原理及解决办法? -bash-4.1$ -bash-4.1$ 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

請問如下登錄環境故障的原理及解決辦法?

1

2

-bash-4.1$?

-bash-4.1$

此情況一般是因為用戶刪除文件的時候,把當前用戶的家目錄的一些隱藏文件刪除所導致的(把自己老家端了)。

導致.bashrc .bash_profile沒了,與用戶有關的環境變量也沒了。

1

2

3

4

5

[root@kaile ~]# ll -a .bash*?

-rw-------. 1 root root 32635 Apr 11 23:30 .bash_history

-rw-r--r-- ?1 root root ? ?41 Jun 25 ?2016 .bash_logout

-rw-r--r-- ?1 root root ? 176 Sep ?6 ?2016 .bash_profile

-rw-r--r-- ?1 root root ? 177 Sep ?6 ?2016 .bashrc

解決方法:把用戶老家的模板/etc/skel下面的


1

2

3

4

5

6

7

[root@kaile ~]# ll -a ?/etc/skel/

total 28

drwxr-xr-x. ?2 root root ?4096 Dec ?3 ?2015 .

drwxr-xr-x. 87 root root 12288 Apr 10 09:06 ..

-rw-r--r--. ?1 root root ? ?18 Sep 23 ?2015 .bash_logout

-rw-r--r--. ?1 root root ? 176 Sep 23 ?2015 .bash_profile ? ###復制這個文件到出問題的用戶家里

-rw-r--r--. ?1 root root ? 124 Sep 23 ?2015 .bashrc ? ? ? ? ###復制這個文件到出問題的用戶家里


假設當前用戶

切換到出問題的用戶

1

2

3

-bash-4.1$whoami?

oldgirl

-bash-4.1$

復制用戶老家的模板給出問題的用戶

1

2

3

4

5

6

7

8

9

-bash-4.1$cp /etc/skel/.bash* ~

-bash-4.1$ll -a?

total24

drwx------ ? 2 oldgirl incahome 4096 Feb 14 15:07 .

drwxr-xr-x.10 root ? ?root ? ? 4096 Feb 14 14:53 ..

-rw------- ? 1 oldgirl incahome ? 14 Feb 14 15:05 .bash_history

-rw-r--r-- ? 1 oldgirl incahome ? 18 Feb 14 15:07 .bash_logout

-rw-r--r-- ? 1 oldgirl incahome ?176 Feb 14 15:07 .bash_profile

-rw-r--r-- ? 1 oldgirl incahome ?124 Feb 14 15:07 .bashrc

重新登錄進行測試

1

2

3

-bash-4.1$logout

[root@kaiel ~]# su - ceshi



轉載于:https://blog.51cto.com/kaile/1915111

總結

以上是生活随笔為你收集整理的登录环境故障的原理及解决办法? -bash-4.1$ -bash-4.1$的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。