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

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 閱讀(2793) 評論(0)  編輯 收藏 引用

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲欧美在线磁力| 亚洲专区一区二区三区| 亚洲精选视频免费看| 午夜视频久久久久久| 欧美国产精品va在线观看| 亚洲午夜在线观看| 欧美不卡视频| 国产一区二区日韩| 亚洲一区二区欧美日韩| 亚洲电影免费在线| 亚洲视频网在线直播| 欧美激情视频在线播放| 亚洲男女自偷自拍图片另类| 亚洲一区二区精品视频| 欧美黄色影院| 久久gogo国模裸体人体| 欧美网站在线| 亚洲毛片一区| 欧美电影专区| 久久精品在线观看| 国产亚洲欧美一级| 欧美视频精品在线观看| 激情综合在线| 久久激情婷婷| 亚洲欧美视频| 国产精品久久福利| 亚洲图片在区色| 亚洲精选在线观看| 欧美刺激性大交免费视频| 伊人夜夜躁av伊人久久| 久久久精品日韩欧美| 午夜精品国产精品大乳美女| 国产精品爱久久久久久久| 一区二区三区欧美在线| 最新亚洲激情| 欧美激情国产精品| 亚洲人人精品| 亚洲国产精品久久91精品| 这里只有精品在线播放| 欧美日韩免费在线观看| 亚洲视频精品在线| 亚洲理伦在线| 欧美日韩影院| 亚洲主播在线观看| 亚洲一区二区欧美日韩| 国产精品视频精品视频| 国产伦精品一区二区三区照片91| 国模私拍一区二区三区| 久久久久久九九九九| 午夜欧美大片免费观看| 国产午夜精品理论片a级探花| 欧美一级艳片视频免费观看| 亚洲男人的天堂在线aⅴ视频| 国产精品永久免费观看| 欧美综合激情网| 久久福利影视| 在线观看一区二区精品视频| 欧美成人午夜剧场免费观看| 暖暖成人免费视频| 99re热这里只有精品视频| 日韩亚洲精品视频| 国产精品久久久久久户外露出| 亚洲欧美日韩精品在线| 亚洲欧美影院| 欧美日韩国产一区二区三区地区| 99精品视频网| 在线综合亚洲| 国产主播在线一区| 欧美大片免费| 欧美成人一品| 日韩午夜在线播放| 国产精品狼人久久影院观看方式| 欧美日韩一区二| 亚洲午夜三级在线| 亚洲欧美日韩中文播放| 一区二区三区我不卡| 欧美激情一区二区在线| 欧美欧美全黄| 欧美一级理论片| 久久久人成影片一区二区三区观看| 亚洲国产精品va在线看黑人| 亚洲人成网站色ww在线| 国产精品久久久久天堂| 久久久五月天| 欧美激情亚洲| 亚洲欧美日韩中文视频| 久久精品噜噜噜成人av农村| 亚洲精品在线观看免费| 亚洲一卡久久| 亚洲第一精品在线| 久久久精品一区二区三区| 久久影院午夜片一区| 一区二区三区四区国产精品| 亚洲欧美乱综合| 亚洲国产精品一区二区三区| 一二三区精品| 伊人久久久大香线蕉综合直播| 亚洲人成毛片在线播放| 亚洲在线不卡| 欧美日韩免费区域视频在线观看| 久久国产精品一区二区三区四区| 欧美sm视频| 性做久久久久久久久| 六月婷婷久久| 香蕉久久夜色精品| 女人色偷偷aa久久天堂| 欧美一级视频精品观看| 欧美成人在线网站| 久久国产精品久久久久久久久久| 欧美国产第一页| 久久激情网站| 欧美日韩精品一区二区天天拍小说 | 欧美亚韩一区| 女生裸体视频一区二区三区 | 国产欧美日韩精品a在线观看| 欧美 日韩 国产精品免费观看| 欧美日韩免费看| 免费观看成人www动漫视频| 欧美性猛交xxxx乱大交蜜桃| 男女av一区三区二区色多| 国产精品久久久久99| 欧美激情片在线观看| 欧美国产视频在线观看| 国产精品一区二区三区免费观看| 欧美国产日本在线| 国产乱肥老妇国产一区二| 亚洲国产专区校园欧美| 国产自产精品| 国产精品99久久久久久久久| 最新国产の精品合集bt伙计| 欧美一级视频精品观看| 亚洲午夜激情网站| 久久久久国产精品一区三寸| 亚洲一区精品在线| 日韩视频永久免费观看| 久久久久国产免费免费| 欧美一区二区三区另类| 欧美日韩一区二区三区高清| 欧美国产一区二区三区激情无套| 国产亚洲在线| 亚洲一区国产精品| 亚洲私人影院| 亚洲综合丁香| 中国av一区| 免播放器亚洲一区| 久久米奇亚洲| 国产欧美三级| 亚洲一区二区三区四区在线观看| 一区二区三区精品久久久| 欧美成人国产一区二区| 麻豆精品精华液| 新狼窝色av性久久久久久| 亚洲二区视频| 久久理论片午夜琪琪电影网| 久久精品国产精品亚洲综合| 国产精品欧美日韩久久| 一区二区欧美亚洲| 一区二区三区高清在线| 欧美黄色一区二区| 亚洲第一色在线| 18成人免费观看视频| 久久久精品2019中文字幕神马| 久久精品二区亚洲w码| 国产精品免费视频xxxx| 99热在这里有精品免费| 一本色道久久综合狠狠躁的推荐| 欧美极品在线观看| 欧美激情亚洲国产| 亚洲电影免费观看高清完整版在线观看 | 欧美一区二区三区啪啪| 香蕉久久一区二区不卡无毒影院| 国产精品久久久久婷婷| 亚洲视频在线看| 午夜精品福利一区二区三区av| 国产精品久久久久国产a级| 亚洲精品看片| 免费不卡在线观看av| 亚洲成人中文| 日韩一级视频免费观看在线| 欧美精品在线观看| 亚洲精品一级| 亚洲夜间福利| 国产精品视频第一区| 性欧美超级视频| 久久青草欧美一区二区三区| 一区在线视频观看| 老司机成人网| 亚洲片在线观看| 亚洲午夜91| 国产日韩欧美夫妻视频在线观看| 欧美在线免费观看亚洲| 美日韩精品视频| 亚洲精品国产无天堂网2021| 欧美精品二区三区四区免费看视频| 亚洲精品欧美在线| 亚洲综合电影| 国产一区二区三区久久| 久久亚洲一区| 亚洲九九爱视频| 亚洲精品美女久久7777777|