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

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>
            久久久精品性| 欧美有码视频| 欧美日韩国产综合网 | 午夜精品久久久久久久男人的天堂 | 免费观看在线综合色| 今天的高清视频免费播放成人| 亚洲一区三区视频在线观看| 亚洲视频中文字幕| 国产亚洲一本大道中文在线| 久久亚洲精选| 欧美极品在线播放| 亚洲欧美高清| 久久精品国产久精国产爱| 亚洲黄色成人久久久| 在线视频亚洲| 精品999日本| 日韩视频一区二区在线观看| 国产精品视频99| 欧美成年人视频网站欧美| 欧美女主播在线| 欧美一区日韩一区| 欧美.日韩.国产.一区.二区| 亚洲永久免费观看| 久久综合激情| 午夜国产精品视频| 欧美aa国产视频| 欧美一区二区三区免费观看视频 | 午夜在线精品偷拍| 亚洲人久久久| 久久成人精品一区二区三区| 99国产精品国产精品久久| 欧美一区二粉嫩精品国产一线天| 最近中文字幕日韩精品| 亚洲免费在线精品一区| 亚洲靠逼com| 久久精品视频免费| 亚洲免费网站| 欧美精品免费播放| 浪潮色综合久久天堂| 国产精品国内视频| 亚洲国产另类精品专区| 国产欧美日韩综合一区在线观看 | 亚洲国产美女久久久久| 国产性做久久久久久| 99re热精品| 亚洲全部视频| 久久亚洲综合网| 久久久久久久网站| 国产欧美日本| 亚洲欧美999| 亚洲欧美另类在线| 欧美日韩免费观看一区三区| 欧美激情成人在线视频| 在线日韩av片| 久久久久久久久久久久久久一区| 欧美一级一区| 国产女主播一区二区三区| 亚洲图中文字幕| 亚洲欧美成aⅴ人在线观看| 欧美精品电影| 亚洲精品一区中文| 亚洲美女av网站| 欧美精品一区在线| 亚洲精品免费一区二区三区| 亚洲免费观看在线视频| 欧美成人一区二区三区在线观看| 欧美黑人在线观看| 亚洲精品国产品国语在线app| 久久午夜电影网| 欧美成年视频| 日韩一二三区视频| 欧美日韩mv| 亚洲视频在线观看视频| 香蕉国产精品偷在线观看不卡| 国产精品国产亚洲精品看不卡15| 亚洲视频在线免费观看| 欧美综合77777色婷婷| 国产精品一区二区三区四区 | 亚洲日本成人网| 日韩一级裸体免费视频| 欧美日韩一级大片网址| 亚洲一区二区三区免费观看| 久久精品毛片| 亚洲大片av| 欧美极品在线观看| 亚洲一区在线观看视频 | 久久久国产精品亚洲一区| 精品成人在线观看| 欧美激情精品久久久六区热门| 亚洲免费久久| 久久精品人人| 亚洲精品日韩欧美| 国产精品九色蝌蚪自拍| 久久精视频免费在线久久完整在线看| 欧美高清自拍一区| 亚洲一区不卡| 亚洲国产成人在线视频| 欧美午夜女人视频在线| 欧美在线欧美在线| 最新国产拍偷乱拍精品| 久久国产精品久久国产精品| 亚洲国产精品传媒在线观看 | 国产亚洲欧美日韩一区二区| 老色鬼精品视频在线观看播放| 日韩网站免费观看| 久久在线免费观看| 亚洲视频一二三| 激情婷婷欧美| 国产精品日韩精品| 欧美成人性生活| 小辣椒精品导航| 亚洲免费观看高清在线观看| 美女成人午夜| 久久狠狠婷婷| 亚洲一区二区三区成人在线视频精品| 国内外成人在线视频| 国产精品日本精品| 欧美精品aa| 麻豆国产精品777777在线| 亚洲欧美在线网| 日韩一级大片在线| 欧美激情亚洲综合一区| 久久久久久久久久久久久9999| 亚洲午夜激情在线| 亚洲精品中文字幕有码专区| 国模私拍一区二区三区| 国产精品私房写真福利视频| 欧美人与禽猛交乱配| 欧美1区2区| 老色鬼精品视频在线观看播放| 欧美亚洲系列| 亚洲欧美三级伦理| 亚洲一区二区三区久久 | 久久精品最新地址| 欧美一区二区三区男人的天堂 | 亚洲第一福利视频| 国产婷婷成人久久av免费高清 | 欧美亚洲不卡| 欧美深夜福利| 国产精品国产a级| 国产精品二区二区三区| 欧美日韩视频第一区| 欧美日韩欧美一区二区| 欧美人成免费网站| 欧美视频一区二区在线观看| 欧美日韩中文字幕精品| 欧美三级在线播放| 国产精品国产自产拍高清av王其| 国产精品theporn88| 国产精品青草久久| 国产精品视频在线观看| 国产一区二区久久久| 韩国精品在线观看| 伊人夜夜躁av伊人久久| 亚洲黄色三级| 亚洲视频在线观看| 亚洲欧美www| 久久久精品国产免费观看同学| 久久久最新网址| 亚洲国产成人porn| 亚洲精品网站在线播放gif| 99伊人成综合| 欧美一区二区三区成人| 久久蜜桃精品| 欧美区在线观看| 国产亚洲精品成人av久久ww| 尤物网精品视频| 一区二区三区黄色| 欧美在线二区| 亚洲风情在线资源站| 亚洲精品欧美日韩专区| 亚洲欧美日韩在线不卡| 美女国内精品自产拍在线播放| 欧美巨乳在线观看| 国产网站欧美日韩免费精品在线观看| 在线看不卡av| 亚洲影音一区| 欧美14一18处毛片| 99视频一区二区| 久久女同互慰一区二区三区| 欧美日韩国产bt| 尤物九九久久国产精品的分类| 中文在线一区| 久久综合网络一区二区| 日韩一级片网址| 久久久久久久激情视频| 欧美三级电影网| 在线观看欧美精品| 亚洲欧美综合v| 亚洲国产另类久久精品| 欧美在线视频a| 国产精品爱久久久久久久| 一区在线播放视频| 亚洲女性喷水在线观看一区| 欧美国产激情二区三区| 欧美影院一区| 国产欧美日韩综合| 亚洲欧美一级二级三级| 亚洲精品欧美一区二区三区| 久久综合给合久久狠狠色 |