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
530 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
 
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LDAP find expired users 8 72
Access_log 17 99
Reset Root Password on CentOS 6 4 44
wipe a usb using python 5 25
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
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…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now