YappoDollars
 

Category Admin & Servers

Unix File Permissions - CHMOD

TheDoc

Unix Permissions: chmod 777 - chmod 755 - chmod 666
Everyone at times needs to change the permissions on a file through a shell client like Putty even though you may be able to do this through your FTP / WS FTP. However you may still want or need to change file permissions through your a shell client like PuTTY. One can find a bit of enjoyment by stroking its own PuTTY.

Every file or directory on your UNIX machine has settings on who can read, write or execute that file. These are the permissions set on the file.

Below I have put together the basics of changing the ownership of a file and the commands to use.

In your unix shell window cd to the location of the file or directory you want to chmod. If the file name is hello.php then type chmod 777 hello.php or chmod 777 directory. Easy enough, the file permissions have been changed.

Most used chmod commands used:
chmod 777 filename or directory
chmod 755 filename or directory
chmod 666 filename or directory

What the basic file permissions mean: (the file owner is the user that uploaded the file)
chmod 755 : Read / Execute for everyone and write access for the file owner.
More: This changes the permissions on the file or directory to allow everyone to read or execute the file, and only the file owner is allowed to write to the file or write to that directory.

chmod 777 : Read / Write / Execute access for everyone.
More: This changes the permissions on the file or directory to allow everyone to read, execute, and write to the file or directory.

chmod 666 : Read / Write for everyone and execute access for the file owner.
More: This changes the permissions on the file or directory to allow everyone to read or write to the file or directory, and only the file owner is allowed to execute the file.

Extra Help With The chmod Command:
chmod 777 *.html (changes permission on any file name ending with the extension you put in. Such as *.html or *.php or *.jpg)
chmod 777 *.* (changes permission on all files with extensions in the directory)
chmod -R 755 directory/ (changes permission on all files & directories within that directory)

The -R means recursive.

Changing File Ownership:
Sometimes you may need to change the ownership of a file. Meaning, which logged in user is able to modify the files or directories. You may need to change the ownership of files back to your main user account if you moved files logged in as root.

This is rather simple to do. First you need to be logged in as root.
Just type: chown username file or directory

*If your normal ftp account username is Random1 and the directory is www you would type: chown Random1 www Now the files can be modified by user: Random1

More Advanced Permission & Other Info:
CatCode: Chmod Tutorial
PerFect: Understanding Unix Permissions
Online tool to help with file permission commands Easy & Quick

* Check out our Unix Command Cheat Sheet tutorial for a large listing & descriptions of UNIX commands.

Good Luck,
~ TheDoc


comments Make Comment

Unix Command Cheat Sheet

TheDoc

Below is a broken down list of Unix commands you may find useful within most Unix command shells.
General help & info: type text within quotes
help & help help Basic help listings.
man command Example: man whois Brings up the manual for that command.
* Press CTRL+C to escape from help, manual menus and other full window options.
Basic […]

Continue Reading: Unix Command Cheat Sheet

comments Make Comment

How to setup and use PuTTY

TheDoc

Download Putty : What Is Putty?
Make sure you download the putty.exe file from the Putty Website. Download it to your C:/ directory and click on it to start it.
* You may need to ask your hosting company to allow you to connect through to your account using SSH.
Once you know your servers SSH login information […]

Continue Reading: How to setup and use PuTTY

comments 1 Comment

How To Use Pico

TheDoc

Pico is a text editor program within Unix which can run through Putty terminal screen. It’s about the simplest editor you can use on Unix.
In the screenshot below you can see Pico’s terminal window. At the bottom is a list of basic commands, Pico has many others. To access these commands hold CTRL+ the command […]

Continue Reading: How To Use Pico

comments Make Comment

CHMOD Files With WS_FTP

TheDoc

Sometimes needing to CHMOD a file(s) or a directory is a must, and often its easier and quicker to do while your FTP is open. If you have newly installed php / cgi / perl scripts they may need to have permissions modified.
When you CHMOD a file you are changing the permission privileges on a […]

Continue Reading: CHMOD Files With WS_FTP

comments Make Comment

» Home » Webmaster Blog