我在我的主文件夹中不小心运行了chmod 777 *命令,导致所有目录的权限都被更改了(但文件的权限没有变化)。
我该如何撤销这个操作?
我该如何撤销这个操作?
sudo chmod -R a+rwX,o-w /home/$USER
echo $USER
https://help.ubuntu.com/community/dmrcErrors
更多关于权限的信息:
https://help.ubuntu.com/community/FilePermissions
Ubuntu的家目录在21.04版本之前是以755权限创建的,但现在将降低为750权限,以防止其他系统用户能够读取新的家目录。sudo chmod -R a+rwX,o-rw /home/$USER
fred@z170-focal-k:~$ touch temp.txt
fred@z170-focal-k:~$ ll *.txt
-rw-rw-r-- 1 fred fred 0 May 19 09:11 temp.txt
fred@z170-focal-k:~$ sudo chmod sudo chmod -R a+rwX,o-rw /home/$USERa+rwX,o-rw /home/$USER/temp.txt
[sudo] password for fred:
fred@z170-focal-k:~$ ll *.txtsudo chmod -R a+rwX,o-rw /home/$USER
-rw-rw---- 1 fred fred 0 May 19 09:11 temp.txt
fred@z170-focal-k:~$ sudo chmod a+rwX,o-w /home/$USER/temp.txt
fred@z170-focal-k:~$ ll *.txt
-rw-rw-r-- 1 fred fred 0 May 19 09:11 temp.txt
sudo chmod -R a+rwX,o-rw /home/$USER
o-rwx
会有什么问题? - Frank Nchmod 755 *
cd /home/$USER
find . -type d -exec chmod -fv 755 {} \;
sudo chmod -R a+rwX,o-w /home/$USER
。 - oldfred