歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> Linux 用戶環境變量

Linux 用戶環境變量

日期:2017/3/3 11:24:29   编辑:Linux技術

用戶的環境變量配置文件不存在導致的問題

=================================================

模擬環境:

[root@zyl_apache ~]# su - 12

[12@zyl_apache ~]$ ll -a

total 24

drwx------. 2 12 12 4096 Jul 18 19:58 .

drwxr-xr-x. 17 root root 4096 Jul 17 19:08 ..

-rw-------. 1 12 12 156 Jul 18 19:58 .bash_history

-rw-r--r--. 1 12 12 18 Jul 18 19:51 .bash_logout

-rw-r--r--. 1 12 12 176 Jul 18 19:51 .bash_profile

-rw-r--r--. 1 12 12 124 Jul 18 19:51 .bashrc

[12@zyl_apache ~]$ rm -f .*

rm: cannot remove `.': Is a directory

rm: cannot remove `..': Is a directory

[12@zyl_apache ~]$ ll -a

total 8

drwx------. 2 12 12 4096 Jul 18 20:00 .

drwxr-xr-x. 17 root root 4096 Jul 17 19:08 ..

[12@zyl_apache ~]$ su -

Password:

[root@zyl_apache ~]# su - 12

-bash-4.1$

-bash-4.1$ =========>>>>>用戶的環境變量配置文件不存在導致

=================================================

解決:

[root@zyl_apache ~]# cp -a /etc/skel/.* /home/12

[root@zylclient /]# ll /home/12 -a

total 28

drwx------. 4 12 12 4096 Jul 18 19:43 .

drwxr-xr-x. 17 root root 4096 Jul 17 19:08 ..

-rw-r--r--. 1 root root 18 Jul 18 2013 .bash_logout

-rw-r--r--. 1 root root 176 Jul 18 2013 .bash_profile

-rw-r--r--. 1 root root 124 Jul 18 2013 .bashrc

drwxr-xr-x. 2 12 12 4096 Nov 12 2010 .gnome2

drwxr-xr-x. 4 12 12 4096 Jun 27 00:44 .mozilla

[root@zylclient /]# chown -R 12:12 /home/12/

[root@zylclient /]# su - 12

[12@zylclient ~]$ =========>>>>>OK!

[12@zylclient ~]$ ls -la

total 28

drwx------. 4 12 12 4096 Jul 18 19:43 .

drwxr-xr-x. 17 root root 4096 Jul 17 19:08 ..

-rw-r--r--. 1 12 12 18 Jul 18 2013 .bash_logout

-rw-r--r--. 1 12 12 176 Jul 18 2013 .bash_profile

-rw-r--r--. 1 12 12 124 Jul 18 2013 .bashrc

drwxr-xr-x. 2 12 12 4096 Nov 12 2010 .gnome2

drwxr-xr-x. 4 12 12 4096 Jun 27 00:44 .mozilla

=================================================

本文出自 “randolph” 博客,轉載請與作者聯系!

Copyright © Linux教程網 All Rights Reserved