【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 \~\]$

相关推荐
破刺不会编程15 分钟前
系统的环境变量
linux·运维·服务器·windows
UFIT20 分钟前
Nginx 核心功能笔记
运维·笔记·nginx
2302_7995257426 分钟前
【Linux】第十三章 访问Linux文件系统
linux·运维·服务器
磨叽的鱼30 分钟前
Ubuntu实现远程文件传输
linux·服务器·ubuntu
桦01 小时前
Linux[配置vim]
linux·vim·excel
白总Server1 小时前
智能座舱架构中芯片算力评估
linux·运维·服务器·开发语言·ai·架构·bash
Linux运维老纪2 小时前
Ansible 守护 Windows 安全(Ansible Safeguards Windows Security)
linux·windows·网络安全·自动化·云计算·运维开发·asible
bjzhang753 小时前
重启CentOS系统的rsyslogd服务
linux·centos·rsyslogd服务
Lw老王要学习3 小时前
Linux基础篇、第一章_01_3安装虚拟机手动安装部署Ubuntu22.04服务器
linux·运维·云计算
jsons13 小时前
Cliosoft安装
linux·运维·服务器