Solved

CHMOD on folders - How do I know what the current CHMOD is on a folder? What ones are there?  Linux N00b

Posted on 2011-03-15
11
542 Views
Last Modified: 2012-05-11

Ive a linux friend helping me with Samba.
I don’t want to ask him everything.

Chmod will be changed on a few shares.
I would like to compare the CHMODs that are there now before they are changed to see what has been done and better understand.

So how do I know the current CHMOD on a folder?
 

0
Comment
Question by:fcek
  • 5
  • 4
  • 2
11 Comments
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 125 total points
ID: 35139191
ls -ld foldername
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 375 total points
ID: 35139225
With CHMOD you mean permissions, don't you?

Check permissions of a folder (a "directory" in Linux!) with

ls -ld directoryname

The first 9 characters are the ones you're searching for.

The first one indicates the type (directory (d), regular file (-), link (l) etc).

The next three triplets indicate permissions (r=read, w=write, x=execute/scan) for owner, group, others.

Octal representation is 4=read, 2=write, 1=execute, so

drwxr-xr-x

is actually a directory with octal permissions 755.

wmp
0
 

Author Comment

by:fcek
ID: 35141489

Hi what chmod is the most open for a folder - Im setting up a share and only one user on samba can access it.  Two others cant.

The two that cant are listed in " give access to these users"
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 375 total points
ID: 35141619
Which kind of access are you talking about? Read, Write, Execute/Scan?

The most open setting is "rwx", obviously, so the command to give these permissions to  "others" (i.e. users neither owning the directory nor being members of the group owning it) would be:

chmod o+rwx directory

See "man chmod" for details!

wmp
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35141668
chmod 777 foldername

is the most you can get.  It gives total permission for everything  -- not a very good practice though

you can also do

chmod -R 777 folder
would make the least restrictive permissions for the folder and its contents.
0
 

Author Comment

by:fcek
ID: 35141881



Is there a way to see the current permissions or chmod status on a folder?

I have a working example on another server but dont want to change it, but would be interested in copying its permissions on its shares to see the result.
 

0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35141904
See my very first comment!
0
 

Author Comment

by:fcek
ID: 35142270




drwxrwxrwx. 18 root root 4096 Mar  8 19:16 users-personal
[ed@server1 users folders]$ ls -ld admin-private
drwxrwxrwx. 5 root root 4096 Mar 15 03:55 admin-private
[ed@server1 users folders]$ ls -ld admin-public
drwxrwxrwx. 2 root public 4096 Mar 14 22:52 admin-public

Not knowing Linux / Samba - I cant tell what mod this is in this example.  
They all appear to be the same mod.
What mod?


 





0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 375 total points
ID: 35142314
As I wrote - look at my very first comment!

Anyway, here you go:

First letter "d" - directory
First triplet "rwx" - read/write/scan for owner "root"
Second triplet "rwx" - read/write/scan for group "root"
Third triplet "rwx" - read/write/scan for "all others"

That's the same as "777" or, in the symbolic form "ugo=rwx"

0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35142347
Btw. that's the most open setting you can have. Open like a barn door for just everyone.
0
 

Author Comment

by:fcek
ID: 35142445

woolmilkporc:

That was very well explained there!
My pall is not explaining things very well to me!

And thanks to everyone else as well.

You all have the patience of Jobe!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question