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

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>
            性色av一区二区怡红| 中文亚洲免费| 欧美bbbxxxxx| 欧美**字幕| aⅴ色国产欧美| 一区二区三区你懂的| 国产精品欧美日韩一区| 欧美一区二区在线免费观看| 欧美在线观看一区二区| 一区二区三区在线免费播放| 欧美激情一区二区三区蜜桃视频 | 裸体丰满少妇做受久久99精品| 久久国产精品久久国产精品 | 国产欧美日韩视频在线观看| 麻豆9191精品国产| 欧美女人交a| 久久视频一区二区| 欧美精品www| 久久精品国产一区二区三区| 欧美aⅴ99久久黑人专区| 亚洲欧美日韩另类精品一区二区三区 | 影音先锋久久精品| 亚洲毛片在线看| 韩国一区二区在线观看| 亚洲人成网在线播放| 国产麻豆午夜三级精品| 欧美肥婆在线| 国产目拍亚洲精品99久久精品| 欧美黑人多人双交| 国产欧美精品一区二区色综合| 亚洲国产福利在线| 国内在线观看一区二区三区| 亚洲欧洲日本国产| 黄色国产精品| 亚洲免费视频成人| 日韩视频一区二区三区在线播放免费观看| 在线综合+亚洲+欧美中文字幕| 亚洲第一黄网| 欧美一区二区福利在线| 亚洲影音先锋| 欧美日韩精品一区二区天天拍小说| 久久综合久久综合九色| 国产欧美亚洲视频| 99热在线精品观看| 亚洲精品一区在线| 久久综合99re88久久爱| 狂野欧美一区| 国产在线播精品第三| 亚洲欧美日韩电影| 香蕉免费一区二区三区在线观看| 欧美日韩国产经典色站一区二区三区| 免费精品视频| 亚洲国产精品一区制服丝袜| 欧美一区激情| 久久久免费精品视频| 国产午夜久久| 久久爱www| 久久亚洲免费| 精品福利免费观看| 午夜在线一区| 久久久蜜桃一区二区人| 国内精品久久久| 久久黄色小说| 欧美激情一区二区久久久| 亚洲第一中文字幕在线观看| 另类图片综合电影| 欧美黄色日本| 亚洲国产美女| 免费亚洲网站| 日韩一级黄色片| 亚洲一区二三| 国产一区二区三区的电影| 久久精品综合网| 欧美成人综合网站| 亚洲另类视频| 国产精品久久久久毛片大屁完整版 | 久久久久久久久久久久久女国产乱| 久久视频在线免费观看| 亚洲韩国一区二区三区| 欧美高清在线一区二区| 99亚洲一区二区| 久久精品成人欧美大片古装| 在线观看欧美视频| 欧美美女操人视频| 午夜亚洲福利| 亚洲高清视频的网址| 亚洲视频一区| 国内精品久久久久影院色| 欧美第十八页| 午夜精品福利一区二区三区av| 久久夜色精品一区| 99国产成+人+综合+亚洲欧美| 国产精品国产自产拍高清av| 久久精品国产久精国产一老狼| 亚洲国产欧美在线| 午夜视频在线观看一区二区| 一区二区三区在线免费播放| 欧美日韩在线观看视频| 欧美一区二区成人6969| 亚洲精品少妇网址| 久久综合影视| 亚洲调教视频在线观看| 影音先锋国产精品| 国产精品日本一区二区| 欧美11—12娇小xxxx| 午夜亚洲影视| 一本久久综合| 亚洲第一视频| 久久视频精品在线| 亚洲欧美国产毛片在线| 最新日韩欧美| 国内精品久久久久国产盗摄免费观看完整版| 欧美二区视频| 久久久久久一区二区| 亚洲欧美日韩第一区| 日韩写真视频在线观看| 欧美激情精品久久久久久黑人| 欧美在线一区二区三区| 亚洲一区二区毛片| 日韩亚洲成人av在线| 一区二区三区亚洲| 国产手机视频精品| 国产精品久久久久aaaa| 欧美日韩国产综合视频在线| 久久免费黄色| 久久精品亚洲精品国产欧美kt∨| 亚洲天堂成人在线观看| 亚洲免费大片| 亚洲精品在线观看免费| 亚洲黄色免费网站| 欧美激情女人20p| 欧美国产日韩精品| 欧美成人69| 欧美成熟视频| 欧美激情四色| 亚洲第一页在线| 欧美国产精品久久| 欧美国产第一页| 亚洲成色999久久网站| 欧美肥婆在线| 亚洲电影免费| 亚洲人成在线观看网站高清| 欧美激情1区2区| 91久久国产精品91久久性色| 亚洲欧洲日韩女同| 亚洲看片网站| 亚洲午夜av电影| 午夜精品一区二区三区电影天堂 | 亚洲淫性视频| 亚久久调教视频| 欧美在线free| 麻豆国产va免费精品高清在线| 蜜臀a∨国产成人精品| 欧美精品观看| 国产精品网站在线播放| 国产亚洲女人久久久久毛片| 国内外成人免费激情在线视频网站| 国内久久精品| 亚洲精品国产拍免费91在线| 亚洲午夜在线观看| 久久精品五月| 欧美激情精品久久久久久| 亚洲日韩视频| 亚洲欧美在线aaa| 久久综合色一综合色88| 欧美日韩精品综合在线| 国产精品亚洲综合久久| 伊人精品成人久久综合软件| 亚洲免费观看| 久久国产主播精品| 欧美黄色精品| 亚洲在线中文字幕| 久久在线视频在线| 欧美日韩三级在线| 国模精品一区二区三区| 99精品国产在热久久婷婷| 校园春色国产精品| 亚洲福利免费| 午夜精品视频在线观看| 欧美激情五月| 国模叶桐国产精品一区| 在线视频亚洲欧美| 久久综合电影| 亚洲桃花岛网站| 免费亚洲电影在线观看| 国产日韩欧美精品一区| 亚洲精品综合久久中文字幕| 久久九九全国免费精品观看| 日韩视频在线一区二区| 久久亚洲精品中文字幕冲田杏梨 | 欧美精品在线免费| 在线欧美电影| 久久精品视频免费播放| 一本色道久久综合亚洲精品按摩 | 欧美一区二区三区视频在线观看| 欧美二区在线看| 亚洲盗摄视频| 久久久久久91香蕉国产| 亚洲免费在线看| 欧美日韩网址|