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

相关推荐
Eric.Lee202112 小时前
ubuntu 安装 Miniconda
linux·运维·python·ubuntu·miniconda
会飞的土拨鼠呀13 小时前
通过Linux进程id找到程序路径
linux·服务器·网络
杭州泽沃电子科技有限公司13 小时前
在线监测:为医药精细化工奠定安全、合规与质量基石
运维·人工智能·物联网·安全·智能监测
行初心13 小时前
uos基础 cupsd.conf 查看打印服务的配置文件
运维
1***y17813 小时前
Git在发布流程中的自动化标签
运维·git·自动化
8***848213 小时前
如何在Linux中找到MySQL的安装目录
linux·运维·mysql
9***J62814 小时前
Linux下PostgreSQL-12.0安装部署详细步骤
linux·运维·postgresql
W***832014 小时前
如何在 Ubuntu 22.04 上安装 MySQL
linux·mysql·ubuntu
gggg远14 小时前
docker详解
运维·docker·容器
wanhengidc15 小时前
云手机中的数据通常存储在哪里?
运维·服务器·安全·web安全·智能手机