为什么我不能访问该文件夹? [英] Why can't I access this folder?

查看:111
本文介绍了为什么我不能访问该文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前一段时间,我买了一个1TB USB外置驱动器.我在Ubuntu中对ext4进行了格式化,并从多台计算机上将一堆文件/文件夹复制到了文件中,所有文件/文件夹都分别复制到了/home/machinename/whatever.

A while back I bought a 1TB USB external drive. I formatted it ext4 in Ubuntu and copied a bunch of files / folders to it from several machines, all to /home/machinename/whatever, respectively.

在某个时候,我在上面运行了chmod -R shell命令来更改权限.那是几个月前的事,我记不清键入的内容了,但它是驱动器,因此我只能以root用户身份访问其/home文件夹.这不是问题,因为我仍然可以访问所有内容,但是今天我决定尝试对其进行修复.

At some point I ran a chmod -R shell command on it to change the permissions. That was months ago and I don't remember what I typed but it made the drive so I could only access its /home folder as root. This wasn't a problem because I could still access everything, but today I decided to try to fix it.

我以root身份进入我的shell,进入该驱动器并键入:

I went to my shell as root, went to that drive and typed:

chown -R rick:rick ./
chmod -R 666 ./

似乎有效.该主目录及其中的所有其他内容现在都显示为rw:

It seemed to work. That home directory and everything else in it now shows up as rw for each:

rick@rick64:/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee$ ls -l
drw-rw-rw- 7 rick rick 4096 2012-03-04 13:08 home

因此,如果我尝试使用shell访问该目录,则会得到:

So, if I try to access that directory with the shell, I get:

rick@rick64:/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee$ ls -l
drw-rw-rw- 7 rick rick 4096 2012-03-04 13:08 home
rick@rick64:/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee$ cd home
bash: cd: home: Permission denied
rick@rick64:/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee$ _

当我用nautilus访问它时,我可以在/home/文件夹中看到多个计算机名称,但是它们都带有文件图标.我可以右键单击它们,然后选择属性",但这不会让我看到权限.

When I access it with nautilus I can see the multiple machine names within the /home/ folder, but they all appear with a file icon. I can right-click on them and choose "Properties" but it won't let me see the permissions.

我很困惑.为什么我不能访问该文件夹?我是主人?我什至是小组.我有读写特权.我在做什么错了?

Am baffled. Why can't I access that folder? I'm the owner? I'm even the group. I have r/w privileges. What am I doing wrong?

推荐答案

您既不会尝试读取(列出)目录,也不会尝试写入(创建新条目)目录.您想输入它,因此需要e x exute权限(对于目录,名称略有错误.)

You're neither trying to read (list) nor write (create a new entry) the directory. You want to enter it, therefore you need (slightly misnamed in the case of directories) exexute permissions.

这篇关于为什么我不能访问该文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