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

相关推荐
Xの哲學5 小时前
Linux流量控制: 内核队列的深度剖析
linux·服务器·算法·架构·边缘计算
tuokuac5 小时前
docker中nginx配置报错解决
linux·运维·服务器
Zeku5 小时前
20251129 - 详细解析Linux的mmap(内存映射)
linux·驱动开发·嵌入式软件·linux应用开发
Joren的学习记录6 小时前
【Linux运维大神系列】docker详解(四)
linux·运维·docker
老王熬夜敲代码7 小时前
网络中数据传输的具体过程
linux·网络·笔记
Elastic 中国社区官方博客7 小时前
让我们把这个 expense 工具从 n8n 迁移到 Elastic One Workflow
大数据·运维·elasticsearch·搜索引擎·ai·信息可视化·全文检索
世转神风-7 小时前
linux使用终端打开当前文件夹界面
linux
( •̀∀•́ )9208 小时前
GitHub Actions SSH 部署密钥
运维·ssh·github
louqle8 小时前
docker基本知识及常用命令汇总
运维·docker·容器
刘某的Cloud8 小时前
列表、元组、字典、集合-组合数据类型
linux·开发语言·python