|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
看不懂man文档的人.在linux中,命令可分为系统基本命令和应用程序命令.系统基本命令是所有的unix类系统都支持的命令,走到哪都不变,只要是unix类系统上就肯定有.
前段工夫碰着一名牛B的人物,帮我修改了vsftpd基于PAM认证的成绩.明天又碰着N个成绩,好比Accessdenied.和403毛病,没法上传文件等等之类的毛病.因而,只好请这个高人再次出马,协助再次修改.很感激这位牛B人物.在好处年夜于统统的这个X蛋的社会,还能为了我们这群小菜鸟往剖析N个文件..这类精力其实是值得信服.
针对我本人自己呈现的成绩,将高人与我的QQ谈天纪录收拾了一份,然后再加上实践的操纵.终究让我年夜彻年夜悟.如今与人人狠狠的分享这位高人的功效.
用户上传文件会见呈现403大概Accessdenied.
解答:这个次要是权限成绩,在用户vsftpd.conf中加上:anon_umask=022大概anon_umask=133,022指755权限.133指644权限,再将给权限给该文件chmod644XX.php大概chmod644name
用户没法上传文件,呈现550大概是553毛病
多是用户组有成绩.好比你的网站用www这个用户来会见,那末就将vsftpd.conf中的guest_username=XXX改成www
别的贴出来我的vsftpd的设置文件:
.代码以下:
#Exampleconfigfile/etc/vsftpd/vsftpd.conf
#
#Thedefaultcompiledinsettingsarefairlyparanoid.Thissamplefile
#loosensthingsupabit,tomaketheftpdaemonmoreusable.
#Pleaseseevsftpd.conf.5forallcompiledindefaults.
#
#READTHIS:ThisexamplefileisNOTanexhaustivelistofvsftpdoptions.
#Pleasereadthevsftpd.conf.5manualpagetogetafullideaofvsftpds
#capabilities.
#
#AllowanonymousFTP?(Beware-allowedbydefaultifyoucommentthisout).
anonymous_enable=NO
#
#Uncommentthistoallowlocaluserstologin.
local_enable=YES
#
#UncommentthistoenableanyformofFTPwritecommand.
write_enable=YES
#
#Defaultumaskforlocalusersis077.Youmaywishtochangethisto022,
#ifyourusersexpectthat(022isusedbymostotherftpds)
local_umask=022
#
#UncommentthistoallowtheanonymousFTPusertouploadfiles.Thisonly
#hasaneffectiftheaboveglobalwriteenableisactivated.Also,youwill
#obviouslyneedtocreateadirectorywritablebytheFTPuser.
#anon_upload_enable=YES
#
#UncommentthisifyouwanttheanonymousFTPusertobeabletocreate
#newdirectories.
#anon_mkdir_write_enable=YES
#
#Activatedirectorymessages-messagesgiventoremoteuserswhenthey
#gointoacertaindirectory.
dirmessage_enable=YES
#
#Thetargetlogfilecanbevsftpd_log_fileorxferlog_file.
#Thisdependsonsettingxferlog_std_formatparameter
xferlog_enable=YES
#
#MakesurePORTtransferconnectionsoriginatefromport20(ftp-data).
connect_from_port_20=YES
#
#Ifyouwant,youcanarrangeforuploadedanonymousfilestobeownedby
#adifferentuser.Note!Using"root"foruploadedfilesisnot
#recommended!
#chown_uploads=YES
#chown_username=whoever
#
#Thenameoflogfilewhenxferlog_enable=YESandxferlog_std_format=YES
#WARNING-changingthisfilenameaffects/etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
#
#Switchesbetweenloggingintovsftpd_log_fileandxferlog_filefiles.
#NOwritestovsftpd_log_file,YEStoxferlog_file
xferlog_std_format=YES
#
#Youmaychangethedefaultvaluefortimingoutanidlesession.
#idle_session_timeout=600
#
#Youmaychangethedefaultvaluefortimingoutadataconnection.
#data_connection_timeout=120
#
#Itisrecommendedthatyoudefineonyoursystemauniqueuserwhichthe
#ftpservercanuseasatotallyisolatedandunprivilegeduser.
#nopriv_user=ftpsecure
#
#EnablethisandtheserverwillrecogniseasynchronousABORrequests.Not
#recommendedforsecurity(thecodeisnon-trivial).Notenablingit,
#however,mayconfuseolderFTPclients.
#async_abor_enable=YES
#
#BydefaulttheserverwillpretendtoallowASCIImodebutinfactignore
#therequest.TurnonthebelowoptionstohavetheserveractuallydoASCII
#manglingonfileswheninASCIImode.
#BewarethatonsomeFTPservers,ASCIIsupportallowsadenialofservice
#attack(DoS)viathecommand"SIZE/big/file"inASCIImode.vsftpd
#predictedthisattackandhasalwaysbeensafe,reportingthesizeofthe
#rawfile.
#ASCIImanglingisahorriblefeatureoftheprotocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
#Youmayfullycustomisetheloginbannerstring:
#ftpd_banner=WelcometoblahFTPservice.
#
#Youmayspecifyafileofdisallowedanonymouse-mailaddresses.Apparently
#usefulforcombattingcertainDoSattacks.
#deny_email_enable=YES
#(defaultfollows)
#banned_email_file=/etc/vsftpd/banned_emails
#
#Youmayspecifyanexplicitlistoflocaluserstochroot()totheirhome
#directory.Ifchroot_local_userisYES,thenthislistbecomesalistof
#userstoNOTchroot().
#chroot_list_enable=YES
#(defaultfollows)
#chroot_list_file=/etc/vsftpd/chroot_list
#
#Youmayactivatethe"-R"optiontothebuiltinls.Thisisdisabledby
#defaulttoavoidremoteusersbeingabletocauseexcessiveI/Oonlarge
#sites.However,somebrokenFTPclientssuchas"ncftp"and"mirror"assume
#thepresenceofthe"-R"option,sothereisastrongcaseforenablingit.
#ls_recurse_enable=YES
#
#When"listen"directiveisenabled,vsftpdrunsinstandalonemodeand
#listensonIPv4sockets.Thisdirectivecannotbeusedinconjunction
#withthelisten_ipv6directive.
listen=YES
#
#ThisdirectiveenableslisteningonIPv6sockets.TolistenonIPv4andIPv6
#sockets,youmustruntwocopiesofvsftpdwhithtwoconfigurationfiles.
#Makesure,thatoneofthelistenoptionsiscommented!!
#listen_ipv6=YES
pam_service_name=vsftpd
<strong>user_config_dir=/etc/vsftpd/user_config_dir/*基于PAM认证用到的*/
userlist_enable=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=www/*注重这里.很有多是由于你的用户招致你的权限出成绩*/
local_root=/home/www
anon_umask=022/*这里是方才下面提到的权限成绩*/
</strong>
假如你已是利用了RAM认证的.那末你能够参考下我的单个用户的设置.文件以下
.代码以下:
<strong>anon_world_readable_only=NO
write_enable=YES
anon_upload_enable=YES
anon_other_write_enable=YES
local_root=/var/public
anon_mkdir_write_enable=YES
</strong>
写学习日记,这是学习历程的见证,同时我坚持认为是增强学习信念的法宝。以上是我学习Linux的心得体会,希望对大家的学习有所帮助,由于水平有限,本文难免有所欠缺,望请指正。 |
|