mkdir提示cannot create directory问题解决方案
报错信息
shellubuntu@VM-24-16-ubuntu:~$ mkdir test mkdir: cannot create directory ‘test’: Permission denied问题原因:$代表普通用户模式,权限不够
解决方案:使用root账号创建文件夹
密码不知道或者忘记
shell# 使用 su - 命令切换到root账号 ubuntu@VM-24-16-ubuntu:~$ su - Password: su: Authentication failure通过命令修改root账号密码
shellubuntu@VM-24-16-ubuntu:/$ sudo passwd ubuntu New password: Retype new password: passwd: password updated successfully修改完后,切换到root账号创建文件夹
shellubuntu@VM-24-16-ubuntu:/$ su - Password: root@VM-24-16-ubuntu:~# mkdir test创建完毕后,执行exit退出root账号
shellroot@VM-24-16-ubuntu:/# exit logout