[x] Welcome to LinuxSolved.com Linux help forums, here we are a community of Linux users helping each other. It is helpful to both ie. new linux users as well experienced one. We always have our experts to help you and ofcourse members help each other, so you can ask for help any time by Registering.: Click to Register

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Linux Forums - Linux Help,Advice & support community:LinuxSolved.com  |  Forum  |  Others  |  Miscellaneous  |  Topic: Chmod help in Linux and Ftp and windows 777, 666 ?
The LinuxSolved.com GNU/Linux User Communit - Forum
Welcome to LinuxCommunity You have just arrived to a friendly linux community which is helping Linux Users from Years.. You can be its part if you have not already joined it. Registration is FREE and is gateway to unlimited help and support to all your linux related needs. If you are an GNU/Linux supporter then you have come to the right place.
Pages: [1]
  Print  
Author Topic: Chmod help in Linux and Ftp and windows 777, 666 ?  (Read 2106 times)
0 Members and 1 Guest are viewing this topic.
linuxhelp
New Member

Offline Offline

Posts: 1


View Profile
« on: February 10, 2004, 01:14:31 AM »

HI..
I am using windows but  i am having hosting on a linux server , wht I see there that it has some ftp chmoding..   When i searched through i found that chmod is actually a Linux Command.. wht is it , how it works, and wht are those NOs ?
Please help me out..
Logged
Ricky
LST CareTaker
Specially Skilled
*****
Offline Offline

Gender: Male
Posts: 2215


View Profile
« Reply #1 on: February 10, 2004, 01:52:11 AM »

Nothing to confuse here.. Chmod is actually a linux command which sets the permission for a file.. ie. who can access those files and who can not . Or the file is executable or not...
Chmod give gives the code for permission.. those are like. 677 or 777 or 755 more
Well here 777 means read write and execute by all..

I can be little more decriptive.. So
it has got mostly three digits some times there can be four .. that is not for you!!
Now. first digit is for owners persmissions setting, second is for group and third is for others..

Now
7 = all allowed.
4 = read only
2 = write
5 = read and execute
1 = execute

and when we say 755 the we are saying that owner has full permission (7) and group has only to read and execute (5) and also same for others (5) ..
I hope you get it...
or need more explanation....


Please point me .. if i have done any error..
Logged
aaa
Tux Awared
**
Offline Offline

Posts: 38


View Profile
« Reply #2 on: February 10, 2004, 12:26:47 PM »

Here's an example I found on Google:
-rw-r--r--   1 wilker   topology   337127 Aug  5 12:54 BOliver97.gif
permissions:-rw-r--r--
user: wilker
group: topology
size: 337127
Modification date: Aug  5 12:54
filename: BOliver97.gif

Permissions are like this:
-rwxrwxrwx

Note the three sets of 'rwx'. They represent what someone is allowed to do with a file. The first three are for what you (or the owner, the one who made the file) can do with the file. The second is for people of the file's group. The third 'rwx' is for everybody else.
The group is something users can be a member of. Say there was a 'ourgroup' group. If you are in this group, the files you make will be in this group. Anyone else in this group can access the file according to how the second 'rwx' dictates.
rwx: R is for Read, W for Write, and X for eXecute. rwxrwxrwx means anyone is allowed to do anything with the file. If a place where a letter would be has a dash (r-- instead of rwx), these actions are not allowed on the file by that category of people (owner,group,world).

Let's look at the example:
-rw-r--r--
The first dash is for something other than permissions. We see a 'rw-' after this. This is for the owner (wilker). He can Read and Write the file, but can't eXecute (can you execute a picture?).
Next we see 'r--'. This is for whoever is in the 'topology' group. W is blanked, so the file can't be modified. It is still readable.
The last three are also 'r--'. The rest of the world also only has read-only access.

Now for how to change these permissions with chmod. There are two ways to do it numbers (777) and letters (a+rwx).

Here's a way to remember the numbers:

rwxrwxrwx
['r'+'w'+'x'] ['r'+'w'+'x'] ['r'+'w'+'x']
[4+2+1] [4+2+1] [4+2+1]
7 7 7
777

rw-r--r--
["r"+"w"+"-"] ["r"+"-"+"-"] ["r"+"-"+"-"]
[4+2+0] [4+0+0] [4+0+0]
6 4 4
644

'chmod 644 [file]' gives 'rw-r--r--' permissions


The letters work like so:
chmod [a letter (u,g,o, or a)][+ or -][new permissions(like rwx)]
chmod u+rw
u means users (we are adding (not replacing) rw permissions to the first rwx)
g is for group (g+rw to add permissions to second rwx)
o is for the third rwx, everybody else
a is for everybody (rwxrwxrwx, not just three).

Examples:

chmod 777 a_file
a_file now has rwxrwxrwx permissions

chmod 666 a_file
a_file now has rw-rw-rw- permissions

chmod 644 a_file
a_file now has rw-r--r-- permissions

The letter style adds permissions, while the number style replaces them. The end result with letter style is dependent on how the file was before.
See man page for more details:
http://unixhelp.ed.ac.uk/CGI/man-cgi?chmod

BTW, Ricky, what is the fourth number for?
Quote
The first  digit  selects the set user ID (4) and set group ID (2) and save text image (1) attributes.
I saw this i the man page, but didn't get it .
Logged
Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
   

 Logged
Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Linux printer share to windows Linux Printing Support manohhh 1 1917 Last post August 27, 2004, 07:21:43 AM
by Ricky
windows-linux Lan help please General Networking Support in Linux stathis 3 905 Last post September 28, 2004, 01:27:48 AM
by dragoncity99
accessing windows from linux Linux Installation Support carobee 7 815 Last post July 14, 2007, 07:24:01 AM
by compgeek
Linux installation with Windows Vista present Miscellaneous leejones 2 195 Last post September 22, 2008, 07:49:17 AM
by Ricky
How To Deploy A Linux LiveCD on Windows Without Burning A CD Miscellaneous bochiman 1 279 Last post September 25, 2008, 02:22:01 AM
by aktiwari4u
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 09:15:56 PM

Login with username, password and session length
Navigation
Recent Discussions
[November 29, 2008, 02:23:49 PM]

[November 29, 2008, 02:14:14 PM]

[November 29, 2008, 04:00:36 AM]

[November 28, 2008, 07:05:28 AM]

[November 28, 2008, 07:04:39 AM]

[November 28, 2008, 06:58:16 AM]

[November 28, 2008, 06:47:09 AM]

[November 26, 2008, 11:53:32 AM]

[November 26, 2008, 04:00:22 AM]

[November 25, 2008, 06:44:47 PM]
Members
Total Members: 6252
Latest: rash31
Stats
Total Posts: 8285
Total Topics: 2257
Online Today: 34
Online Ever: 111
(June 28, 2007, 06:47:29 AM)
Users Online
Users: 0
Guests: 7
Total: 7
Privacy Policy| Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Theme & TinyPortal v0.9.8 © Bloc