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

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>
            欧美激情91| 亚洲精品美女久久7777777| 欧美在线视频一区| 亚洲一区二区三区免费观看 | 国产精品极品美女粉嫩高清在线 | 狠狠色丁香婷综合久久| 国产一区二区三区视频在线观看 | 农村妇女精品| 欧美激情中文字幕一区二区| 欧美日韩一区二区三区四区在线观看| 欧美人与性动交a欧美精品| 欧美国产一区二区三区激情无套| 久久久久久**毛片大全| 亚洲三级影片| 99国内精品久久久久久久软件| 在线视频精品一区| 在线综合视频| 亚洲精品一区二区三区av| 亚洲四色影视在线观看| 国内精品久久久久久久果冻传媒 | 久久成人18免费观看| 亚洲午夜高清视频| 国产精品每日更新| 国产精品久久午夜夜伦鲁鲁| 国产九区一区在线| 亚洲国产综合在线看不卡| 夜夜嗨av一区二区三区网页| 久久精品国产久精国产思思| 亚洲狠狠丁香婷婷综合久久久| 99精品久久久| 久久久久国产一区二区三区四区| 欧美日韩高清在线一区| 黄色成人精品网站| 亚洲午夜电影| 亚洲国产日韩欧美在线99 | 9人人澡人人爽人人精品| 欧美一区激情视频在线观看| 亚洲电影免费在线| 久久精品水蜜桃av综合天堂| 欧美日韩一本到| 亚洲黄色大片| 久久午夜av| 午夜精品www| 欧美性猛片xxxx免费看久爱| 日韩网站在线| 91久久夜色精品国产网站| 久久久久一区二区三区| 国产日韩欧美不卡| 午夜在线一区二区| 一区二区三区黄色| 欧美日韩精品| 一本久道久久综合中文字幕| 欧美成熟视频| 久久亚洲影音av资源网| 国内成+人亚洲| 久久久久久久性| 欧美专区第一页| 国产一区在线视频| 久久久精品国产99久久精品芒果| 午夜精品www| 国产亚洲欧美日韩在线一区| 欧美在线国产| 欧美在线精品免播放器视频| 国产专区综合网| 麻豆精品视频| 欧美国产精品v| 在线一区二区三区四区五区| 亚洲精品亚洲人成人网| 欧美久久电影| 亚洲砖区区免费| 午夜国产欧美理论在线播放| 国产三区精品| 乱中年女人伦av一区二区| 久久中文字幕一区二区三区| 亚洲第一天堂av| 亚洲国产精品嫩草影院| 欧美日韩免费一区二区三区| 欧美福利专区| 亚洲视频电影图片偷拍一区| 国产精品三区www17con| 久久精品国产一区二区三| 欧美一区二区三区电影在线观看| 国产自产2019最新不卡| 欧美激情第4页| 国产精品久久福利| 久久久99久久精品女同性| 久久久久青草大香线综合精品| 亚洲电影天堂av| 99日韩精品| 韩曰欧美视频免费观看| 亚洲国产精品久久91精品| 欧美少妇一区| 久久一区中文字幕| 欧美精品一卡| 久久国产天堂福利天堂| 欧美电影在线观看完整版| 午夜影院日韩| 免费黄网站欧美| 香蕉乱码成人久久天堂爱免费| 老司机免费视频一区二区三区| 亚洲特色特黄| 久久久欧美一区二区| 一本一本a久久| 久久精品青青大伊人av| 亚洲图片激情小说| 蜜桃av一区二区| 久久精品国产综合精品| 欧美日韩三级在线| 欧美国产另类| 国产主播精品在线| 亚洲午夜精品一区二区| 91久久亚洲| 久久久激情视频| 国产日韩欧美在线播放不卡| 亚洲国产精品成人综合| 黄色一区二区三区四区| 欧美一级二区| 亚洲欧美中文字幕| 欧美精品在线一区二区| 欧美激情久久久久| 国内外成人免费视频| 亚洲一级高清| 一区二区冒白浆视频| 欧美激情亚洲国产| 亚洲国产va精品久久久不卡综合| 国语自产精品视频在线看8查询8| 亚洲视频网在线直播| 一区二区三区免费网站| 欧美国产日韩在线| 欧美jizzhd精品欧美巨大免费| 黑人操亚洲美女惩罚| 久久一区视频| 精品1区2区3区4区| 久久激情五月婷婷| 久久久久一区| 一区二区三区在线高清| 久久黄色网页| 美女脱光内衣内裤视频久久影院 | 欧美一区二区日韩| 亚洲免费影视| 国产精品三级视频| 亚洲一区亚洲| 午夜一区二区三视频在线观看| 国产精品一级在线| 欧美一区二区三区免费看| 久久精品国产一区二区三| 国产最新精品精品你懂的| 久久久久国产精品一区| 男人的天堂亚洲在线| 亚洲精品免费一区二区三区| 欧美精品手机在线| 中国成人在线视频| 国产日韩精品电影| 久久超碰97人人做人人爱| 久久亚洲精品一区| 亚洲第一页中文字幕| 欧美连裤袜在线视频| 一区二区日韩精品| 久久久99久久精品女同性| 1204国产成人精品视频| 欧美激情一区二区三区在线视频| 亚洲精品乱码久久久久久黑人| 亚洲一级在线| 国产一区二区三区久久悠悠色av | 国产精品日韩精品| 校园春色综合网| 亚洲激情视频在线| 午夜精品久久久久99热蜜桃导演| 国产啪精品视频| 欧美成人一区二区三区| 亚洲一区二区三区成人在线视频精品 | 欧美日韩免费观看一区二区三区 | 亚洲精品影院| 国产精品久久久久99| 久久福利资源站| 亚洲精品五月天| 久久先锋影音| 亚洲网站在线| 在线观看精品| 国产精品视频网| 欧美福利一区二区| 欧美在线免费视屏| 99精品国产高清一区二区| 美日韩精品视频免费看| 午夜精品久久久久久久久| 亚洲人成在线播放网站岛国| 国产精品永久免费观看| 欧美日韩精品伦理作品在线免费观看| 欧美在线亚洲| 亚洲男人第一av网站| 亚洲精品日韩激情在线电影| 欧美a级大片| 久久久久久夜精品精品免费| 亚洲先锋成人| 99精品视频网| 亚洲欧洲日韩综合二区| 亚洲福利视频三区| 黄色亚洲网站| 国产午夜精品在线| 国产精品美女诱惑|