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
556 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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é.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

738 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