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

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 閱讀(2795) 評論(0)  編輯 收藏 引用

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            六月天综合网| 好吊妞**欧美| 欧美视频在线观看| 欧美日韩国产三级| 国产欧美日韩精品在线| 亚洲第一中文字幕在线观看| 亚洲日本成人网| 亚洲小说欧美另类社区| 久久成人精品电影| 欧美国产欧美亚洲国产日韩mv天天看完整 | 亚洲精品一区二区三区婷婷月| 亚洲伦理中文字幕| 欧美日韩在线第一页| 国产在线欧美| 亚洲一区www| 亚洲网站视频| 男同欧美伦乱| 国产日韩欧美一区二区三区四区| 亚洲国产另类精品专区| 性欧美1819sex性高清| 欧美成人精品高清在线播放| 亚洲色诱最新| 欧美国产日本高清在线| 国精品一区二区| 免费在线播放第一区高清av| 亚洲欧美日韩天堂| 一二三区精品福利视频| 老司机免费视频久久| 欧美电影打屁股sp| 在线观看日韩| 欧美~级网站不卡| 欧美视频你懂的| 久热综合在线亚洲精品| 欧美日韩亚洲高清一区二区| 欧美亚洲专区| 欧美日韩国产123区| 久久国产精品亚洲77777| 亚洲午夜久久久久久尤物| 亚洲福利国产精品| 免费人成网站在线观看欧美高清| 欧美日韩免费观看中文| 免费不卡亚洲欧美| 国产精品视频专区| 亚洲欧美日韩精品综合在线观看 | 亚洲一线二线三线久久久| 亚洲福利国产| 亚洲免费网址| 鲁大师影院一区二区三区| 国内外成人在线| 99国产精品久久久久久久久久| 欧美va亚洲va日韩∨a综合色| 久久成年人视频| 欧美日韩亚洲一区二| 欧美国产日韩精品免费观看| 国产精品一区二区久久久久| 久久精品人人做人人综合| 欧美性视频网站| 亚洲欧美日韩成人| 欧美日韩在线视频一区二区| 免费久久99精品国产自| 国产日韩精品视频一区| 亚洲欧美日韩在线观看a三区| 亚洲一二三区在线| 欧美日韩国产综合视频在线| 亚洲激情婷婷| 国产精品久久久久久久9999| 久久久精品国产免大香伊 | 欧美www视频在线观看| 国产一区二区三区高清| 欧美高清视频在线| 欧美日韩中文另类| 日韩视频免费在线| 国产一区二区三区直播精品电影| 亚洲天堂男人| 香蕉久久夜色| 国产亚洲午夜高清国产拍精品| 亚洲少妇在线| 欧美在线观看天堂一区二区三区| 久久久综合网| 亚洲曰本av电影| 国产精品久线观看视频| 欧美成人亚洲| 99精品欧美一区| 久久国产福利国产秒拍| 亚洲国产日韩欧美综合久久 | 亚洲高清视频一区二区| 亚洲啪啪91| 亚洲欧美日韩国产中文| 久久精品国产亚洲a| 激情另类综合| 亚洲一级在线观看| 久久亚洲精品伦理| 国产精品a久久久久久| 亚洲一区二区三区在线看 | 国产欧美一区二区三区沐欲| 欧美一区二粉嫩精品国产一线天| 一区二区av在线| 国产精品成人在线| 久久精品首页| 久久精品99国产精品| 亚洲国产精品va在线观看黑人| 欧美va亚洲va香蕉在线| 亚洲午夜91| 免费视频一区| 亚洲欧美日韩国产综合| 亚洲电影第1页| 国产精品你懂的在线| 鲁大师影院一区二区三区| 亚洲图片在线观看| 欧美高清一区二区| 欧美在线观看视频一区二区| 亚洲国产影院| 国产日本欧美一区二区三区| 欧美国产日韩视频| 欧美一区1区三区3区公司| 亚洲精品之草原avav久久| 久久精品国产亚洲高清剧情介绍| 亚洲狼人精品一区二区三区| 久久久国产精品一区| 亚洲图片欧洲图片日韩av| 欧美顶级大胆免费视频| 久久精品91| 亚洲在线观看视频网站| 亚洲国产精品999| 国产欧美日韩专区发布| 欧美日韩中文字幕在线视频| 你懂的成人av| 久久久久久久久久久一区| 亚洲一区二区三区免费观看 | 午夜在线一区二区| 中文久久精品| 国产精品人人做人人爽| 欧美精品激情在线| 亚洲综合社区| 噜噜噜91成人网| 久久久www免费人成黑人精品| 中文一区字幕| 一本色道久久综合亚洲精品高清| 亚洲福利久久| 亚洲高清久久| 亚洲国产高潮在线观看| 狠狠v欧美v日韩v亚洲ⅴ| 国产美女在线精品免费观看| 国产精品成人一区二区| 国产精品扒开腿做爽爽爽视频| 欧美国产另类| 欧美日韩精品伦理作品在线免费观看| 蜜臀av性久久久久蜜臀aⅴ| 久久看片网站| 免费观看不卡av| 欧美成va人片在线观看| 欧美韩日高清| 欧美日韩精品一区二区三区四区| 欧美日韩精品在线| 国产精品美女久久久久久久| 国产精品久久久久久超碰| 国产精品美女久久久久久2018| 国产精品久久久一区二区三区| 国产精品成人一区二区| 国产欧美日韩专区发布| 在线播放国产一区中文字幕剧情欧美| 国内综合精品午夜久久资源| 在线播放中文字幕一区| 亚洲黄色有码视频| 99在线精品免费视频九九视| 亚洲一区免费看| 久久国产精品72免费观看| 久久综合色播五月| 亚洲国产mv| 亚洲一区二区成人在线观看| 欧美一区=区| 欧美精品激情| 国产乱码精品一区二区三区忘忧草 | 国产精品一区二区欧美| 国产一区在线播放| 亚洲二区三区四区| 一区二区三欧美| 最新精品在线| 亚洲一二三区在线观看| 久久精品亚洲一区二区| 欧美xx视频| aa级大片欧美| 久久久久久久一区二区| 欧美乱在线观看| 欧美喷潮久久久xxxxx| 国产精品美女久久久| 亚洲国语精品自产拍在线观看| 正在播放亚洲| 欧美高清视频在线| 亚洲专区一区| 欧美日本亚洲| 在线免费观看日本一区| 午夜久久影院| 欧美一区二区三区四区视频| 欧美激情一区二区三区成人 | 欧美成人官网二区| 在线中文字幕日韩| 欧美承认网站| 在线免费不卡视频| 欧美专区日韩专区|