重庆思庄Oracle、Redhat认证学习论坛

标题: su: warning: cannot change directory to /home/mysql: No such file or directory [打印本页]

作者: jiawang    时间: 2024-9-2 14:18
标题: su: warning: cannot change directory to /home/mysql: No such file or directory
本帖最后由 jiawang 于 2024-9-2 14:18 编辑

报错现象:
[root@sztech home]# su - mysql
su: warning: cannot change directory to /home/mysql: No such file or directory
-bash-4.2$ ^C
-bash-4.2$

解决办法:
[root@sztech ~]# cd /home/
[root@sztech home]# ll
total 0
drwx------. 7 oracle oinstall 169 Aug  5 15:47 oracle
drwx------. 3 sztch  sztch     78 May 27 11:11 sztch

[root@sztech home]# mkdir /home/mysql
[root@sztech home]# chmod 755 /home/mysql
[root@sztech home]# ls
mysql  oracle  sztch

[root@sztech home]#  cp -a /etc/skel/. /home/mysql/
[root@sztech home]# su - mysql
Last login: Sun Sep  1 22:23:27 CST 2024 on pts/6
[mysql@sztech ~]$ id
uid=988(mysql) gid=1003(mysql) groups=1003(mysql) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023










欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2