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

相关推荐
ajassi200035 分钟前
开源 python 应用 开发(三)python语法介绍
linux·python·开源·自动化
o不ok!40 分钟前
Linux面试问题-软件测试
linux·运维·服务器
DaxiaLeeSuper1 小时前
Prometheus+Grafana+node_exporter监控linux服务器资源的方案
linux·grafana·prometheus
尽兴-2 小时前
如何将多个.sql文件合并成一个:Windows和Linux/Mac详细指南
linux·数据库·windows·sql·macos
kfepiza2 小时前
Netplan 中 bridges、bonds、ethernets、vlans 之间的关系 笔记250711
linux·tcp/ip·shell
小小不董2 小时前
深入理解oracle ADG和RAC
linux·服务器·数据库·oracle·dba
宇钶宇夕3 小时前
SIMATIC S7-1200的以太网通信能力:协议与资源详细解析
运维·服务器·数据库·程序人生·自动化
杰夫贾维斯4 小时前
CentOS Linux 8 的系统部署 Qwen2.5-7B -Instruct-AWQ
linux·运维·人工智能·机器学习·centos
kfepiza4 小时前
Netplan 配置网桥(Bridge)的模板笔记250711
linux·tcp/ip·ubuntu