 |
Как можно поставить пароль на директорию? ??? ????, ????? ???????? ?????????? ??????? ??? ?????? web-??????? Apache
? ??? ????????? ? ??? ????????? ?????? ?? ???? ????? ? ??????, ????? ?
??? ?????????? ????????? ???? .htaccess, ? ??????? ????????? ????????? ?????????:
AuthName ClosedZone
? ?????? ??????, ClosedZone - ??? ???????? ?????????? ???????, ??? ?????
???????????? ? ???????? ??? ??????? ??????, ?? ???? - ????????? ???
????????????. ???? ?? ?????? ???????????? ??????? ????? ?/??? ?????
?????? ????? ? ???????? ?????????? ???????, ?????????? ???????????? ???????.
??????: AuthName "??????? ?????? ??? ????? ? ???????? ????"
AuthType (Basic/ Digest)
??? ????? ?????????? ??????. ??????????? ?????? ???????????? Basic ??????????.
- Basic - ??????? ???????????. ?????????? ???????????? ?? ????? ????????,
?? ?????? ???????? ?????? ?? ??????? ?????????????, ?. ? ?? ????????????
???? ??????????. ??? ??????? ?????????? ????? ??????. ??????????? ????????
?????????? Base64.
- Digest - ?????????????? ??????????? ????? (??????????), ???????
?????????? ????. ??? ???????????????? ?????, ? ??? ????, ??? ?? ????????????
??????, ?????????? ???????? ??????????? ??????? ????? ?????????? ?? ?????
???????? ? ???????. ?? ??????? ?????????? ????? ?????? ? ???, ??? ??? ??
???????????? ?? ???? ???????????????? ???????, ???? ????????? ??? ????????
???????. ???? ????? ?????? ???????????? ? ?????????????????? ????????.
??????: AuthType Basic
AuthUserFile /??????_????_?_?????/.htpasswd
??? ???? ? ?????, ? ??????? ????? ????????? ?????? ? ??????. ???? ???? ?????
????? ??????????? ????? ??? ? ????????????? ? ????? ????????, ???????,
????? web-?????? ??? ??? ?????????, ??? ??????? ????????? ???????????????
???? ??????? ? ????? ????? (?? ????? ??????? - 644). ??????, ???????????
????? ????? ???????? .htpasswd. ????????????? ????????? ???? ? ??????????? ??
????????? ??? ???????????, ?.?. ???? ????? www.
??????: AuthUserFile /home/test/www/site1/public_html/.htpasswd
require valid-user
??? ?????? ??????? ? ???, ??? ?????? ? ?????????? ?????????? ????? ????????
???? ?????????????, ??? ?????? ? ?????? ???? ? ????? .htpasswd. ????
????? ???? ?????? ?????????? ?????????????, ?? ????? ??????????? require
user ??????_?????????????_?????_??????.
??????: require user vasya kolya petya
??????: require valid-user
??? ????????????? ???? .htpasswd?
???? ??????? .htpasswd - ??? ??????? ????????? ????. ?????? ????????????
?????? ? ??? ????? ??????? ???? ?????:??????????_??????. ??? ??????????
??????? ???????????? ??????????? ????????? htpasswd. ???????? ????????,
??? ? ???? ?????? ?????? ??????? ???????? ??????, ?????? ??????????? ??????
???? ?????????? ?????????? htpasswd.
???? ???? .htpasswd ??? ?? ??????????, ????????? htpasswd ?????? ????
???????? ? ?????? -c:
htpasswd -c /??????_????_?_?????/.htpasswd ?????_????????????
??????: htpasswd -c /home/test/www/site1/public_html/.htpasswd vasya
??? ???? ????????? htpasswd ??????? ???? .htpasswd, ???????? ?????? ???
???????????? ? ??????? ?????? ? ???????????? ? ?????????? ??????? ? ???????
? ???? ?????. ??? ?????????? ????????? ????????????? ? ????????? ??????? ???
???????????? ????????? ?????????? ???????? ?? ???????, ?? ??? ????????
????? -c. ??? ???????? ???????????? ?????????? ??????? ???? .htpasswd
??????? ????????? ?????????? ? ??????? ??????? ? ??? ??????? ? ???????.
??? ??????? ???? .htpasswd ???? ???????? ???? ?? ??????????????? ??????? ?? SSH?
???? ???????? ???? ?? ??????????????? ?????? ?? SSH (?????? ? ?????????
?????? ???????), ?? ??? ???????? ????? .htpasswd ????? ???????????????
??????????? windows-??????????. ??? ?????, ????? ??????? ???????????,
??????????? ??? ? ????????? ????????? passwd.exe. ????? ????? ? ????
?? ???????? "Single Password" ? ??????? ?????? "Browse" ?????? ??? ?????
(?????? ??? .htpasswd), ? ? ??????? ????? ???? ?????? ??? ????????????,
?????? ? ?????? ?????? "Encode and Save". ????? ????? ?????????? ????
?????????? ???????? ?? ????????? FTP ? ?????? ?????????? ?? ????? ???????.
? ?????, ? ??? ?????? ????????? ???? .htaccess ? ??????????????? ???????????:
AuthType Basic
AuthName "Secret Zone"
AuthUserFile /home/secret/.htpasswd
require valid-user
|
|