青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Matrix
Klarke's C/C++ Home
posts - 61,comments - 0,trackbacks - 0

How to change permissions (chmod) of a file

Permissions can be very important when it comes to hosting your website. Permissions can allow our server computer to write and edit your files. Along with that, some files need to be protected from writing and editing, as a security measure. You can change your file permissions in many ways.

Using File Manager in cPanel

One of the easy and basic ways to change the permissions is through File manager in cPanel. To change the permissions for a file or folder in cpanel, please do the following:

  1. Login to your cPanel (if not already there)
  2. Click File Manager
  3. Click the name of the file for which you would like to change the permissions.
  4. Select the Change Permissions link at the top right of the page.
  5. Select the permissions you would like to set for the file.
  6. Click Change Permissions

 

Using FTP

Connect to FTP. Go to the file and right click. Choose Permissions or Attributes or Properties (depends on your program).

Using SSH or a script

This can be done with chmod command.


So, what do these permissions and numbers mean?

File permissions determine what you are allowed to do and who is allowed to do it.

Owner Group World
Read ? ? ?
Write ?
Execute ? ? ?

 

The columns are the three types of users. First is the Owner; the owner is you, the person who has access to the cPanel or shell. Second is the Group; the group is other people on your server. Third is the World; the world is any visitor from the public (think world wide web).

Each row represents a permitted action for this file (or folder). Read means the user is allowed to view the file. Write means the user is allowed to edit the file. Execute means the user is allowed to run the file.

It is very important that Group and World be able to view your website files. However, there are some files which you may not want anyone to see. If you remove the check for Read under Group and World, then the file will not show in anyone's browser (instead visitors will see a 403 Forbidden error).

In the File Manager, permissions are expressed as numbers. We are only concerned with 3 digits, so if you see 4 digits, then ignore the first one. Thus 0755 is the same as 755.

The numbers represent a combination of each unique permission. Also, the first of the three digits represents the permissions for the Owner. The second digit represents the Group. The third digit represents the World.

  • Read is equal to 4.
  • Write is equal to 2.
  • Execute is equal to 1.
  • No permissions for a user is equal to 0.

Thus...

  • Write and Execute without Read is equal to 3.
  • Read and Execute without Write is equal to 5.
  • Read and Write without Execute is equal to 6.
  • Read and Write and Execute is equal to 7.

At this point, all you need to know is that your files should always have permissions of 644 or 755. (For most files, it doesn't matter if you give the executable permission or not. You won't see any difference.)

However, folders must always be 755.

One more rule. Any files inside the cgi-bin folder must have 755 permissions.


Advanced

A common concern is using file permissions of 777.

HostGator does not allow 777 on files which process server-side (i.e. PHP). However, many scripts require you to change your files to 777.

I can tell you that 755 will work in lieu of 777. You will not need to use 777 on PHP files or folders.

What's the big deal?

The concern is giving writable permissions to Group and World. This allows hackers from the world wide web to edit your files. Thus, the last two digits of file permissions should never be 2, 3, 6, or 7.

The problem is when you install a PHP script, the script needs permission to edit files. Traditionally, PHP is treated as 'nobody' on the server. Therefore, PHP is treated the same an any unknown visitor and must obey the permissions granted to World.

The solution to this conflict is to treat PHP as the Owner. HostGator has done so by implementing a special PHP security environment known as suPHP (or phpSuExec).

With suPHP, all PHP scripts are allowed the same permissions as the Owner, and outside visitors are still restricted by the World permissions. Therefore, 755 is the perfect number; it allows all actions for PHP and only reading/viewing for potential hackers.

Other formats

Permissions can be expressed many ways. You have already seen the two-dimensional matrix and the 3 or 4 digit numbers.

However, if you prefer to use the Linux shell (SSH), then file permissions will look like this:

drwxr-xr-x

You can ignore the very first character; it represents the file type rather than permissions. Next, you see three letters which represent the Owner's permissions.

  • r = read
  • w = write
  • x = execute
  • - (hyphen) = no permission

The Owner will normally have all three permissions, which is represented by rwx.

The next three characters represent the Group's permissions. Finally, the last three characters represent the World's permissions.

Notice that Group and World do not get the writable permission. In place of the 'w' will be a hyphen, meaning that write is definitely not allowed: r-x.

Here are some conversions to consider.

2D Matrix Numerical Representation Linux Representation
error 755 or 0755

Recommended!
drwxr-xr-x
error 644 or 0644

