【Linux】解决切换用户出现bash-4.2$问题

切换用户出现 bash 4.2 问题

出现 bash 4.2 错误 发现是用户指定家目录下 缺少2个隐藏文件

这题前提条件 我指定的家目录是 /opt/{孙悟空,猪八戒,唐僧,沙悟净}

/etc/skel/.bashrc /etc/skel/.bash_profile 传过去后显示登录成功

问题展示:

root@localhost \~\]# su sunwukong bash-4.2$ ll bash: ll: 未找到命令 bash-4.2$ 更新隐藏文件 root用户下 source \~/.bashrc source \~/.bash_profile 使用root用户登录,在用户指定的家目录中传入2个隐藏文件 cp /etc/skel/.bashrc /opt/孙悟空 cp /etc/skel/.bash_profile /opt/孙悟空 cp /etc/skel/.bashrc /opt/沙悟净 cp /etc/skel/.bash_profile /opt/沙悟净 cp /etc/skel/.bashrc /opt/唐僧 cp /etc/skel/.bash_profile /opt/唐僧 cp /etc/skel/.bashrc /opt/猪八戒 cp /etc/skel/.bash_profile /opt/猪八戒 登录效果: \[root@localhost sunwukong\]# su sunwukong \[sunwukong@localhost \~\]$ ll 总用量 0 \[sunwukong@localhost \~\]$

相关推荐
Lzc7741 小时前
Linux网络的HTTPS
linux·https
我爱钱因此会努力2 小时前
ansible自动化运维入门篇
linux·运维·服务器·centos·自动化·ansible
CIb0la2 小时前
能保持精神专注的爱好能给生活带来种种积极的转变
运维·学习·生活
---学无止境---3 小时前
Linux中系统调用sys_symlink和sys_unlink函数的实现
linux
代码程序猿RIP3 小时前
【Etcd 】Etcd 详解以及安装教程
linux·数据库·etcd
tb_first4 小时前
Linux入门1(2/2)
linux
cellurw4 小时前
Day72 传感器分类、关键参数、工作原理与Linux驱动开发(GPIO/I²C/Platform/Misc框架)
linux·c语言·驱动开发
NextZeros4 小时前
基于CentOS安装LNMP
linux·centos
梁萌4 小时前
Linux安装mysql8.4.6
linux·运维·mysql安装·8.4.6
gtr20204 小时前
Ubuntu24.04 无法读取 U盘
linux