CentOS 甯哥敤鍛戒护澶у叏(杞�)

涓嬮潰锛屽氨缁欏ぇ瀹朵粙缁嶈繖浜汣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鐢ㄦ埛绠$悊灏辫交鏉惧浜嗐��

你可能感兴趣的:(CentOS 甯哥敤鍛戒护澶у叏(杞�))