Recommended!
drw-r--r--
error 700 or 0700 drwx------
error
posted on 2012-08-13 10:11 Klarke 閱讀(2787) 評論(0)  編輯 收藏 引用
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久国产精品一区二区| 欧美一级久久久久久久大片| 久久躁日日躁aaaaxxxx| 欧美中在线观看| 亚洲精品社区| 亚洲欧美日韩国产一区二区| 一区二区三区在线视频播放| 亚洲国产精品va在线看黑人| 牛人盗摄一区二区三区视频| 亚洲在线网站| 久久精品国产清高在天天线| 久久青草久久| 久久久噜噜噜久久久| 亚洲欧洲三级电影| 国产精品一区二区三区四区五区 | 亚洲精品综合久久中文字幕| 欧美成人一区在线| 亚洲一二三区在线| 欧美日韩亚洲一区二区三区四区| 亚洲国产经典视频| 欧美一级二区| 午夜一区在线| 亚洲午夜一二三区视频| 亚洲人体影院| 国产精品成人一区二区三区吃奶 | 国产精品久久久久一区二区| 久久精品一二三| 欧美一区二区在线免费观看| 亚洲人成在线观看一区二区| 蜜乳av另类精品一区二区| 欧美色图天堂网| 美女诱惑一区| 久久精品久久综合| 久久狠狠亚洲综合| 亚洲欧美制服另类日韩| 国产精品99久久久久久宅男| 亚洲老司机av| 日韩视频在线观看| 日韩一级不卡| 亚洲国产日韩欧美在线动漫| 亚洲第一在线| 亚洲一区二区在线| 久久精品五月| 欧美激情精品久久久久久免费印度 | 美女啪啪无遮挡免费久久网站| 午夜影视日本亚洲欧洲精品| 欧美在线1区| 夜夜嗨av一区二区三区中文字幕| 另类图片综合电影| 欧美三级电影网| 国产一区二区久久精品| 黄色亚洲精品| 亚洲免费视频在线观看| 午夜久久久久久| 欧美v日韩v国产v| 午夜免费电影一区在线观看| 国产精品欧美日韩一区| 国产女主播一区二区| 在线观看视频日韩| 亚洲一线二线三线久久久| 老司机成人在线视频| 夜夜爽夜夜爽精品视频| 久久精品av麻豆的观看方式| 国产精品久久久久久久浪潮网站| 久久久夜夜夜| 亚洲影院污污.| 久热精品在线视频| 亚洲一区二区三区免费在线观看| 老司机aⅴ在线精品导航| 亚洲大胆视频| 亚洲午夜小视频| 香蕉久久精品日日躁夜夜躁| 欧美日韩一二区| 亚洲一区二区三区777| 99国内精品| 欧美大成色www永久网站婷| 99这里有精品| 午夜宅男久久久| 亚洲人体大胆视频| 亚洲欧美精品在线观看| 精品二区视频| 宅男精品导航| 亚洲伦理久久| 亚洲欧美综合国产精品一区| 亚洲图片欧美午夜| 亚洲福利在线观看| 亚洲一区二区在线播放| 激情亚洲网站| 亚洲视频axxx| 亚洲日本激情| 欧美一区久久| 亚洲视频999| 久久精品一区二区三区不卡| 亚洲国产精品t66y| 宅男精品导航| 亚洲精品美女在线| 久久九九国产精品怡红院| 久久影视精品| 欧美极品在线播放| 日韩一级不卡| 一本色道久久综合亚洲精品按摩 | 免费看成人av| 国产精品免费看片| 亚洲手机在线| 久久精品国产亚洲a| 国产精品激情av在线播放| 欧美一二三区精品| 欧美日韩视频在线一区二区观看视频 | 99国产精品久久久久老师| 国产伦精品一区二区三区照片91| 久久综合国产精品| 欧美日韩直播| 亚洲国产精品日韩| 国产亚洲人成网站在线观看| 一区二区三区精品视频| 影音先锋在线一区| 美国成人毛片| 欧美国产日本韩| 国产视频精品网| 午夜精品美女久久久久av福利| 亚洲一区免费在线观看| 欧美精品亚洲二区| 亚洲国产综合在线| 亚洲毛片在线观看| 欧美日本高清| 亚洲欧美另类在线| 久久亚洲午夜电影| 亚洲国产成人tv| 欧美日本网站| 亚洲少妇最新在线视频| 欧美成人午夜剧场免费观看| 另类专区欧美制服同性| 久久久久久亚洲综合影院红桃| 久久婷婷亚洲| 亚洲一区在线视频| 国产一区二区精品久久91| 亚洲国产精品成人综合| 亚洲精品在线二区| 欧美一区二区三区久久精品| 亚洲欧洲精品一区二区三区不卡 | 久久av二区| 激情丁香综合| 国产一级一区二区| 欧美午夜无遮挡| 免费成年人欧美视频| 午夜精品成人在线视频| 亚洲黄页视频免费观看| 亚洲视频一区二区免费在线观看| 国内精品久久国产| 欧美性理论片在线观看片免费| 久久久久一本一区二区青青蜜月| 亚洲靠逼com| 欧美激情中文字幕一区二区| 久久国产精品久久久久久久久久| 在线观看的日韩av| 国产精品一二一区| 欧美日韩亚洲国产精品| 嫩草影视亚洲| 免费h精品视频在线播放| 久久国产婷婷国产香蕉| 欧美伊人精品成人久久综合97| 亚洲小说区图片区| 亚洲天堂偷拍| 午夜亚洲一区| 久久精品亚洲| 另类av一区二区| 欧美激情精品久久久久久变态| 欧美一区二区三区精品| 亚洲片在线资源| 亚洲欧美日韩久久精品| 美日韩免费视频| 久久成人18免费观看| 欧美日韩一区二区视频在线观看| 狠狠久久五月精品中文字幕| 一区二区三区导航| 欧美韩国日本一区| 欧美一区二区三区在线免费观看| 欧美精品成人| 国产偷久久久精品专区| 久久久亚洲精品一区二区三区| 欧美日韩亚洲视频| 亚洲国产综合视频在线观看| 久久国产精品久久精品国产| 99成人在线| 欧美精品一区二区在线播放| 一区二区视频免费在线观看| 欧美一区二区久久久| 99精品热视频只有精品10| 欧美国产精品一区| 亚洲国产一区二区视频| 免费精品视频| 欧美国产日产韩国视频| 亚洲精品乱码久久久久久蜜桃麻豆| 久久亚洲精品网站| 久久久国产视频91| 亚洲欧洲日产国产网站| 亚洲黑丝一区二区| 欧美日韩国产另类不卡| 亚洲午夜在线观看视频在线| 在线中文字幕日韩|