chmod 0777 not working like it should?

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
I'm having trouble deleting folders and files on my file server via Windows. When I try to delete, I got an Access is Denied error, make sure the disk is not full or write protected yadda yadda.

The drive is located at /mnt/2D. I did a chmod 0777 2D. Did ls -la|more to verify the change.

Within the drive 2D are a few folders: Movies, Torrents, and My Download Files

I can delete files and folders in Movies, but I cannot delete files or folders in Torrents or My Download Files :confused:

I tried doing a chmod 0777 to both Torrents and My Download Files, verified with ls -la|more, but the problem persists.

Any idea what's going on?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
First you should never use mode 777, if you need access to write to something make sure the owner and group are set properly. But otherwise it looks like you're on the right track, you need write permission to the parent directory in order to delete something from that directory.
 

pravi333

Senior member
May 25, 2005
577
0
0
but he is able to delete /mnt/2D/movies and why not /mnt/2D/torrents? how is the parent directory permission affected here?

try chmod -R 777 on the /mnt/2D/torrents directory or better yet try it on /mnt itself and if it lets you delete it then change back the permissions /mnt to a more secured one like 755 or something
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
try chmod -R 777

So you want to take a bad practice and apply it to everything? The OP said that the Torrents and My Download Files directores are now 777 so if files are undeletable in there then it's likely a Samba problem. If the files are in directories below those directories then yes the permissions will need to be changed all of the way down with chmod -R, but not to 777.
 

pravi333

Senior member
May 25, 2005
577
0
0
Originally posted by: Nothinman
try chmod -R 777

So you want to take a bad practice and apply it to everything? The OP said that the Torrents and My Download Files directores are now 777 so if files are undeletable in there then it's likely a Samba problem. If the files are in directories below those directories then yes the permissions will need to be changed all of the way down with chmod -R, but not to 777.

ha ha, ya thats a bad practice i agree, i should've put a disclaimer above :D
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Nevermind my original post.

You just need to set your Unix perms properly. What does ls -la say from inside /mnt?
 

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
Originally posted by: Nothinman
First you should never use mode 777, if you need access to write to something make sure the owner and group are set properly. But otherwise it looks like you're on the right track, you need write permission to the parent directory in order to delete something from that directory.

The stuff that I have is hardly deserving of any kind of security. It is far from mission critical and no one but myself will ever be accessing it. I just want completely free open access to it from my Windows box. Freedom to read, write, delete, format, anything with zero hassle, just like as if it was a local drive.

Originally posted by: cleverhandle
Nevermind my original post.

You just need to set your Unix perms properly. What does ls -la say from inside /mnt?

drwxrwxrwx 8 nobody nobody 4096 Dec 9 2006 .
drwxr-xr-x 22 root root 4096 Jul 3 18:14 ..
drwxrwxrwx 10 nobody nobody 4096 Dec 10 2006 2C
drwxrwxrwx 7 nobody nobody 4096 Dec 9 2006 2D
drwxrwxrwx 9 nobody nobody 4096 May 4 17:56 3F
drwxrwxrwx 8 nobody nobody 4096 Jul 21 12:14 Photo1
drwxrwxrwx 7 nobody nobody 4096 May 4 16:38 Photo2

(I've got 5 drives, 2C, 2D, 3F, Photo1, Photo2)
 

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
Originally posted by: pravi333
Originally posted by: Nothinman
try chmod -R 777

So you want to take a bad practice and apply it to everything? The OP said that the Torrents and My Download Files directores are now 777 so if files are undeletable in there then it's likely a Samba problem. If the files are in directories below those directories then yes the permissions will need to be changed all of the way down with chmod -R, but not to 777.

ha ha, ya thats a bad practice i agree, i should've put a disclaimer above :D

I did chmod -R 777 to /mnt and it works!
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The stuff that I have is hardly deserving of any kind of security. It is far from mission critical and no one but myself will ever be accessing it.

It's still a terrible habit to get into, find the root of the problem and fix it properly or you'll be doing that everywhere eventually.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: fuzzybabybunny
drwxrwxrwx 8 nobody nobody 4096 Dec 9 2006 .
drwxr-xr-x 22 root root 4096 Jul 3 18:14 ..
drwxrwxrwx 10 nobody nobody 4096 Dec 10 2006 2C
drwxrwxrwx 7 nobody nobody 4096 Dec 9 2006 2D
drwxrwxrwx 9 nobody nobody 4096 May 4 17:56 3F
drwxrwxrwx 8 nobody nobody 4096 Jul 21 12:14 Photo1
drwxrwxrwx 7 nobody nobody 4096 May 4 16:38 Photo2
Yag... that's horrible. Not only is everything 777, which is bad, but you've got everything owned by nobody. The whole point of nobody is that it shouldn't own anything. Nobody is supposed to be a safe UID for daemons and other processes to use because if the process misbehaves then it won't be able to affect any important files. Your current setup is throwing that out the window.

What exactly are you trying to accomplish with this share? Is this a personal share just for yourself? An "all share" kind of thing? Something else? Let's think about this from the ground up rather than just grasping at quick and extremely dirty hacks that circumvent all the security measures you're supposed to be taking advantage of.

 

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
Originally posted by: cleverhandle
Originally posted by: fuzzybabybunny
drwxrwxrwx 8 nobody nobody 4096 Dec 9 2006 .
drwxr-xr-x 22 root root 4096 Jul 3 18:14 ..
drwxrwxrwx 10 nobody nobody 4096 Dec 10 2006 2C
drwxrwxrwx 7 nobody nobody 4096 Dec 9 2006 2D
drwxrwxrwx 9 nobody nobody 4096 May 4 17:56 3F
drwxrwxrwx 8 nobody nobody 4096 Jul 21 12:14 Photo1
drwxrwxrwx 7 nobody nobody 4096 May 4 16:38 Photo2
Yag... that's horrible. Not only is everything 777, which is bad, but you've got everything owned by nobody. The whole point of nobody is that it shouldn't own anything. Nobody is supposed to be a safe UID for daemons and other processes to use because if the process misbehaves then it won't be able to affect any important files. Your current setup is throwing that out the window.

What exactly are you trying to accomplish with this share? Is this a personal share just for yourself? An "all share" kind of thing? Something else? Let's think about this from the ground up rather than just grasping at quick and extremely dirty hacks that circumvent all the security measures you're supposed to be taking advantage of.

It's a personal share just for myself. No one else will ever be accessing it. I want it to function exactly as if it were a hard drive attached directly to my computer, or an external hard drive.

I wouldn't ever use this kind of setup for anything that needs any kind of security.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: fuzzybabybunny
It's a personal share just for myself. No one else will ever be accessing it.
Then you should have an account on the Linux machine with the same username as your Windows username. And you should use smbpasswd to add an SMB username and password that match your Windows user/pass exactly. Then, after changing the ownership on those files to that user and setting sane modes, everything should work.

I want it to function exactly as if it were a hard drive attached directly to my computer, or an external hard drive.
Fine. Map the share as a drive once it's set up.

I wouldn't ever use this kind of setup for anything that needs any kind of security.
It doesn't matter. Learn to do things the right way the first time, so that you don't have to think about it again. And so that, if there *is* a problem of some sort in the future, you don't waste other people's time by running a degenerate setup. I hate posting back and forth with people only to find out, 20 posts in, that their setup is bizarrely non-standard because they used some cheap hack when they set it up, which they most likely forgot about in the interim.