涓嬮潰锛屽氨缁欏ぇ瀹朵粙缁嶈繖浜汣entOS甯哥敤鍛戒护銆�
涓�锛氫娇鐢–entOS甯哥敤鍛戒护鏌ョ湅cpu
more/proc/cpuinfo | grep"model name"grep"model name"/proc/cpuinfo
[root@localhost/]# grep"CPU"/proc/cpuinfo
model name : Intel(R) Pentium(R) Dual CPU E2180 @2.00GHz
model name : Intel(R) Pentium(R) Dual CPU E2180 @2.00GHz
濡傛灉瑙夊緱闇�瑕佺湅鐨勬洿鍔犺垝鏈�
grep"model name"/proc/cpuinfo | cut -f2 -d:
浜岋細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅鍐呭瓨
grep MemTotal/proc/meminfo grep MemTotal /proc/meminfo | cut -f2 -d: free -m |grep"Mem"| awk'{print $2}'涓夛細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅cpu鏄�32浣嶈繕鏄�64浣�
鏌ョ湅CPU浣嶆暟(32or64)
getconf LONG_BIT
鍥涳細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅褰撳墠linux鐨勭増鏈�
more/etc/redhat-release
cat/etc/redhat-release
浜旓細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅鍐呮牳鐗堟湰
uname-r
uname-a
鍏細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅褰撳墠鏃堕棿
date涓婇潰宸茬粡浠嬬粛濡備綍鍚屾鏃堕棿浜�
涓冿細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅纭洏鍜屽垎鍖�
df-h
fdisk-l
涔熷彲浠ユ煡鐪嬪垎鍖�
du-sh
鍙互鐪嬪埌鍏ㄩ儴鍗犵敤鐨勭┖闂�
du/etc -sh
鍙互鐪嬪埌杩欎釜鐩綍鐨勫ぇ灏�
鍏細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅瀹夎鐨勮蒋浠跺寘
鏌ョ湅绯荤粺瀹夎鐨勬椂鍊欒鐨勮蒋浠跺寘
cat-n /root/install.log
more/root/install.log | wc -l
鏌ョ湅鐜板湪宸茬粡瀹夎浜嗛偅浜涜蒋浠跺寘
rpm-qa
rpm-qa | wc -l
yum list installed| wc -l
涓嶈繃寰堝鎬紝鎴戦�氳繃rpm锛屽拰yum杩欎袱绉嶆柟寮忔煡璇㈢殑瀹夎杞欢鍖咃紝鏁伴噺骞朵笉涓�鏍枫�傛病鏈夋壘鍒板師鍥犮��
涔濓細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅閿洏甯冨眬
cat/etc/sysconfig/keyboard
cat/etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=鍗侊細浣跨敤CentOS甯哥敤鍛戒护鏌ョ湅selinux鎯呭喌
sestatus
sestatus| cut -f2 -d:
cat/etc/sysconfig/selinux
鍗佷竴锛氫娇鐢–entOS甯哥敤鍛戒护鏌ョ湅ip锛宮ac鍦板潃
鍦╥fcfg-eth0 鏂囦欢閲屼綘鍙互鐪嬪埌mac锛岀綉鍏崇瓑淇℃伅銆� ifconfig cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut -f2 -d= ifconfig eth0 |grep"inet addr:"|awk'{print $2}'|cut -c6- ifconfig | grep'inet addr:'| grep -v'127.0.0.1'| cut -d: -f2 | awk'{ print $1}'鏌ョ湅缃戝叧 cat /etc/sysconfig/network 鏌ョ湅dns cat /etc/resolv.conf 鍗佷簩锛氫娇鐢–entOS甯哥敤鍛戒护鏌ョ湅榛樿璇█
echo $LANG $LANGUAGE
cat/etc/sysconfig/i18n
鍗佷簩锛氫娇鐢–entOS甯哥敤鍛戒护鏌ョ湅鎵�灞炴椂鍖哄拰鏄惁浣跨敤UTC鏃堕棿
cat/etc/sysconfig/clock
鍗佷笁锛氫娇鐢–entOS甯哥敤鍛戒护鏌ョ湅涓绘満鍚�
hostname
cat/etc/sysconfig/network
淇敼涓绘満鍚嶅氨鏄慨鏀硅繖涓枃浠讹紝鍚屾椂鏈�濂戒篃鎶奾ost鏂囦欢涔熶慨鏀广��
鍗佸洓锛氫娇鐢–entOS甯哥敤鍛戒护鏌ョ湅寮�鏈鸿繍琛屾椂闂�
uptime09:44:45up67days,23:32, ...
鐪嬫潵鍒氭墠纭疄鏄綉娈电殑闂锛屾垜鐨勬満鍣ㄨ繕鏄�67澶╁墠寮�鏈虹殑銆�
#绯荤粺璧勬簮浣跨敤鎯呭喌
vmstat1-S m procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi boincs us sy id wa st0002331997780042511309600000233199778000010298561318600鍗佷簲锛氫娇鐢–entOS甯哥敤鍛戒护鏌ョ湅寮�鏈鸿繍琛屾椂闂�
uptime09:44:45up67days,23:32, ...
鐪嬫潵鍒氭墠纭疄鏄綉娈电殑闂锛屾垜鐨勬満鍣ㄨ繕鏄�67澶╁墠寮�鏈虹殑銆�
#绯荤粺璧勬簮浣跨敤鎯呭喌1. vmstat1-S m2. procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------3. r b swpd free buff cache si so bi boincs us sy id wa st4.00023319977800425113096005.0002331997780000102985613186006.
瀵瑰ぇ瀹舵帹鑽愬緢濂戒娇鐢ㄧ殑Linux CentOS绯荤粺锛屽儚璁╁ぇ瀹跺Linux CentOS绯荤粺鏈夋墍浜嗚В锛岀劧鍚庡Linux CentOS绯荤粺鍏ㄩ潰璁茶В浠嬬粛锛屽笇鏈涘澶у鏈夌敤Linux CentOS甯哥敤鐨勫懡浠�.
wget$ wget-r -np -nd http://example.com/packages/ 杩欐潯鍛戒护鍙互涓嬭浇http://example.com缃戠珯涓� packages 鐩綍涓殑鎵�鏈夋枃浠躲�侺inux CentOS鍏朵腑锛�-np 鐨勪綔鐢ㄦ槸涓嶉亶鍘嗙埗鐩綍锛�-nd 琛ㄧず涓嶅湪鏈満閲嶆柊鍒涘缓鐩綍缁撴瀯銆�$ wget -r -np -nd --accept=iso http://example.com/centos-5/i386/ 涓庝笂涓�鏉″懡浠ょ浉浼硷紝Linux CentOS浣嗗鍔犱簡涓�涓� --accept=iso 閫夐」锛岃繖鎸囩ず wget 浠呬笅杞� i386 鐩綍涓墍鏈夋墿灞曞悕涓� iso 鐨勬枃浠躲�備綘涔熷彲浠ユ寚瀹氬涓墿灞曞悕锛孡inux CentOS鍙渶鐢ㄩ�楀彿鍒嗛殧鍗冲彲銆�$ wget -i filename.txt 姝ゅ懡浠ゅ父鐢ㄤ簬鎵归噺涓嬭浇鐨勬儏褰紝Linux CentOS鎶婃墍鏈夐渶瑕佷笅杞芥枃浠剁殑鍦板潃鏀惧埌 filename.txt 涓紝鐒跺悗 wget 灏变細鑷姩涓轰綘涓嬭浇鎵�鏈夋枃浠朵簡銆� Linux CentOS$ wget -c http://example.com/really-big-file.iso 杩欓噷鎵�鎸囧畾鐨� -c 閫夐」鐨勪綔鐢ㄤ负鏂偣缁紶銆�$ wget -m -k (-H) http://www.example.com/ 璇ュ懡浠ゅ彲鐢ㄦ潵闀滃儚涓�涓綉绔欙紝wget 灏嗗閾炬帴杩涜杞崲銆侺inux CentOS濡傛灉缃戠珯涓殑鍥惧儚鏄斁鍦ㄥ彟澶栫殑绔欑偣锛岄偅涔堝彲浠ヤ娇鐢� -H 閫夐」銆俈I 缂栬緫鍛戒护鍛戒护妯″紡
绉诲姩鍏夋爣
[Ctrl]+[f] 鈫� 灞忓箷銆庡悜涓嬨�忕Щ鍔ㄤ竴椤碉紝鐩稿綋浜� [Page Down]鎸夐敭
[Ctrl]+[b] 鈫� 灞忓箷銆庡悜涓娿�忕Щ鍔ㄤ竴椤碉紝鐩稿綋浜� [Page Up] 鎸夐敭
n鈫� n 琛ㄧず銆庢暟瀛椼�忋�傛寜涓嬫暟瀛楀悗鍐嶆寜绌虹櫧閸碉紝鍏夋爣浼氬悜鍙崇Щ鍔ㄨ繖涓�琛岀殑 n 涓瓧鍏�0鈫� 鏁板瓧銆�0銆忥細绉诲姩鍒拌繖涓�琛岀殑鏈�鍓嶉潰瀛楀厓澶�
$ 鈫� 绉诲姩鍒拌繖涓�琛岀殑鏈�鍚庨潰瀛楀厓澶�
G 鈫� 绉诲姩鍒拌繖涓枃浠剁殑鏈�鍚庝竴琛�
nG 鈫� n 涓烘暟瀛椼�傜Щ鍔ㄥ埌杩欎釜鏂囦欢鐨勭 n 琛�(鍙厤鍚� :setnu)
gg 鈫� 绉诲姩鍒拌繖涓枃浠剁殑绗竴琛岋紝鐩稿綋浜� 1G
n鈫� n 涓烘暟瀛椼�傚厜鏍囧悜涓嬬Щ鍔� n 琛�
Linux CentOS鏌ユ壘涓庢浛鎹�
n 鈫� 銆庨噸澶嶅墠涓�涓煡鎵剧殑鍔ㄤ綔銆�
N 鈫� 涓� n 鍒氬ソ鐩稿弽锛屼负銆庡弽鍚戙�忚繘琛屽墠涓�涓煡鎵惧姩浣�
:n1,n2s/word1/word2/g 鈫� n1 涓� n2 鍧囦负鏁板瓧銆傚湪绗� n1 涓� n2 琛屼箣闂存煡鎵� word1 瀛楃涓诧紝骞跺皢璇ュ瓧绗︿覆鏇挎崲涓� word2銆�
濡傦細鍦�1鍒�9琛屼箣闂存煡鎵� eric4ever 骞舵浛鎹负 ERIC4EVER 鍒欙細銆�:1,9s/eric4ever/ERIC4EVER/g銆�
:1,$s/word1/word2/g 鈫� 浠庣涓�琛屽埌鏈�鍚庝竴琛屾煡鎵� word1 瀛楃涓诧紝骞跺皢璇ュ瓧绗︿覆鏇挎崲涓� word2
:1,$s/word1/word2/gc 鈫� 浠庣涓�琛屽埌鏈�鍚庝竴琛屾煡鎵� word1 瀛楃涓诧紝骞跺皢璇ュ瓧绗︾獥鏇挎崲涓� word2锛屾浛鎹㈠墠鏄剧ず鎻愮ず瀵硅瘽妗嗘槸鍚︾‘璁ゆ浛鎹�
Linux CentOS鍒犻櫎銆佸鍒朵笌绮樿创
x, X 鈫� 鍦ㄤ竴琛屽瓧褰撲腑锛寈 涓哄悜鍚庡埅闄や竴涓瓧鍏� (鐩稿綋浜� [del] 鎸夐敭)锛�
X 涓哄悜鍓嶅埅闄や竴涓瓧鍏�(鐩稿綋浜� [backspace] 鎸夐敭)
dd 鈫� 鍒櫎鍏夋爣鎵�鍦ㄧ殑閭d竴鏁磋
ndd 鈫� n 涓烘暟瀛椼�傚埅闄ゅ厜鏍囨墍鍦ㄧ殑鍚戜笅 n 鍒�
yy 鈫� 澶嶅埗鍏夋爣鎵�鍦ㄧ殑閭d竴琛�
nyy 鈫� n 涓烘暟瀛椼�傚鍒跺厜鏍囨墍鍦ㄧ殑鍚戜笅 n 鍒�
p, P 鈫� p 涓哄皢宸插鍒剁殑鍐呭绮樿创鍦ㄥ厜鏍囦笅涓�琛屼笂锛孭 鍒欎负绮樿创鍦ㄥ厜鏍囩殑涓婁竴琛�
u 鈫� 杩樺師鍓嶄竴涓姩浣�
[Ctrl]+r 鈫� 閲嶅仛涓婁竴涓姩浣�
. 鈫� 灏忔暟鐐癸紝鎰忔�濇槸閲嶅鍓嶄竴涓姩浣�
Linux CentOS缂栬緫妯″紡i, I 鈫� 鎻掑叆锛氬湪鐩墠鐨勫厜鏍囨墍鍦ㄥ鎻掑叆杈撳叆鐨勬枃瀛楋紝宸插瓨鍦ㄧ殑鏂囧瓧浼氬悜鍚庨��锛� 鍏朵腑锛� i 涓恒�庝粠鐩墠鍏夋爣鎵�鍦ㄥ鎻掑叆銆忥紝 I 涓恒�庡湪鐩墠鎵�鍦ㄨ鐨勭涓�鍊嬮潪绌虹櫧瀛楀厓澶勫紑濮嬫彃鍏ャ�廰, A 鈫� a 涓恒�庝粠鐩墠鍏夋爣鎵�鍦ㄧ殑涓嬩竴涓瓧鍏冨寮�濮嬫彃鍏ャ�忥紝 A 涓恒�庝粠鍏夋爣鎵�鍦ㄨ鐨勬渶鍚庝竴涓瓧鍏冨寮�濮嬫彃鍏ャ��
o, O 鈫� o 涓恒�庡湪鐩墠鍏夋爣鎵�鍦ㄧ殑涓嬩竴琛屽鎻掑叆鏂扮殑涓�琛屻�忥紝 O 涓恒�庡湪鐩墠鍏夋爣鎵�鍦ㄥ鐨勪笂涓�琛屾彃鍏ユ柊鐨勪竴琛屻��
r, R 鈫� r 涓恒�庡彇浠e厜鏍囨墍鍦ㄧ殑閭d竴涓瓧鍏冦�忥紝 R 涓恒�庝竴鐩村彇浠e厜鏍囨墍鍦ㄧ殑鏂囧瓧锛岀洿鍒版寜涓� ESC 涓烘銆�
Esc 鈫� 閫�鍑虹紪杈戞ā寮忥紝鍥炲埌涓�鑸ā寮忎腑
Linux CentOS鏈鎸囦护妯″紡
:w 鈫� 灏嗙紪杈戠殑鏂囦欢鍐欏叆鍒扮‖鐩樹笂
:q 鈫� 閫�鍑� vi
:setnu 鈫� 鏄剧ず琛屽彿
:setnonu 鈫� 鍙栨秷鏄剧ず琛屽彿
Linux CentOSvim 鍧楁搷浣�
Ctrl+v 杩涘叆瑙嗗浘妯″紡閫�鍑鸿鍥炬ā寮�
鍦–trl+v 鍚�:+A鍦ㄥ潡鐨勬瘡琛屾湯灏炬坊鍔�
I 鎻掑叆
y 鍧楁娊鍙�
p 鍧楃矘璐�
c 淇敼
Linux centos宸茶骞挎硾搴旂敤浣嗘槸涔熷湪涓嶆柇鐨勬洿鏂帮紝杩欓噷浠嬬粛Linux centos瀹夎璁剧疆浣跨敤锛屽府鍔╁ぇ瀹跺畨瑁呮洿鏂癓inux centos绯荤粺鎵嬪姩閰嶇疆Linux centos鐨処P鍦板潃
浠婂ぉ鍦╲mware server涓婅浜嗕釜centos-4.7锛堝厤璐圭殑redhat,鏄皬绾㈠附鐨勭殑鍏嬮殕鐗堟湰锛岃窡灏忕孩甯界殑鐗堟湰鏄搴旂殑锛�,鍏朵腑ip瀹夎鏃舵病璁惧ソ锛屼竴鑸琇inux centos鐨勭綉鍗P鍦板潃鏄瓨鏀惧湪鏂囦欢涓殑锛岃繖涓厤缃枃浠跺湪/etc/sysconfig/network-scripts涓嬶紝
鍚嶇О鍒嗗埆涓篿fcfg-eth0,ifcfg-eth1....濡傛灉浣犳湁涓�鍧楃綉鍗★紝灏卞彧鏈塱fcfg-eth0涓�涓枃浠讹紝濡傛灉浣犳湁涓ゅ潡鎴栬�呬袱鍧椾互涓婄殑缃戝崱锛屽氨浼氭湁ifcfg-eth1銆乮fcfg-eth2绛夋枃浠剁殑鍑虹幇銆�
鏂囦欢缁撴瀯锛�
DEVICE=eth0//鎸囧嚭璁惧鍚嶇ОONBOOT=yes//鏄惁鍚姩搴旂敤BOOTPROTO=static//鍚姩绫诲瀷 闈欐�� 锛堥粯璁hcp锛塈PADDR=192.168.0.77//IP鍦板潃NETMASK=255.255.255.0//瀛愮綉鎺╃爜GATEWAY=192.168.0.1//缃戝叧姝ラ锛�1銆乿i /etc/sysconfig/network-scripts/ifcfg-teh0 锛堜篃鍙�氳繃绠$悊宸ュ叿setup鎴杗etconfig鍛戒护璁剧疆锛�2銆侀噸鏂板惎鍔ㄧ綉缁滄湇鍔ervice network restart
瑕佹兂鍜屼富鏈鸿繛鎺ワ細杩橀渶閰嶇疆xp涓绘満锛屽湪vmware涓婅缃负 host-only妯″紡锛寈p閲屼慨鏀箆mnet1鐨処P鍦板潃涓�192.168.0.1, 淇敼Linux centos IP涓�192.168.0.77鍏变韩涓婄綉璁剧疆锛歺p閲屼慨鏀圭涓�鍧楄櫄鎷熺綉鍗$殑缃戠粶灞炴�т负鍏变韩internet(灞炴��->楂樼骇->閽╅�夆�滃厑璁稿叾浠栫綉缁滅敤鎴烽�氳繃姝よ绠楁満鐨処nternet杩炴帴鏉ヨ繛鎺モ��) 浼氳嚜鍔ㄦ妸vmnet1鏀逛负192.168.0.1,Linux centos灏辫兘涓婄綉浜�
CentOS Vsftpd閰嶇疆缁忚繃闀挎椂闂寸殑鍙戝睍锛岃繖閲屾垜鍙戣〃涓�涓嬩釜浜虹悊瑙o紝涓嬮潰灏辫繖灏辨潵璁叉湳CentOS Vsftpd閰嶇疆銆傝皟鏁碈entOS Vsftpd閰嶇疆鏂囦欢锛�1.缂栬緫CentOS Vsftpd閰嶇疆鏂囦欢鍓嶅厛澶囦唤
[root@KcentOS5~]cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.backup2.缂栬緫涓籆entOS Vsftpd閰嶇疆鏂囦欢Vsftpd.conf
[root@KcentOS5~]vi /etc/vsftpd/vsftpd.conf
杩欓噷鎴戝皢鍘烠entOS Vsftpd閰嶇疆鏂囦欢鐨勪慨鏀瑰畬鍏ㄨ褰曪紝鍑℃槸淇敼鐨勫湴鏂规垜閮戒細淇濈暀娉ㄩ噴鍘熸潵鐨勯厤缃�傚叾涓姞鍏ユ垜瀵规瘡鏉¢厤缃」鐨勮璇嗭紝瀵逛簬涓�浜涙瘮杈冨叧閿殑閰嶇疆椤硅繖閲屾垜鍋氫簡鎴戠殑瑙傜偣锛屽苟涓斿師鏈嫳璇殑璇存槑鎴戜篃涓嶅垹闄わ紝渚涘弬鑰冨姣旂敤銆�
Example config file/etc/vsftpd/vsftpd.conf
Thedefaultcompiledinsettings are fairly paranoid. This sample file
loosens things up a bit, to make the ftp daemon more usable.
Please see vsftpd.conf.5forall compiledindefaults.
READ THIS: This example fileisNOT an exhaustive list of vsftpd options.
Please read the vsftpd.conf.5manual page togeta full idea of vsftpd'scapabilities.
Allow anonymous FTP? (Beware - allowed bydefaultifyou commentthisout).
anonymous_enable=YES
anonymous_enable=NO
璁惧畾涓嶅厑璁稿尶鍚嶈闂�
Uncommentthisto allow local users to login.
local_enable=YES璁惧畾鏈湴鐢ㄦ埛鍙互璁块棶銆傛敞鎰忥細涓昏鏄负铏氭嫙瀹夸富鐢ㄦ埛锛屽鏋滆椤圭洰璁惧畾涓篘O閭d箞鎵�鏈夎櫄鎷熺敤鎴峰皢鏃犳硶璁块棶銆�
Uncommentthisto enable any form of FTP write command.
write_enable=YES
璁惧畾鍙互杩涜鍐欐搷浣溿��
Default umaskforlocal usersis077. You may wish to changethisto022,ifyour users expect that (022isused by most other ftpd's)local_umask=022璁惧畾涓婁紶鍚庢枃浠剁殑鏉冮檺鎺╃爜銆�
Uncommentthisto allow the anonymous FTP user to upload files. This only
has an effectifthe aboveglobalwrite enableisactivated. Also, you will
obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
anon_upload_enable=NO
绂佹鍖垮悕鐢ㄦ埛涓婁紶銆�
Uncommentthisifyou want the anonymous FTP user to be able to createnewdirectories.
anon_mkdir_write_enable=YES
anon_mkdir_write_enable=NO
绂佹鍖垮悕鐢ㄦ埛寤虹珛鐩綍銆�
Activate directory messages-messages given to remote users when they
go into a certain directory.
dirmessage_enable=YES
璁惧畾寮�鍚洰褰曟爣璇姛鑳姐��
Activate logging of uploads/downloads.
xferlog_enable=YES
璁惧畾寮�鍚棩蹇楄褰曞姛鑳姐��
Make sure PORT transfer connections originatefromport20(ftp-data).
connect_from_port_20=YES
璁惧畾绔彛20杩涜鏁版嵁杩炴帴銆�
If you want, you can arrangeforuploaded anonymous files to be owned by
a different user. Note! Using"root"foruploaded filesisnot
recommended!chown_uploads=YES
chown_uploads=NO
璁惧畾绂佹涓婁紶鏂囦欢鏇存敼瀹夸富銆�
chown_username=whoever
You mayoverridewherethe log file goesifyou like. Thedefaultisshown
below.
xferlog_file=/var/log/vsftpd.log
璁惧畾CentOS Vsftpd閰嶇疆鐨勬湇鍔℃棩蹇椾繚瀛樿矾寰勩�傛敞鎰忥紝璇ユ枃浠堕粯璁や笉瀛樺湪銆傚繀椤昏鎵嬪姩touch鍑烘潵锛屽苟涓旂敱浜庤繖閲屾洿鏀逛簡CentOS Vsftpd閰嶇疆鐨勬湇鍔″涓荤敤鎴蜂负鎵嬪姩寤虹珛鐨刅sftpd銆傚繀椤绘敞鎰忕粰涓庤鐢ㄦ埛瀵规棩蹇楃殑鍐欏叆鏉冮檺锛屽惁鍒欐湇鍔″皢鍚姩澶辫触銆�
If you want, you can have your log fileinstandard ftpd xferlog format
xferlog_std_format=YES
璁惧畾鏃ュ織浣跨敤鏍囧噯鐨勮褰曟牸寮忋��
You may change thedefaultvaluefortimingoutan idle session.
idle_session_timeout=600璁惧畾绌洪棽杩炴帴瓒呮椂鏃堕棿锛岃繖閲屼娇鐢ㄩ粯璁ゃ�傚皢鍏蜂綋鏁板�肩暀缁欐瘡涓叿浣撶敤鎴峰叿浣撴寚瀹氾紝褰撶劧濡傛灉涓嶆寚瀹氱殑璇濓紝杩樻槸浣跨敤杩欓噷鐨勯粯璁ゅ��600锛屽崟浣嶇銆�
You may change thedefaultvaluefortimingouta data connection.
data_connection_timeout=120璁惧畾鍗曟鏈�澶ц繛缁紶杈撴椂闂达紝杩欓噷浣跨敤榛樿銆傚皢鍏蜂綋鏁板�肩暀缁欐瘡涓叿浣撶敤鎴峰叿浣撴寚瀹氾紝褰撶劧濡傛灉涓嶆寚瀹氱殑璇濓紝杩樻槸浣跨敤杩欓噷鐨勯粯璁ゅ��120锛屽崟浣嶇銆�
Itisrecommended that you define on your system a unique user which the
ftp server can useasa totally isolated and unprivileged user.
nopriv_user=ftpsecure
nopriv_user=vsftpd
璁惧畾鏀拺CentOS Vsftpd鏈嶅姟鐨勫涓荤敤鎴蜂负鎵嬪姩寤虹珛鐨刅sftpd鐢ㄦ埛銆傛敞鎰忥紝涓�鏃﹀仛鍑烘洿鏀瑰涓荤敤鎴峰悗锛屽繀椤绘敞鎰忎竴璧蜂笌璇ユ湇鍔$浉鍏崇殑璇诲啓鏂囦欢鐨勮鍐欒祴鏉冮棶棰樸�傛瘮濡傛棩蹇楁枃浠跺氨蹇呴』缁欎笌璇ョ敤鎴峰啓鍏ユ潈闄愮瓑銆�
Enablethisand the server will recognise asynchronous ABOR requests. Not
recommendedforsecurity (the codeisnon-trivial). Not enabling it,
however, may confuse older FTP clients.
async_abor_enable=YES
璁惧畾鏀寔寮傛浼犺緭鍔熻兘銆�
Bydefaultthe server will pretend to allow ASCII mode butinfact ignore
the request. Turn on the below options to have the server actuallydoASCII
mangling on files wheninASCII mode.
Beware that on some FTP servers, ASCII support allows a denial of service
attack (DoS) via the command"SIZE /big/file"inASCII mode. vsftpd
predictedthisattack and has always been safe, reporting the size of the
raw file.
ASCII manglingisa horrible feature of the protocol.
ascii_upload_enable=YES
ascii_download_enable=YES
璁惧畾鏀寔ASCII妯″紡鐨勪笂浼犲拰涓嬭浇鍔熻兘銆�
You may fully customise the login bannerstring:
ftpd_banner=This Vsftp server supportsvirtualusers ^_^璁惧畾CentOS Vsftpd閰嶇疆鐨勭櫥闄嗘爣璇��
You may specify a file of disallowed anonymous e-mail addresses. Apparently
usefulforcombatting certain DoS attacks.
deny_email_enable=YES
(defaultfollows)
banned_email_file=/etc/vsftpd/banned_emails
You may specify anexplicitlist of local users to chroot() to their home
directory. If chroot_local_userisYES, thenthislist becomes a list of
users to NOT chroot().
chroot_list_enable=YES
chroot_list_enable=NO
绂佹鐢ㄦ埛鐧诲嚭鑷繁鐨凢TP涓荤洰褰曘��
(defaultfollows)
chroot_list_file=/etc/vsftpd/chroot_list
You may activate the"-R"option to the builtin ls. Thisisdisabled bydefaultto avoid remote users being able to cause excessive I/O on large
sites. However, some broken FTP clients suchas"ncftp"and"mirror"assume
the presence of the"-R"option, so thereisa strongcaseforenabling it.
ls_recurse_enable=YES
ls_recurse_enable=NO
绂佹鐢ㄦ埛鐧婚檰FTP鍚庝娇鐢�"ls -R"鐨勫懡浠ゃ�傝鍛戒护浼氬鏈嶅姟鍣ㄦ�ц兘閫犳垚宸ㄥぇ寮�閿�銆傚鏋滆椤硅鍏佽锛岄偅涔堟尅澶氱敤鎴峰悓鏃朵娇鐢ㄨ鍛戒护鏃跺皢浼氬璇ユ湇
鍔″櫒閫犳垚濞佽儊銆�
When"listen"directiveisenabled, vsftpd runsinstandalone mode and
listens on IPv4 sockets. This directive cannot be usedinconjunction
with the listen_ipv6 directive.
listen=YES
璁惧畾璇entOS Vsftpd鏈嶅姟宸ヤ綔鍦⊿tandAlone妯″紡涓嬨�傞『渚垮睍寮�璇存槑涓�涓嬶紝鎵�璋揝tandAlone妯″紡灏辨槸璇ユ湇鍔℃嫢鏈夎嚜宸辩殑瀹堟姢杩涚▼鏀寔锛屽湪ps-A鍛戒护涓嬫垜浠皢鍙敤鐪嬪埌vsftpd鐨勫畧鎶よ繘绋嬪悕銆傚鏋滀笉鎯冲伐浣滃湪StandAlone妯″紡涓嬶紝鍒欏彲浠ラ�夋嫨SuperDaemon妯″紡锛屽湪璇ユā寮忎笅 vsftpd灏嗘病鏈夎嚜宸辩殑瀹堟姢杩涚▼锛岃�屾槸鐢辫秴绾у畧鎶よ繘绋媂inetd鍏ㄦ潈浠g悊锛屼笌姝ゅ悓鏃讹紝Vsftp鏈嶅姟鐨勮澶氬姛鑳藉皢寰椾笉鍒板疄鐜般��
This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
sockets, you must run two copies of vsftpd whith two configuration files.
Make sure, that one of the listen optionsiscommented !!listen_ipv6=YES
pam_service_name=vsftpd
璁惧畾PAM鏈嶅姟涓婥entOS Vsftpd閰嶇疆楠岃瘉鏂囦欢鍚嶃�傚洜姝わ紝PAM楠岃瘉灏嗗弬鑰�/etc/pam.d/涓嬬殑vsftpd鏂囦欢閰嶇疆銆�
userlist_enable=YES
璁惧畾userlist_file涓殑鐢ㄦ埛灏嗕笉寰椾娇鐢‵TP銆�
tcp_wrappers=YES
璁惧畾鏀寔TCP Wrappers銆�
KC: The following entries are addedforsupportingvirtualftp users.
浠ヤ笅杩欎簺鏄叧浜嶸sftpd铏氭嫙鐢ㄦ埛鏀寔鐨勯噸瑕丆entOS Vsftpd閰嶇疆椤圭洰銆傞粯璁sftpd.conf涓笉鍖呭惈杩欎簺璁惧畾椤圭洰锛岄渶瑕佽嚜宸辨墜鍔ㄦ坊鍔犻厤缃��
guest_enable=YES
璁惧畾鍚敤铏氭嫙鐢ㄦ埛鍔熻兘銆�
guest_username=overlord
鎸囧畾铏氭嫙鐢ㄦ埛鐨勫涓荤敤鎴枫��
virtual_use_local_privs=YES
璁惧畾铏氭嫙鐢ㄦ埛鐨勬潈闄愮鍚堜粬浠殑瀹夸富鐢ㄦ埛銆�
user_config_dir=/etc/vsftpd/vconf
璁惧畾铏氭嫙鐢ㄦ埛涓汉Vsftp鐨勯厤缃枃浠跺瓨鏀捐矾寰勩�備篃灏辨槸璇达紝杩欎釜琚寚瀹氱殑鐩綍閲岋紝灏嗗瓨鏀炬瘡涓猇sftp铏氭嫙鐢ㄦ埛涓�х殑閰嶇疆鏂囦欢锛屼竴涓渶瑕佹敞鎰忕殑
鍦版柟灏辨槸杩欎簺閰嶇疆鏂囦欢鍚嶅繀椤诲拰铏氭嫙鐢ㄦ埛鍚嶇浉鍚屻�備繚瀛橀��鍑恒��3.寤虹珛CentOS Vsftpd閰嶇疆鐨勬棩蹇楁枃浠讹紝骞舵洿璇ュ睘涓讳负Vsftpd鐨勬湇鍔″涓荤敤鎴凤細
[root@KcentOS5~]touch /var/log/vsftpd.log
[root@KcentOS5~]chown vsftpd.vsftpd /var/log/vsftpd.log4.寤虹珛铏氭嫙鐢ㄦ埛CentOS Vsftpd閰嶇疆鏂囦欢瀛樻斁璺緞锛�
[root@KcentOS5~]mkdir /etc/vsftpd/vconf/CentOS vsftp宸茶骞挎硾搴旂敤浣嗘槸涔熷湪涓嶆柇鐨勬洿鏂帮紝杩欓噷浠嬬粛CentOS vsftp瀹夎璁剧疆浣跨敤锛屽府鍔╁ぇ瀹跺畨瑁呮洿鏂癈entOS vsftp绯荤粺銆�
CentOS vsftp瀹夎锛�1.瀹夎CentOS Vsftpd鏈嶅姟鐩稿叧閮ㄤ欢锛�
[root@KcentOS5~]# yum install vsftpd*2.纭瀹夎PAM鏈嶅姟鐩稿叧閮ㄤ欢锛�
[root@KcentOS5~]# yum install pam*寮�鍙戝寘锛屽叾瀹炰笉瑁呬篃娌℃湁鍏崇郴锛屼富瑕佺殑鐩殑鏄‘璁AM銆�3.瀹夎DB4閮ㄤ欢鍖咃細
杩欓噷瑕佺壒鍒畨瑁呬竴涓猟b4鐨勫寘锛岀敤鏉ユ敮鎸佹枃浠舵暟鎹簱銆�
[root@KcentOS5~]# yum install db4*CentOS vsftp绯荤粺甯愭埛1.寤虹珛CentOS vsftp鏈嶅姟鐨勫涓荤敤鎴凤細
[root@CentOS5/]#chmod700/home/vftpsite
[root@KcentOS5~]# useradd vsftpd -s /sbin/nologin
榛樿鐨刅sftpd鐨勬湇鍔″涓荤敤鎴锋槸root锛屼絾鏄繖涓嶇鍚堝畨鍏ㄦ�х殑闇�瑕併�傝繖閲屽缓绔嬪悕瀛椾负vsftpd鐨勭敤鎴凤紝鐢ㄤ粬鏉ヤ綔涓烘敮鎸乂sftpd鐨勬湇鍔″涓荤敤鎴枫�傜敱浜庤鐢ㄦ埛浠呯敤鏉ユ敮鎸乂sftpd鏈嶅姟鐢紝鍥犳娌℃湁璁稿彲浠栫櫥闄嗙郴缁熺殑蹇呰锛屽苟璁惧畾浠栦负涓嶈兘鐧婚檰绯荤粺鐨勭敤鎴枫�俒root@CentOS5/]#useradd 鈥揹 /home/vftpsite 鈥搒 /sbin/nologin vftpuser2.寤虹珛CentOS vsftp铏氭嫙瀹夸富鐢ㄦ埛锛�
[root@KcentOS5 nowhere]# useradd overlord-s /sbin/nologin
鏈瘒涓昏鏄粙缁峍sftp鐨勮櫄鎷熺敤鎴凤紝铏氭嫙鐢ㄦ埛骞朵笉鏄郴缁熺敤鎴凤紝涔熷氨鏄杩欎簺FTP鐨勭敤鎴峰湪绯荤粺涓槸涓嶅瓨鍦ㄧ殑銆備粬浠殑鎬讳綋鏉冮檺鍏跺疄鏄泦涓瘎鎵樺湪涓�涓湪绯荤粺涓殑鏌愪竴涓敤鎴疯韩涓婄殑锛屾墍璋揤sftpd鐨勮櫄鎷熷涓荤敤鎴凤紝灏辨槸杩欐牱涓�涓敮鎸佺潃鎵�鏈夎櫄鎷熺敤鎴风殑瀹夸富鐢ㄦ埛銆傜敱浜庝粬鏀拺浜咶TP鐨勬墍鏈夎櫄鎷熺殑鐢ㄦ埛锛岄偅涔堜粬鏈韩鐨勬潈闄愬皢浼氬奖鍝嶇潃杩欎簺铏氭嫙鐨勭敤鎴凤紝鍥犳锛屽浜庡畨鍏ㄦ�х殑鑰冭檻锛屼篃瑕侀潪鍒嗘敞鎰忓璇ョ敤鎴风殑鏉冮檺鐨勬帶鍒讹紝璇ョ敤鎴蜂篃缁濆娌℃湁鐧婚檰绯荤粺鐨勫繀瑕侊紝杩欓噷涔熻瀹氫粬涓轰笉鑳界櫥闄嗙郴缁熺殑鐢ㄦ埛銆�
锛堣繖閲屾彃涓�鍙ワ細鍘熸湰鍦ㄥ缓绔嬩笂闈袱涓敤鎴风殑鏃跺�欙紝鎯宠繛鐢ㄦ埛涓昏矾寰勪篃涓嶆墦绠楃粰鐨勩�傛湰鏉ユ兂鍔犱笂-d /home/nowhere 鐨勶紝鎹甿an useradd鎵嬪唽涓婅
杩帮細鈥�-d, --home HOME_DIR
Thenewuser will be createdusingHOME_DIRasthe valueforthe
user閳� login directory. Thedefaultisto append the LOGIN name to
BASE_DIR and use thatasthe login directory name. The directory
HOME_DIR does not have to exist but will not be createdifitismissing.
浣跨敤-d鍙傛暟鎸囧畾鐢ㄦ埛鐨勪富鐩綍锛岀敤鎴蜂富鐩綍骞朵笉鏄繀椤诲瓨鍦ㄧ殑銆傚鏋滄病鏈夊瓨鍦ㄦ寚瀹氱殑鐩綍鐨勮瘽锛岄偅涔堝畠灏嗕笉浼氳寤虹珛鈥濄�傜粨鏋滄垜灏濊瘯 -d /home/nowhere 鎸囧畾鍒颁竴涓苟涓嶅瓨鍦ㄧ殑鐩綍鐨勬椂鍊欙紝鎴慘AO锛佺珶鐒剁粰鎴戣嚜宸辨柊寤轰簡涓�涓�= =锛冿級
銆愬師鍒涖�慒TP鏈嶅姟鏃朵簰鑱旂綉涓婃瘮杈冨彜鑰佺殑涓�绉嶅簲鐢紝鑷充粖Interner搴旂敤闈㈤潪甯稿箍娉涳紝浣嗕护绠$悊鍛樺ご鐥涗笉宸茬殑鏄叾鐢ㄦ埛绠$悊锛屾棦澶氫笖鏉傦紝濡備綍瑙e喅杩欎竴闂鍛紵浣跨敤MySQL涓嶱roFTP鎴朧sFTP杞欢缁撳悎鍙互鎼缓涓�涓珮鏁堛�佺ǔ瀹氫笖闆嗕腑绠$悊鐨凢TP鏈嶅姟鍣ㄣ�傛湰鏉ュ氨鏉ヤ粙缁嶄竴涓嬪浣曟惌寤轰竴涓柟渚跨鐞嗙殑鍩轰簬MySQL鏁版嵁搴撶殑FTP鏈嶅姟鍣ㄣ��
涓�銆佽蒋浠剁増鏈殑閫夋嫨锛�
鎼缓鍩轰簬鏁版嵁搴撶殑FTP鏈嶅姟鍣ㄩ鍏堣閫夋嫨鍚堥�傜殑杞欢銆備笅闈㈠氨鏄墍閫夋嫨杞欢鐨勮缁嗕俊鎭細
鈼哃inux鐗堟湰RHEL5锛�
鈼哅ySQL鐗堟湰MySQL-standard-5.1.30-1.rhel5.src.rpm;
鈼咶TP鏈嶅姟鍣╬roftpd-1.3.2.tar.gz鍜寁sftpd-2.2.1.tar.gz;
鈼哅ySQL鐨凱AM楠岃瘉绋嬪簭pam_mysql-0.8RC1.tar.gz;
闇�瑕佽鏄庣殑鏄紝RHEL5瀹夎鏃惰嚜瀹氫箟瀹夎锛屸�渄evelopment tools鈥濋」蹇呴』閫夋嫨锛屽惁鍒欑紪璇戣皟璇曡蒋浠舵椂闇�瑕佺殑杞欢鍖呴渶鍙﹁瀹夎锛涘叾娆★紝瑕佺‘淇濇墍瀹夎Linux绯荤粺鏃舵病鏈夊畨瑁匨ySQL涓嶧TP鏈嶅姟鍣ㄧ瓑杞欢锛屽鏋滄湁鍒欏厛鍗歌浇锛涘啀娆★紝ProFTPD涓嶸sFTPD涓よ�呬笉瑕佸湪鍚屽彴璁$畻鏈哄悓鏃朵娇鐢紝杩欐牱浼氶�犳垚鎰忔兂涓嶅埌鐨勯棶棰橈紝璇昏�呮牴鎹嚜宸辩殑闇�姹傚拰杞欢鐨勫叿浣撳姛鑳介�夋嫨鍏朵腑涔嬩竴銆�
寤虹珛绋嬪簭瀹夎鐩綍
鏁翠釜瀹夎杩囩▼浠oot鐢ㄦ埛鎵ц濡備笅鍛戒护锛�
#cd/soft/programe
#mkdir mysq
闇�瑕佹敞鎰忕洰褰曞悕绉扮殑澶у皬鍐欍��
#mkdir proftpd
#mkdir pam_mods
MySQL鐨勫畨瑁呯洰褰曚负/soft/program/mysql,ProFTPD鐨勫畨瑁呯洰褰曚负/soft/program/proftpd锛宲am_mysq1.so鐨勫畨瑁呯洰褰曚负/soft/program/pam_mods锛�/storage鏄竴涓凡缁忓瓨鍦ㄧ殑鐩綍锛屾墍鏈夌殑FTP鐢ㄦ埛涓婁紶鍜屼笅杞芥枃浠堕兘瀛樻斁鍦ㄨ繖閲屻��
瀹夎MySQL
鈼� 澧炲姞涓�涓鐞哅ySQL鐨勭敤鎴峰拰缁勶細
#groupadd mysqlgrp
#useradd-g mysqlgrp mysqladm
#passwd mysqladm
鈼� 鍒囨崲鍒癕ySQL-stan-dard-5.1.30-1.rhel5.src.rpm鏂囦欢鎵�鍦ㄧ殑鐩綍锛屾墽琛屼互涓嬫楠ゅ畨瑁咃細
#rpm-ivh MySQL-stan-dard-5.1.30-1.rhel5.src.rpm
姝ゆ潯鍛戒护瑙e帇鍑簃ysql-5.1.30.tar.gz鏂囦欢瀛樻斁鍦ㄤ互涓嬬殑鐩綍涓��
#cd/usr/src/redhat/SOURCE
#tar zxvf mysqt-5.1.30.tar.gz
#cd mysql-5.1.30#./configure Prefix=/soft/program/mysql --with-extra-charsets=all
鍏朵腑,鈥�--prefix=/soft/program/mysql鈥濆弬鏁版槸鐢ㄦ潵鎸囧畾Mysql鐨勫畨瑁呯洰褰曪紝鈥�--with-extra-charsets=all鈥濇槸鐢ㄦ潵鏀寔鎵�鏈夌殑瀛楃闆嗐��
#make
#make install
鈼� 鍒濆鍖栨暟鎹簱
#cd/soft/program/mysql/bin
#./mysql_install_db
鈼� 涓轰簡瀹夊叏瑕佷慨鏀规暟鎹簱瀛樻斁鐩綍鐨勫睘涓讳俊鎭拰璁块棶妯″紡/soft/program/mysqll/var涓烘暟鎹簱瀛樻斁鐨勭己鐪佺洰褰�
#cd/soft/program/mysql
#chown 鈥揜 mysqladm:mysqlgrpvar#chmod-R go-wrxvar鈼� 淇敼閰嶇疆鏂囦欢
#cd/soft/program/mysql/share/mysql
#cp my-small.cnf /etc/my.cnf
#cd/etc
鍦╩y.cnf鏂囦欢涓紝澧炲姞濡備笅鍐呭锛�
[mysql]
user=mysqladm #琛ㄧず鐢╩ysqladm 鐢ㄦ埛鍚姩MySQL#default-character-set=utf8 #琛ㄧず浣跨敤UTF-8瀛楃闆嗭紝姝ょ瀛楃闆嗛�氱敤鎬ц緝濂斤紝涔熷緢濂界殑鏀寔涓枃锛屽綋鐒朵篃鍙互鐩存帴浣跨敤GBK銆�
[clent]
Default-character-set=utf8
鈼� 鍚姩
鍚姩鏂瑰紡鏈変袱绉嶏紝涓�绉嶆槸鎵嬪伐鍚姩锛屼竴绉嶆槸鑷姩鍚姩锛屽叾涓墜宸ュ惎鍔ㄧ殑鎿嶄綔濡備笅锛�
#cd/soft/program/mysql/bin
#./mysqld_safe&鑷姩鍚姩鍒欓渶瑕佸湪/etc/rc.d/rc/local涓姞鍏ヤ互涓嬬殑鍐呭锛屽紑鏈鸿嚜鍔ㄥ惎鍔∕ySQL鏁版嵁搴擄細
If [-x /soft/program/mysql/bin/mysqld_safe]; then
install_path_name/bin/mysqld_safe&fi
鈼� 淇敼绠$悊鍛樺瘑鐮�
浣跨敤濡備笅鍛戒护淇敼鏁版嵁搴撳瘑鐮侊細
#cd/soft/program/mysql/bin
#./mysqladmin -h localhost -u root password'123456'涓婅堪鍛戒护鐨勬剰鎬濇槸鏈満涓婏紙-h host锛変娇鐢ㄧ殑绠$悊鏁版嵁搴撶殑缂虹渷绠$悊璐﹀彿root銆傞渶瑕佹敞鎰忕殑浜嬶紝姝oot骞堕潪Linux绯荤粺涓殑root鐢ㄦ埛锛屽瘑鐮佽缃负123456.
瀹夎ProFTPD
鈼嗗垏鎹㈠埌proftpd-1.3.2.tar.gz鏂囦欢鎵�鍦ㄧ殑鐩綍锛屾墽琛屼互涓嬫楠ゅ畨瑁咃細
#tar zxvf proftpd-1.3.2.tar.gz
#cd proftpd-1.3.2#./configure--prefix=/soft/program/proftpd --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql
姝ゅ弬鏁板皢鏀寔MySQL鍜孮uota妯″潡娣诲姞杩涙潵銆�--with-includes=/soft/program/mysql/include/mysql
涓婅堪鍙傛暟鎸囧畾MySQL涓璱nclude鐨勭洰褰曡矾寰勩��--with-libraries=/soft/program/mysql/lib/mysql
姝ゅ弬鏁版寚瀹歁ySQL涓璴ib鐨勭洰褰曡矾寰勩��
#make
#make install
浣跨敤濡備笅鍛戒护寤虹珛涓�涓敤浜庣鐞哖roFTPD鐨凩inux绯荤粺璐﹀彿鍜岀粍銆�
#groupadd-g2009ftpgroup
#useradd-u2009鈥搒 /bin/false-d /storage -g ftpgroup ftpuser
#chown-R ftpuser.ftpgroup /storage
#chmod 鈥揜 go-wrx- /storage
#chmod 鈥揜 u+wrx /storage
绠�鍗曚慨鏀筆roFTPD閰嶇疆鏂囦欢锛屼娇涔嬫甯歌繍琛岋細
#cd/soft/program/proftpd/etc
鐢ㄧ紪杈戝櫒鎵撳紑proftpd.conf,淇敼涓�涓嬬殑鍐呭锛�
#Set the user and group under which the server will run.
User ftpuser
Group ftpgroup
鈼嗗惎鍔≒roFTPD
鍚姩Proftpd鍚屾牱鏈変袱绉嶆柟娉曪紝鍗虫墜宸ュ惎鍔ㄥ拰鑷姩鍚姩锛屽叾涓墜宸ュ惎鍔ㄦ搷浣滃涓嬶細
#cd/soft/program/proftpd/sbin/#./proftpd
姝ゆ椂涓�涓熀鏈殑FTP鏈嶅姟鍣ㄥ凡缁忔惌寤烘垚锛屽彲浠ヨ繘琛屾祴璇曚簡銆傞渶瑕佹敞鎰忕殑鏄紝鍚姩鏃跺鏋滃嚭鐜板叿鏈変互涓嬩俊鎭殑閿欒锛�
errorwhileloading shared libraries:libmysqlclient.so.15:cannot open sharedobjectfile:No such file or directory
閫氬父鐨勮В鍐冲姙娉曞涓嬶細
#cd/etc
鐢ㄦ枃鏈伐鍏锋墦寮�ld.so.conf,娣诲姞浠ヤ笅鐨勫唴瀹�/soft/program/mysql/lib/mysql
#ldconflg
鏇存柊ld.so cache file銆�
瑕佽ProFTPD鑷姩鍚姩鍦�/etc/rc.d/rc.local涓姞鍏ヤ互涓嬬殑鍐呭锛屽紑鏈哄嵆鍙嚜鍚姩ProFTPD:/soft/program/proftpd/sbin/proftpd
浜屻�丮ySQL涓嶱roFTPD缁勫悎
鍦∕ySQL 涓缓绔嬩竴涓悕涓篺tp鐨勬暟鎹簱锛屽湪璇ユ暟鎹簱涓缓绔嬩互涓嬬殑鍥涗釜琛細
鈼嗙櫥褰旻TP鏈嶅姟鍣ㄧ殑鐢ㄦ埛琛╢tpusers锛屽瓧娈典俊鎭涓嬫墍绀猴紝杩欎簺瀛楁鏄繀闇�鐨勶紝鍏朵粬瀛楁鏍规嵁鑷繁鐨勯渶瑕佹坊鍔狅紝鍙傝�冨瓧娈靛涓嬶細'userid'text NOT NULL #鐢ㄦ埛鐧诲綍璐﹀彿#'passwd'text NOT NULL #鐢ㄦ埛鐧诲綍瀵嗙爜#'uid'int(11)NOT NULLdefault'2009', #涓嶭inux绯荤粺璐﹀彿ftpuser鐨刄ID鍙蜂竴鑷�#'gid'int(11)NOT NULLdefault'2009', #涓嶭inux绯荤粺缁�#
ftpgroup 鐨凣ID鍙蜂竴鑷�'homedir'text,鐢ㄦ埛鏂囦欢涓婁紶涓嬭浇鐩綍锛屽璐﹀彿鍚嶄负abc,姝ゅ灏卞~鍐�/storage/abc锛�'shell'textdefault,'/sbin/nologin'杩欎釜鏄敤鏉ユ寚瀹氱敤鎴锋槸鍚﹁兘鐧诲綍Linux绯荤粺锛岃繖閲岄粯璁ょ殑鏄笉鑳界櫥褰曘��
鈼咶TP鐢ㄦ埛褰掑睘琛╢tpgroups锛屽瓧娈典俊鎭涓嬫墍绀猴紝鍏充簬寤虹珛璇ョ粍鐨勭洰鐨勫皢鍦╭uotalimits琛ㄤ腑璇存槑'groupname'text NOT NULL #缁勫悕#'gid'smallint(6) NOT NULLdefault'0',#缁勭殑id鍙�#'memembers'text NOT NULL #鎴愬憳#
鈼嗙敤浜庤缃鐩橀檺棰濈浉鍏充俊鎭殑琛╭uotalimits鍜宷uotatallies,杩欎袱涓〃鐨勫瓧娈佃涓嶈鏀瑰姩锛屽畠鏄笌ProFTPD鐨勯厤缃枃浠剁揣瀵嗚仈绯伙紝quotalimits琛ㄧ殑瀛楁淇℃伅濡備笅锛�'name'varchar(30)defaultNULL,'quota_type'enum('user','group','class','all')NOT NULLdefault'user','per_session'enum('false','true')NOT NULLdefault'false','limit_type'enum('soft','hard')NOT NULLdefault'soft','bytes_in_avail'floatNOT NULLdefault'0','bytes_out_avail'floatNOT NULLdefault'0','bytes_xfer_avail'floatNOT NULLdefault'0','files_in_avail'int(10) unsigned NOT NULLdefault'0','files_out_avail'int(10)unsigned NOT NULLdefault'0','files_xfer_avail'int(10)unsigned NOT NULLdefault'0'闇�瑕佹敞鎰忕殑鏄紝name搴旇杩欐牱鐞嗚В锛屾棦鑳借〃绀哄崟涓敤鎴凤紝涔熻兘琛ㄧず鐢ㄦ埛缁勫悕銆傚鏋滃湪quota_type(闄愰绫诲瀷)涓娇鐢╣roup鏉ヨ璇佺殑璇濓紝閭e氨寰楀湪杩欓噷璁剧疆缁勫悕锛岃繖鏍锋暣缁勯兘鍏锋湁缁熶竴鐨勭鐩橀檺棰濈殑鐗规�э紝褰撶劧瑕佸湪ftpgroups琛ㄤ腑鎻掑叆缁勮褰曪紝骞朵笖鍦╩ember瀛楁涓緱鎶婄敤鎴蜂竴涓竴涓殑鍒楄繘鍘汇�傞粯璁ゅ�煎彲浠ヤ负绌篘ULL銆傚鏋滀负绌猴紝鍒欓拡瀵规墍鍦ㄦ湁quota_type涓缃殑绫诲瀷锛屾瘮濡傚湪quota_type涓缃负user锛屽氨鏄拡瀵规墍鏈塮tpusers涓殑鐢ㄦ埛璧蜂綔鐢紝濡傛灉鏄痝roup鍚嶏紝涔熸槸瀵筬tpgroups鎵�鏈夌粍浣滅敤銆俼uota_type纾佺洏闄愰绫诲瀷锛屽彲浠ヨ缃负鐢ㄦ埛锛屼篃鍙互璁剧疆涓虹敤鎴风粍group銆傚鏋渘ame鍐欑殑鏄敤鎴风粍锛岃繖閲屽氨寰楄缃负group鏉ヨ瀹氥�傞粯璁や负user璁よ瘉銆俻er_session榛樿涓篺alse.limit_type榛樿涓簊oft銆侭ytes_in_avail鐢ㄦ埛鍗犵敤绌洪棿澶у皬锛屼篃灏辨槸FTP鐢ㄦ埛绌洪棿瀹归噺锛屽崟浣嶆槸byte,榛樿涓�0锛�0鏄笉鍙楅檺鍒讹紝浠ヤ笅鍚岀悊銆俠ytes_out_avail鎵�鏈変笅杞芥枃浠剁殑鎬诲拰锛岄粯璁や负0銆�
bytes_xfer_avail涓�涓敤鎴蜂笂浼犱笅杞芥祦閲忔�诲拰锛岄粯璁や负0銆俧iles_in_avail闄愬埗涓婁紶鏂囦欢鎬诲拰锛岄粯璁や负0銆俧iles_out_avail闄愬埗涓嬭浇鏂囦欢涓暟鎬昏锛岄粯璁や负0銆俧iles_xfer_avail鍏佽涓嬭浇鍜屼笂浼犵殑鏂囦欢鎬诲拰锛岄粯璁や负0銆俀uotatallies琛ㄧ殑瀛楁淇℃伅锛屽悇瀛楁淇℃伅鍙傜収quotalimits銆傞厤缃弬鑰冨弬鏁板涓嬶細
name VARCHAR(30)NOT NULL,
quota_type ENUM("user","group","class","all")NOT NULL,
bytes_in_used FLOAT NOT NULL,
bytes_out_used FLOAT NOT NULL,
bytes_xfer_used FLOAT NOT NULL,
files_in_used INT UNSIGNED NOT NULL,
files_out_used INT UNSIGNED NOT NULL,
files_xfer_used INT UNSIGNED NOT NULL
姝ゅ锛屽湪proftpd.conf鏂囦欢涓鍔犱互涓嬬殑鍐呭锛�
鈼嗘暟鎹簱杩炴帴鐨勪俊鎭紝ftp鏄暟鎹簱鍚嶏紝localhost鏄富鏈哄悕锛宺oot鏄繛鎺ユ暟鎹簱鐨勭敤鎴峰悕锛�123456鏄瘑鐮併��
root123456鈼嗘暟鎹簱璁よ瘉鐨勭被鍨嬶紝Plaintext琛ㄧず鏄庢枃璁よ瘉鏂瑰紡
SQLAuthTYpes Backend Plaintext
鈼嗘寚瀹氱敤鏉ュ仛鐢ㄦ埛璁よ瘉鐨勮〃鐨勬湁鍏充俊鎭�
SALUserlnfo ftpusers userid passwd uid gid homedir shell
SQLGrouplnfo ftpgroups groupname gid members
鈼嗘牎楠屾暟鎹〃
SQLAuthenticate users groups usersetfast groupsetfast
鈼嗗鏋渉ome鐩綍涓嶅瓨鍦紝鍒欑郴缁熶細鏍规嵁ftpusers琛ㄤ腑鐨刪ome瀛楁銆�
鏂板缓涓�涓洰褰曪細
SQLHomedirOnDemand on
鈼嗘墦寮�纾佺洏闄愰寮曟搸
QuotaEngine on
鈼嗚缃鐩橀檺棰�
QuotaDirectoryTally on
鈼嗚缃鐩樺閲忔樉绀烘椂鐨勫崟浣�
QuotaDisplayUnits Mb
鈼嗚缃鐩橀檺棰濇棩蹇楁枃浠�
QuotaLog鈥�/usr/local/proftpd/var/quota鈥�
鈼嗘樉绀虹鐩橀檺棰濅俊鎭�
ftp鐧诲綍鍚庡彲鎵цquote site quota鍛戒护鏌ョ湅褰撳墠纾佺洏浣跨敤鎯呭喌锛�
QuotaShowQuotas on
鈼嗚缃鐩橀檺棰濇棩蹇楁枃浠�
QuotaLog鈥�/var/log/quota鈥�
鈼嗘寚瀹氱鐩橀檺棰濇ā鍧椾娇鐢ㄧ殑鏁版嵁搴撲俊鎭�
SQLNamedQuerget-quota-limit SELECT"name,quota_type,bytes_in_avail,bytes_out_avail,bytes_xfer_avail,files_in_avail,files_out_avail,files_xfer_avail FROM quotalimits WHERE name='%{0}'AND quota_type='%{1}'"SQLNamedQueryget-quota-tally SELECT"name,quota_type,bytes_in_used,bytes_out_used,bytes_xfer_used,files_in_used,files_out_used,filed_xfer_used,FROM quotatallies WHERE name='%{0}'AND quota_type ='%{1}"SQLNamedQuery update-quota-tally UPDATE"bytes_in_used =bytes_in_used+%{0},bytes_out_used=bytes_out_used+%{1},bytes_xfer_used=bytes_xfer_used+%{2},files_in_used=files_in_used+%{3},files_out_used=files_out_used+%{4},files_xfer_used =files_xfer_used+%{5} WHERE name='%{6}'AND quota_type = '%{7}'"quotatallies
SQLNamedQuery insert-quota-tally INSERT"%{0},%{1},%{2},%{3},%{4},%{5},%{6},%{7}"quotatallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
鍙﹀锛岃鑰呰繕鍙互鍦╬roftpd.conf涓坊鍔犱竴浜涙湁鍏宠秴鏃躲�侀檺鍒惰繛鎺ユ鏁般�佸姞蹇繛鎺ラ�熷害銆佹敮鎸佹柇鐐逛紶杈撳強瀹夊叏浼犺緭绛夊唴瀹广��
anon_other_write_enable=YES
ascll_upload_enable=YES
ascll_download_enable=YES
VsFTPD閰嶇疆鏂囦欢涓繕鍙互杩涜鏇村鐨勮缃紝濡傜鐩橀厤棰濄�佽櫄鎷熺敤鎴蜂釜浜虹洰褰曠殑寤虹珛銆佹�ц兘涓庤礋杞芥帶鍒躲�丗TP琚姩妯″紡鏂彛璁剧疆銆佸畨鍏ㄨ缃瓑锛岃鑰呮牴鎹嚜宸辩殑闇�瑕佽繘涓�姝ョ殑瀹屽杽銆�
鈼嗙紪杈戞枃浠�
淇敼/etc/pam.d/ftp涓幓鎺夊叾浠栫殑鍐呭锛屾坊鍔犱互涓嬬殑鍐呭锛�
#auth
auth required/soft/program/pam_mods/pam_mysql.so
user=ftpuser passwd=6789host=localhost db=ftp
table=ftpusers usercolumn=userid passwdcolumn=passwd crypt=0#account
Account required/soft/program/pam_mods/pam_mysql.so
User=ftpuser passwd=6789host=localhost db=ftp table=ftpusers usercolumn=userid passwdcolumn=passwd crypt=0娑夊強鍒扮殑鍙傛暟锛屽彧瑕佸搴斿墠闈㈡暟鎹簱鐨勮缃氨鍙互鏄庣櫧瀹冧滑鐨勫惈涔夈�傚叾涓細crypt=0,鍙d护浠ユ槑鏂囨柟寮�(涓嶅姞瀵�)淇濆瓨鍦ㄦ暟鎹簱涓紝crypt=1,鍙d护浣跨敤Unix绯荤粺鐨凞ES鍔犲瘑鏂瑰紡鍔犲瘑鍚庝繚瀛樺湪鏁版嵁搴撲腑锛沜rypt=2,鍙d护缁忚繃MySQL鐨刾assword()鍑芥暟鍔犲瘑鍚庝繚瀛樸�侳TP鏁版嵁搴撲腑ftpusers琛ㄧ殑鎺堟潈鐢ㄦ埛ftpusers鍜屽瘑鐮佸繀椤绘纭缃��
鈼嗗紑鏈鸿嚜鍚姩VsFTPD
璇峰皢vsftpd-2.2.1/xinetd.d/vsftpd鏂囦欢鍒跺埌/etc/xinetd.d/涓�(濡傛灉璇ョ洰褰曚腑娌℃湁璇ユ枃浠�)銆傛澶栵紝杩橀渶璁剧疆vsftpd.conf涓璴isten鍜孴cp_Wrappers鍙傛暟锛屽皢鍏堕兘璁剧疆涓篘O锛屾渶鍚庯紝鐢╪tsysv鍛戒护锛岄�変腑Vsftpd瀹堟姢杩涚▼鍗冲彲銆�
閫氳繃涓婇潰鐨勭煡璇嗭紝缁撳悎Apache銆丳HP绛夎蒋浠跺彲浠ュ紑鍙戣澶氬姛鑳斤紝濡傝嚜鍔ㄧ敵璇蜂富椤电┖闂寸瓑锛岃�屼笖浣跨敤phpMyAdmin鍙互浠eb鏂瑰紡绠$悊MySQL,寰堝鏄撶殑娣诲姞鍜屽垹闄ょ敤鎴凤紝杩欐牱FTP鐢ㄦ埛绠$悊灏辫交鏉惧浜嗐��