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

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>
            又紧又大又爽精品一区二区| 久久综合网hezyo| 欧美日韩国产影片| 一二三区精品福利视频| 一本色道久久综合精品竹菊| 国产伦精品一区二区三区四区免费 | 亚洲一区二区三区777| 国产精品五月天| 久久三级福利| 欧美大片在线影院| 亚洲在线一区二区| 久久国产日本精品| 99re6这里只有精品| 亚洲在线一区二区三区| 影音先锋一区| 99精品视频一区| 国产一区日韩一区| 亚洲国产精品久久人人爱蜜臀| 欧美日韩国产探花| 久久精品欧美| 欧美日韩高清免费| 久热爱精品视频线路一| 欧美日韩精品一二三区| 欧美一乱一性一交一视频| 美女在线一区二区| 欧美诱惑福利视频| 欧美激情va永久在线播放| 欧美一区二区免费| 欧美成人亚洲| 久久亚洲精选| 欧美日韩视频一区二区| 欧美jjzz| 国产亚洲综合性久久久影院| 9l视频自拍蝌蚪9l视频成人 | 欧美激情免费在线| 久久夜色精品国产| 国产精品免费小视频| 亚洲黄色在线观看| 国产一区欧美日韩| 亚洲欧美日本视频在线观看| 艳妇臀荡乳欲伦亚洲一区| 久久久久久自在自线| 欧美一级日韩一级| 欧美午夜精品理论片a级按摩| 欧美成人精品一区二区| 国内激情久久| 亚洲欧美日韩精品久久亚洲区 | 揄拍成人国产精品视频| 欧美一区二区三区视频在线观看| 亚洲婷婷免费| 欧美日韩福利在线观看| 亚洲电影在线播放| 亚洲高清在线观看| 久久久青草婷婷精品综合日韩| 欧美在线视频一区| 国产精品网站视频| 亚洲永久在线观看| 亚洲欧美国产视频| 国产精品嫩草99a| 亚洲视频在线观看三级| 亚洲影音先锋| 国产精品久久久久9999| 亚洲私人影院| 欧美一区二区私人影院日本 | 欧美阿v一级看视频| 欧美+亚洲+精品+三区| 在线观看视频一区二区| 久久综合一区二区三区| 欧美国产精品中文字幕| 亚洲人成欧美中文字幕| 欧美成人在线免费观看| 日韩视频免费| 亚洲专区免费| 国产精品视频999| 亚洲图片在区色| 久久精品欧美日韩| 亚洲国产精品尤物yw在线观看| 免费在线观看成人av| 亚洲精品乱码| 午夜精品久久久久久久99黑人| 国产啪精品视频| 久久精品视频网| 欧美激情中文字幕一区二区| 一本综合久久| 国产亚洲观看| 欧美xxx成人| 亚洲视频在线看| 久久久久国内| 日韩亚洲欧美一区二区三区| 国产精品日韩在线| 久久最新视频| 亚洲深夜福利| 欧美成人久久| 午夜精品亚洲| 亚洲黄色免费网站| 欧美日韩午夜激情| 久久久久久久久综合| 亚洲精品四区| 快播亚洲色图| 性做久久久久久久久| 亚洲激情另类| 国产一区视频在线观看免费| 欧美国产激情| 久久久久国产精品一区| 一本到12不卡视频在线dvd| 久久偷窥视频| 午夜精品视频在线观看一区二区| 亚洲国产日韩欧美一区二区三区| 欧美无乱码久久久免费午夜一区 | 麻豆久久久9性大片| 亚洲桃花岛网站| 91久久精品视频| 久久综合999| 午夜在线观看欧美| 99这里只有精品| 在线国产精品一区| 国产日韩欧美夫妻视频在线观看| 欧美片第一页| 欧美成人a视频| 久久精品久久99精品久久| 亚洲天堂久久| 亚洲最新色图| 亚洲精品日韩精品| 亚洲成人自拍视频| 免费成人av在线| 久久久不卡网国产精品一区| 亚洲午夜激情网站| 一区二区三区福利| 亚洲精品韩国| 亚洲欧洲在线免费| 亚洲激情欧美| 亚洲激情视频网站| 亚洲欧洲精品一区二区| 亚洲国产精品久久久久久女王| 黄色精品网站| 国产三区二区一区久久 | 鲁鲁狠狠狠7777一区二区| 久久久久久久久久码影片| 久久精品毛片| 久久香蕉国产线看观看网| 久久精品99| 久久久久国内| 美女免费视频一区| 免费在线亚洲| 欧美韩国在线| 欧美日韩在线精品一区二区三区| 欧美日韩高清一区| 欧美日韩在线播放三区四区| 欧美视频一区二区三区| 国产精品视频免费观看| 国产精品一区二区久久精品| 国产精品自拍在线| 国内精品久久久久影院优| 欲香欲色天天天综合和网| 亚洲国产精品久久久| 夜夜爽99久久国产综合精品女不卡| 一区二区三区高清不卡| 午夜精品久久久久久久99热浪潮 | 久久久精彩视频| 久久综合一区| 亚洲人成在线免费观看| 中日韩在线视频| 久久精品30| 欧美日韩xxxxx| 国产欧美日韩免费看aⅴ视频| 一区二区三区在线看| 亚洲精选久久| 久久成人精品无人区| 欧美高清影院| 正在播放亚洲| 鲁鲁狠狠狠7777一区二区| 欧美日韩在线一区二区三区| 国产午夜精品理论片a级探花 | 亚洲国产成人精品久久| 中文精品视频| 麻豆成人在线播放| 99re热这里只有精品视频| 欧美一区二区在线| 欧美精品麻豆| 国外成人在线视频| 中文国产一区| 欧美成人免费视频| 亚洲女同在线| 欧美精品一区二区高清在线观看| 国产伦精品免费视频| 亚洲精品日韩在线| 久久久www| 亚洲午夜伦理| 欧美欧美天天天天操| 一区在线观看视频| 亚洲摸下面视频| 亚洲国产综合在线| 久久久综合精品| 国产丝袜一区二区三区| 亚洲影视在线| 亚洲人成77777在线观看网| 久久精品一区二区| 国产手机视频一区二区| 亚洲欧美一区二区视频| 亚洲精品一区二|