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

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>
            亚洲黄一区二区三区| 欧美激情片在线观看| 99国产精品久久久久久久久久| 国产亚洲视频在线| 国产亚洲欧美一区在线观看 | 亚洲女人小视频在线观看| 亚洲九九精品| 一区二区三欧美| 午夜一区在线| 国模私拍视频一区| 国产真实乱偷精品视频免| 国内精品久久久久影院色| 在线观看精品| 99亚洲精品| 亚洲小视频在线| 在线精品观看| 日韩一级在线| 午夜精品偷拍| 你懂的一区二区| 亚洲免费久久| 欧美一区二区三区免费观看 | 蜜桃久久av一区| 欧美国产精品日韩| 在线亚洲观看| 91久久精品一区| 亚洲国产黄色| 亚洲欧美日韩直播| 欧美国产精品一区| 国产一区二区三区电影在线观看| 伊人婷婷欧美激情| 国产精品稀缺呦系列在线| 精品不卡在线| 亚洲影院污污.| 另类欧美日韩国产在线| 亚洲视频精选在线| 欧美大片91| 午夜精品婷婷| 欧美日韩精品一区二区在线播放| 国产亚洲精品v| 99re6这里只有精品视频在线观看| 国产精品中文字幕在线观看| 91久久久久久久久久久久久| 欧美在线观看视频一区二区三区| 亚洲精品美女久久7777777| 欧美一区二区三区在线观看视频| 欧美精品麻豆| 欧美—级a级欧美特级ar全黄| 国产日韩欧美中文在线播放| av不卡在线| 亚洲国产免费| 免费黄网站欧美| 欧美成人有码| 欧美亚洲第一页| 欧美黄色一区| 老司机一区二区三区| 国产综合欧美在线看| 国产亚洲欧美另类中文| 亚洲欧美一级二级三级| 这里只有精品视频在线| 欧美日韩亚洲激情| 在线午夜精品| 欧美一区二区三区在线看| 日韩视频在线你懂得| 欧美激情国产日韩精品一区18| 亚洲国产激情| 亚洲国产高清在线| 欧美精品一区三区| 欧美日本簧片| 亚洲一区二区三区精品视频| 在线亚洲一区观看| 国产欧美91| 久久久久久亚洲综合影院红桃| 久热国产精品| 久久亚洲欧洲| 亚洲区国产区| 在线中文字幕一区| 国产一区二区三区久久精品| 久久免费午夜影院| 亚洲大片在线| 欧美日韩国产综合一区二区| 亚洲一区视频在线| 欧美一区二区三区免费观看视频| 黄色国产精品| av成人动漫| 亚洲欧美日韩成人| 在线视频国内自拍亚洲视频| 亚洲国产精品成人精品| 欧美性视频网站| 久久久中精品2020中文| 亚洲级视频在线观看免费1级| 欧美激情精品| 欧美一区二区三区男人的天堂| 久久99伊人| 亚洲黄色成人久久久| 亚洲午夜精品久久| 欧美成人乱码一区二区三区| 99在线热播精品免费| 午夜精品久久久久久久久久久久久| 国语自产精品视频在线看抢先版结局| 欧美 日韩 国产一区二区在线视频| 欧美精品自拍| 国产一区二三区| 最新高清无码专区| 国产一区二区三区直播精品电影| 欧美激情影院| 国产欧美视频一区二区| 91久久精品国产| 午夜欧美视频| 99pao成人国产永久免费视频| 欧美一区精品| 在线视频精品一| 麻豆成人91精品二区三区| 欧美伊久线香蕉线新在线| 欧美精品系列| 国产一区在线免费观看| 亚洲精品一区二| 欧美一级久久久久久久大片| 一本色道久久综合亚洲精品不| 久久久久88色偷偷免费| 欧美亚洲专区| 欧美日韩一区二区三区在线视频| 亚洲人成在线免费观看| 亚洲欧美一区二区视频| 99在线|亚洲一区二区| 久久综合电影一区| 久久久噜噜噜久噜久久 | 久久免费视频这里只有精品| 欧美日韩在线视频一区二区| 欧美高清视频一区| 狠狠色狠色综合曰曰| 亚洲综合清纯丝袜自拍| 亚洲一区二区在线免费观看视频| 亚洲靠逼com| 亚洲精品久久久久久久久| 开心色5月久久精品| 久久女同精品一区二区| 国产免费观看久久黄| 亚洲男女毛片无遮挡| 国产精品免费观看在线| 一本久久综合亚洲鲁鲁五月天| 日韩性生活视频| 欧美日韩国产亚洲一区| 亚洲美女av网站| 亚洲午夜极品| 国产精品久久久久久久午夜| 午夜视频一区| 国产手机视频一区二区| 午夜久久黄色| 久久精品国产亚洲高清剧情介绍| 国产精品羞羞答答xxdd| 亚洲男女自偷自拍图片另类| 国产日韩欧美精品一区| 香蕉久久久久久久av网站| 久久av一区二区三区| 国产亚洲精品一区二区| 久久视频一区| 亚洲人成久久| 国产精品美女www爽爽爽视频| 亚洲一区国产一区| 久久免费精品视频| 亚洲精品网站在线播放gif| 欧美三级精品| 久久精品观看| 一个色综合导航| 国产精品视频男人的天堂| 久久国产精品久久久久久| 亚洲第一精品福利| 亚洲欧美国产一区二区三区| 国产自产2019最新不卡| 欧美黄色免费网站| 午夜精品视频网站| 亚洲国产精品第一区二区| 欧美日韩免费在线观看| 欧美一区二区观看视频| 亚洲国产91色在线| 亚洲一区二区成人在线观看| 国产欧美日韩亚洲一区二区三区| 久久蜜桃资源一区二区老牛| 亚洲精品视频在线看| 国产精品日韩久久久| 1024成人| …久久精品99久久香蕉国产| 欧美插天视频在线播放| 亚洲综合欧美| 亚洲国产专区校园欧美| 久久国产精品一区二区三区| 99视频一区二区| 免费影视亚洲| 欧美一级片在线播放| 亚洲高清不卡在线| 久久精品欧美日韩精品| 在线视频日韩精品| 亚洲国产精品成人| 国产亚洲一区精品| 亚洲欧美国产高清| 亚洲精品一区二区三区蜜桃久| 噜噜噜在线观看免费视频日韩| 午夜精品久久久久久久久久久久久| 亚洲片区在线| 亚洲电影免费观看高清|