PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : چگونگی نصب cfs



Vahid
August 9th, 2008, 13:27
CSF Install Guide and How To

CSF - Config Server Firewall is a stateful packet inspection firewall, login/intrusion detection and security application for Linux servers. What does that mean in English? Simple - it's a program that can greatly improve your dedicated server or VPS's security.

It's a firewall - so it can block/restrict ports you don't want open, and prevents someone from using any port they want if they did break in.
It has intrusion detection - so it will scan the log files and monitor failed login attempts, such as FTP password guessing and block the IP.
Those are the 2 big things I like about CSF - and it has a nice interface for the non techie person, on cPanel servers.

ConfigServer Security & Firewall (http://www.configserver.com/cp/csf.html)

If you have another firewall installed, like APF, CSF can help you automatically remove the existing firewall and install theirs instead. Keep in mind it won't migrate over your configuration.

Installation
============
Installation is quite straightforward:

Login as the root user to SSH and run the following commands.
rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
If you would like to disable APF+BFD (which you will need to do if you have
them installed otherwise they will conflict horribly): sh disable_apf_bfd.sh
That's it. You can then configure csf and lfd in WHM, or edit the files
directly in /etc/csf/*
Installation Completed
Don't forget to:
1. Configure the TCP_IN, TCP_OUT, UDP_IN and UDP_OUT options in the csf configuration to suite your server
2. Restart csf and lfd
3. Set TESTING to 0 once you're happy with the firewall

csf is preconfigured to work on a cPanel server with all the standard cPanel
ports open. It also auto-configures your SSH port if it's non-standard on
installation.
You should ensure that kernel logging daemon (klogd) is enabled. Typically, VPS
servers have this disabled and you should check /etc/init.d/syslog and make
sure that any klogd lines are not commented out. If you change the file,
remember to restart syslog.
Now - login to your cPanel server's WHM as root and go to the bottom left menu. If already logged in then reload the page. In Plugins - you will see: ConfigServer Security&Firewall
The firewall is STOPPED by default - it is not running. We need to configured it, and then take it out of Test Mode.

Click on Firewall Configuration

ETH_DEVICE =: Set this to eth+

TCP_IN/TCP_OUT/UDP_IN/UDP_OUT = : These are the ports you want to leave open for your server to operate. If you change the default SSH port make sure to add it here. Also add any other services you might have running such as Shoutcast or game servers. By default most of the ports used should already be configured.


MONOLITHIC_KERNEL = : 0 Only change this to 1 if your firewall will not start - otherwise leave it as it.


LF_DSHIELD = 0: Change this option to 86400. This is an automatic updated list of known attacking IPs. Enabling this will stop them from being able to connect to your server.

Spam Protection Alerts
If you want to add some spam protection, CSF can help. Look in the configuraiton for the following:

LF_SCRIPT_ALERT = 0 change this to 1. This will send an email alert to the system administrator when the limit configured below is reached within an hour.

LF_SCRIPT_LIMIT = 100 change this to 250. This will alert you when any scripts sends out 250 email messages in an hour.


Configuration Complete - Almost
Scroll down to the bottom and click on Change to save the settings. Then click Restart csf+lfd

You should see a big page of ACCEPT and near the bottom you should see:

csf: TESTING mode is enabled - don't forget to disable it in the configuration
Starting lfd:[ OK ]

Click on Return

Now TEST all your services to make sure everything is working - SSH, FTP, http. After you do a few quick tests go back into the Firewall Configuration page.
TESTING = 1 change this to 0 and click Change at the bottom. Then Restart csf+lfd


That's it, the firewall is successfully installed and running!!
Firewall Status: Running - you should see this on the main CSF page in WHM.


Uninstallation
==============
Removing csf and lfd is even more simple:
cd /etc/csf
sh uninstall.sh

Nikihost
August 12th, 2008, 00:34
با سلام خدمت مدير محترم.
يه سوال برام پيش اومده. من پورت ssh را عوض كردم . و فايروال من csf v3.38 است . چطوري بهش بفهمونم كه پورت جديد را اجازه دسترسي بدهد.

DedicatedBOX
August 12th, 2008, 00:53
سلام فقط مدیر جواب بده یا منم می تونم بدم؟
باید توی config اش وارد شی من العان دقیق یادم نیست ادرسش چیه و pico بزنی و ادیتش کنی وقتی وارد ادیت شدی می تونی پرت جدید رو بدی بهش

Nikihost
August 12th, 2008, 01:03
سلام فقط مدیر جواب بده یا منم می تونم بدم؟
باید توی config اش وارد شی من العان دقیق یادم نیست ادرسش چیه و pico بزنی و ادیتش کنی وقتی وارد ادیت شدی می تونی پرت جدید رو بدی بهش
فرقي نميكنه دوست عزيز . مهم نيت است كه پورت جديد را به فايروال بشناسونيم:iagree:
اگر يادتون اومدم ممنون بگذاريد ما هم استفاده كنيم

KamranOnline
August 12th, 2008, 01:05
آره تو config یه قسمت داره به اسم :
TCP_IN =
TCP_OUT =
UDP_IN =
UDP_OUT =

می تونی اونجا پورت هارو باز کنی

Nikihost
August 12th, 2008, 19:27
آره تو config یه قسمت داره به اسم :
TCP_IN =
TCP_OUT =
UDP_IN =
UDP_OUT =

می تونی اونجا پورت هارو باز کنی
سلام مجدد
كامران عزيز
من پورت قبلي ssh را كه 22 بوده فقط در فليد هاي TCP_IN و TCP_OUT ميبينم و در فليد UDP_OUT و UDP_IN نيست . يه سوال برام پيش اومد . پورت جديد را به هر 4 تا فلي اضافه كنم ؟؟
بازم ممنون ميشم راهنمايم كنيد

Nikihost
August 13th, 2008, 19:52
هيچ كدوم از دوستان جواب سوال منو نميدن ؟؟؟:angelsad2:

KamranOnline
August 13th, 2008, 23:18
نه احتیاجی نیست!

Vahid
August 15th, 2008, 00:27
هيچ كدوم از دوستان جواب سوال منو نميدن ؟؟؟
سلام به خدا شرمنده من این چند روز دستم خیلی بند بود اصلا وقت نداشتم بیام تو فروم
سعی میکنم سوال های شما بیشتر از 2 ساعت بی جواب نمونه
در مورد سوالی هم که پرسیدی باید بگم نیازی بهش نیست کامران اونارو همینطوری کپی کرده :d

Soheil Extreme
February 1st, 2009, 20:38
باسلام.دوستان من کامل اموزشتون رو خوندم فقط یه مشکلی دارم که هر کاری میکنم با اینکه همه دستورات شما رو انجام دادم kfd من استپ شده هست هرکاری میکنم استارت نمیشه رستارتشو هم میزنم این ارور رو میدهRestarting lfd...

Stopping lfd:[FAILED]
[ OK ]
Starting lfd:csf reported an error. lfd stopped
[ OK ]

توروخدا کمکم کنید چه کار کنم

persian.developer
February 1st, 2009, 21:19
باسلام.دوستان من کامل اموزشتون رو خوندم فقط یه مشکلی دارم که هر کاری میکنم با اینکه همه دستورات شما رو انجام دادم kfd من استپ شده هست هرکاری میکنم استارت نمیشه رستارتشو هم میزنم این ارور رو میدهrestarting lfd...

Stopping lfd:[failed]
[ ok ]
starting lfd:csf reported an error. Lfd stopped
[ ok ]

توروخدا کمکم کنید چه کار کنم

سلام دوست عزیز شما از سرور اختصاصی استفاده می کنید یا سرور مجازی؟

Soheil Extreme
February 2nd, 2009, 00:22
مجازی.مشکل بنده حل شد ممنونم

persian.developer
February 2nd, 2009, 00:56
مجازی.مشکل بنده حل شد ممنونم
خوهش می کنم، اگه امکان داره توضیح بدین که چطور مشکلتون حل شده که بقیه دوستان هم اگر به چنین مشکلی برخوردن استفاده کنن
ممنون

Soheil Extreme
February 2nd, 2009, 12:41
استدعا میکنم.فایروال بنده در حالت تست بود که باید عدد0رو میزاشتم در قسمت مربوطه تا از دوره تست خارج بشه و سپس CSF&lfd رو رستارت کردم و ران شد

Vahid
February 3rd, 2009, 17:37
سرور رو ریبوت کن
و وقتی اومد بالا ببین چطور
یا اول stop کن و بعد start کن
service lfd stop
service lfd start
موفق باشید

Vahid
February 3rd, 2009, 17:37
این هم csf هست :D
چرا من نوشتم cfs

Soheil Extreme
February 9th, 2009, 20:32
دوستان من میخوام روی وی پی ا س جدیدم نصب کنم اما
ارور
You Need To Install The LWP Perl Module (libwww-perl) and then install csf
میده باید چکار کنم یکی کمک کنه چون امنیت سرورم پایینه الان

Soheil Extreme
February 9th, 2009, 20:43
این رو هم زدم انجام شد ولی باز ارور بالا رو دارم
yum install perl-libwww-perl

Vahid
February 9th, 2009, 20:46
کنترل پنل؟

Soheil Extreme
February 9th, 2009, 20:49
سی پنل هست

Vahid
February 9th, 2009, 20:57
اینستال میشه؟
اروری که میده چیه؟

Soheil Extreme
February 9th, 2009, 21:05
ببینید دوست گرامی بنده ابتدا rm -fv csf.tgz زدم.و بعد فایل رو ویگت کردم.بعد tar -xzf csf.tgz زدم که استخراج بشه.بعدcd csf زدم که بره توی مقصد تا اینجا همه چیز حله.اما برای نصب وقتی sh install.sh میزنم ارور زیر رو میده
You Need To Install The LWP Perl Module (libwww-perl) and then install csf

من برای رفع این مشکل
yum install perl-libwww-perl
رو اجرا کردم فقط در حن کار در خط پایانی من مکوکم چون میگه
No Pakage perl-libwww-perl available
وبعد هم فینیش میده مشکله من اینه چکار کنم؟

Vahid
February 9th, 2009, 21:10
rpm -e perl-libwww-perl
اول پاک کن و بعد دوباره نصب کن

Vahid
February 9th, 2009, 21:12
On installing csf firewall, got following error.

[root@server22 csf]# sh install.sh

Configuring for OS

Checking for perl modulesfailed
You need to install the LWP perl module (libwww-perl) and then install csf
[root@server22 csf]#

To fix the error, install libwww-perl

yum install perl-libwww-perl

Soheil Extreme
February 9th, 2009, 21:33
rpm -e perl-libwww-perl
اول پاک کن و بعد دوباره نصب کن

این دستور رو زدم ارور زیر رو میده:
Must Begin With a /

Soheil Extreme
February 9th, 2009, 21:38
اگه من اطلاعات ssh کلاینت رو بدم لطف میکنید برام انجام بدید البته خودم کانفیگش میکنم فقط میخوام نصب بشه همین برام کافیه.
یا با ای دی من پی ام بدید من اطلاعا ssh رو بهتون بدم soheil.newyork

Soheil Extreme
February 9th, 2009, 22:04
کسی نیست کمکم کنه؟

Vahid
February 10th, 2009, 16:44
کمک که شد :d

Nikan
February 10th, 2009, 17:37
آقا من هم فکر می کنم بایستی درست شده باشد.

با تشکر

Soheil Extreme
February 10th, 2009, 18:11
نه خیر.تنها اینستال شده.ونمیتونم فعالش کنم چون وقتی فعالش میکنم وی اچ ام وهمه پورت ها بسته میشه من پورت ها رو اضافه کردم اما باز خود به خود همه چیز بسته میشه ومجبور میشم از کنسول استپش کنم

Vahid
February 10th, 2009, 18:19
نه خیر.تنها اینستال شده.ونمیتونم فعالش کنم چون وقتی فعالش میکنم وی اچ ام وهمه پورت ها بسته میشه من پورت ها رو اضافه کردم اما باز خود به خود همه چیز بسته میشه ومجبور میشم از کنسول استپش کنم
خوب من که گفتم مشکل ماله کرنل هست که اشتراکی هست و iptables آونجا درست کار نمیکنه میزنه همه رو خراب میکنه (خیلی ساده)

Soheil Extreme
February 10th, 2009, 18:32
خوب برای رفع این مشکل باید چکار کرد؟

Vahid
February 10th, 2009, 19:14
با مدیر سرور تماس بگیرید
شاید شما رو ببره رو یه سرور دیگه که سیستم مجازی سازی دیگه استفاده میکنه

Soheil Extreme
February 11th, 2009, 14:36
دوست عزیز من فایروال رو پاک کردم دوباره نصب کردم اینبار whm رو روم نمیبنده وهمه چیز باز وok هست فقط سایتها باز نمیشن باید چکار کنم؟

Vahid
February 11th, 2009, 14:51
چک کن port 80 باز باشه
دیدی درست نشد iptables رو استوپ کن ببین درست میشه

Soheil Extreme
February 11th, 2009, 15:02
دوست گرامی همین ارور رو میدهiptables این رو از کجا میتونم استپ کنم

Vahid
February 11th, 2009, 15:51
service iptables stop

Nikan
February 11th, 2009, 16:37
سلام

من هم پیشنهاد می کنم با مدیر سرور تماس بگیرید قطعا ایشان بهتر می توانند راهنمایی کنند

با تشکر

Soheil Extreme
February 11th, 2009, 16:54
سلام

من هم پیشنهاد می کنم با مدیر سرور تماس بگیرید قطعا ایشان بهتر می توانند راهنمایی کنند

با تشکر

دوست گرامی شما یکبار به بنده گفتید.اصلا من دوست دارم توی نت اطلاعاتم رو زیاد کنم.مشکلی هست؟

sodahost
December 17th, 2010, 01:30
سلام دوستان کسی می تونه آموزش دقیق CFS رو برای سرور مجازی شده با OpenVZ رو توضیح بده برای کنترل پنل cPanel
و اینکه من چند مشکل رو بر طرف کردم ولی وقتی CFS رو run می کنم FTP سرور از کار می افته و داخل incomign , outing ها هم پورت 21 رو معرفی کردم

Testing iptables...

Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...FAILED [Error: iptables: Unknown error 4294967295] - Required for PORTFLOOD and PORTKNOCKING features
Testing ipt_owner/xt_owner...FAILED [Error: iptables: Unknown error 4294967295] - Required for SMTP_BLOCK and UID/GID blocking features
Testing iptable_nat/ipt_REDIRECT...FAILED [Error: iptables: Unknown error 4294967295] - Required for MESSENGER feature

RESULT: csf will function on this server but some features will not work due to some missing iptables modules [3]

sosole
December 18th, 2010, 01:51
سلام بنده این فایرول رو امشب فعال کردم .
اما متاسفانه الان همه سایت های که رو این سرور هستند صفحات خیلی دیر لود میکنند ؟؟؟
مشکل از کجاست (فوری هست لطفا کمک برسونید)؟[COLOR="Silver"]