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

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>
            最新中文字幕亚洲| 久久久噜噜噜久久中文字幕色伊伊 | 国产午夜一区二区三区| 亚洲欧美日韩国产精品| 99这里只有久久精品视频| 欧美日韩免费看| 亚洲欧美日韩第一区| 欧美日韩国产成人在线91| 欧美一区二区三区在线观看视频 | 伊人成人网在线看| 欧美gay视频激情| 欧美激情一区| 羞羞色国产精品| 久久久久这里只有精品| a4yy欧美一区二区三区| 亚洲在线视频观看| 亚洲成人在线免费| 中文亚洲字幕| 在线精品观看| 亚洲一级免费视频| 亚洲激情在线| 亚洲欧美在线免费| 91久久久亚洲精品| 午夜老司机精品| 亚洲精品一区二区三区99| 中文欧美日韩| 91久久视频| 欧美一区二区在线观看| 99国产欧美久久久精品| 欧美一区免费| 亚洲欧美国产一区二区三区| 久久久99国产精品免费| 亚洲综合精品自拍| 巨乳诱惑日韩免费av| 亚洲一区制服诱惑| 久久天天躁狠狠躁夜夜av| 亚洲一区二区精品在线| 久久亚洲春色中文字幕久久久| 亚洲激情在线| 久久精品麻豆| 亚洲午夜精品一区二区三区他趣| 欧美在线视频观看| 亚洲视频大全| 免费成人毛片| 久久久综合网| 欧美性事在线| 亚洲乱码国产乱码精品精可以看| 韩日欧美一区二区三区| 亚洲午夜电影在线观看| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 免费成人高清| 老司机精品视频一区二区三区| 欧美日韩在线观看一区二区| 欧美激情第一页xxx| …久久精品99久久香蕉国产| 欧美一级淫片aaaaaaa视频| 欧美在线不卡视频| 美女黄毛**国产精品啪啪| 黄色日韩网站| 欧美国产日韩二区| 在线观看国产日韩| 在线欧美日韩国产| 国产伦精品一区| 欧美激情欧美激情在线五月| 亚洲欧美日韩在线观看a三区| 久久五月婷婷丁香社区| 亚洲精品一区二区三区99| 久久深夜福利免费观看| 亚洲一区二区三区高清不卡| 国产一区二区精品久久91| 欧美91视频| 欧美一区二区视频观看视频| 久久久久国产精品一区二区| 欧美日一区二区三区在线观看国产免 | 欧美wwwwww| 最新国产の精品合集bt伙计| 亚洲国语精品自产拍在线观看| 美玉足脚交一区二区三区图片| 欧美aⅴ一区二区三区视频| 永久久久久久| 欧美国产精品劲爆| 99国产精品视频免费观看| 午夜日韩激情| 国内精品久久久久久 | 黄色一区三区| 欧美成人dvd在线视频| 一区二区91| 久久精品在线播放| 亚洲黄色成人| 国产精品视频内| 久久婷婷国产综合精品青草 | 欧美视频在线观看一区| 亚洲午夜羞羞片| 久久夜色精品| 亚洲视频在线播放| 精品不卡一区二区三区| 欧美成人午夜| 亚洲一区二区三区视频| 久久青青草原一区二区| 99热精品在线| 国内精品嫩模av私拍在线观看| 男女精品网站| 欧美一区免费| 夜夜嗨av一区二区三区四区| 久久精品免费| 亚洲午夜视频在线| 黄色一区二区三区四区| 欧美日韩在线三区| 久久久久国产成人精品亚洲午夜| 亚洲精品视频免费在线观看| 久久免费99精品久久久久久| 99精品视频免费观看| 韩国成人精品a∨在线观看| 欧美色综合天天久久综合精品| 久久国产福利| 亚洲天堂网在线观看| 亚洲激情六月丁香| 久久久噜噜噜| 欧美一区二区精美| 一区二区av在线| 亚洲韩国精品一区| 一区二区亚洲欧洲国产日韩| 国产精品久久看| 欧美日韩一区二区欧美激情| 麻豆精品在线视频| 久久久人人人| 久久精品成人一区二区三区蜜臀| 一本色道久久加勒比精品| 亚洲激情在线观看| 欧美成人激情视频| 亚洲二区免费| 久久美女性网| 久久久蜜桃精品| 久久久成人网| 久久免费偷拍视频| 欧美在线视频二区| 午夜精品成人在线| 午夜一区不卡| 欧美一级专区免费大片| 亚洲一区二区三区乱码aⅴ蜜桃女| 亚洲毛片一区| 一本一本久久| 亚洲一区二区精品在线| 亚洲精品免费看| 日韩亚洲国产精品| 亚洲三级电影全部在线观看高清| 亚洲国产日韩欧美一区二区三区| 一区二区亚洲欧洲国产日韩| 国产一区二区精品久久| 国产一区二区视频在线观看| 国产一区二区福利| 一区二区在线免费观看| 国产专区综合网| 一区精品在线| 亚洲精品女av网站| 中日韩美女免费视频网站在线观看| 一本色道久久综合亚洲精品小说 | 日韩五码在线| 亚洲宅男天堂在线观看无病毒| 午夜国产精品影院在线观看| 欧美中文字幕在线播放| 久久久国产一区二区| 久久全球大尺度高清视频| 欧美高清在线一区二区| 亚洲福利国产精品| 一区二区三区国产在线| 亚洲综合不卡| 久久深夜福利免费观看| 欧美精品久久一区二区| 国产精品色婷婷| 亚洲人成高清| 亚洲午夜91| 久久精品国产一区二区三| 蜜臀av在线播放一区二区三区| 欧美国产日本高清在线| 亚洲国产成人精品视频| 国产精品国产三级国产专区53 | 一区二区三区色| 欧美在线三区| 欧美日韩国产精品成人| 国产日韩精品在线| 亚洲精品在线二区| 久久久国产午夜精品| 亚洲精品美女91| 欧美一区二区视频97| 欧美日韩视频第一区| 黄色成人91| 午夜精品久久一牛影视| 久久人人超碰| 亚洲网友自拍| 欧美理论在线| 亚洲国产精品电影| 久久se精品一区二区| 亚洲乱码日产精品bd| 久久aⅴ国产紧身牛仔裤| 亚洲人被黑人高潮完整版| 亚洲国产另类久久久精品极度| 亚洲已满18点击进入久久| 葵司免费一区二区三区四区五区| 亚洲国产你懂的|