问题描述
[root@gp01 ~]# su - gpadmin
Last login: Tue Jun 12 09:59:25 CST 2018 on pts/0
登陆显示下列提示<明显是家目录环境变量文件丢失>
bash 4.2-$
用户root与gpadmin家目录隐藏文件对比
用户root家目录隐藏文件情况
[root@gp01 gpadmin]# ls -la
total 322892
drwxr-xr-x 5 gpadmin gpadmin 4096 Jun 12 01:47 .
drwxr-xr-x. 8 root root 4096 Jun 9 13:45 ..
-rw-r--r-- 1 gpadmin gpadmin 10 May 12 16:56 all_hosts
-rw-r--r-- 1 gpadmin gpadmin 5 May 12 16:56 all_nomaster
-rw------- 1 gpadmin gpadmin 506 Jun 12 10:11 .bash_history
drwxrwxr-x 2 gpadmin gpadmin 4096 May 21 16:15 conf_dir
drwxrwxr-x 2 gpadmin gpadmin 4096 Jun 7 09:24 gpAdminLogs
-rwxr-xr-x 1 gpadmin gpadmin 731 May 12 23:12 gpcheck.cnf
-rw-rw-r-- 1 gpadmin gpadmin 617 May 12 17:37 gpconfigs
-rw-rw-r-- 1 gpadmin gpadmin 330035975 Jun 12 10:12 kill_others_pro.log
-rw-rw-r-- 1 gpadmin gpadmin 461 May 28 17:57 kill_others_pro.sh
-rwxrwxr-x 1 gpadmin gpadmin 222076 May 21 14:55 nmon
drwx------ 2 gpadmin gpadmin 4096 Jun 12 01:47 .ssh
[root@gp01 gpadmin]#
用户gpadmin家目录隐藏文件情况
[gpadmin@gp02 ~]$ ls -la
total 260
drwxr-xr-x 4 gpadmin gpadmin 4096 May 21 14:55 .
drwxr-xr-x. 6 root root 4096 May 22 10:01 ..
-rw------- 1 gpadmin gpadmin 1064 May 28 09:04 .bash_history
-rw-r--r-- 1 gpadmin gpadmin 18 Sep 7 2017 .bash_logout
-rw-r--r-- 1 gpadmin gpadmin 193 Sep 7 2017 .bash_profile
-rw-r--r-- 1 gpadmin gpadmin 231 Sep 7 2017 .bashrc
drwxrwxr-x 2 gpadmin gpadmin 4096 Jun 7 09:24 gpAdminLogs
-rwxrwxr-x 1 gpadmin gpadmin 222076 May 21 14:55 nmon
drwx------ 2 gpadmin gpadmin 4096 May 12 16:57 .ssh
-rw------- 1 gpadmin gpadmin 595 May 12 21:20 .viminfo
解决方案
## 拷贝模版文件
># cd /etc/skel/
># cp .bash_logout /home/gpadmin
># cp .bash_profile /home/gpadmin
># cp .bashrc /home/gpadmin
># cd /home/gpadmin
># chown -R gpadmin.gpadmin .bash_logout
># chown -R gpadmin.gpadmin .bash_profile
># chown -R gpadmin.gpadmin .bashrc
## 配置 .bashrc
source /usr/local/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/data/master/gpseg-1
## 互信重做【发现信任丢失】
文档信息
- 本文作者:fei
- 本文链接:https://ayee1616166.github.io/2020/09/04/linux_bash4.2$%E9%97%AE%E9%A2%98%E4%BF%AE%E5%A4%8D%E6%AD%A5%E9%AA%A4/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)