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
561 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
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.
Suggested Courses

624 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