Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, May 18, 2011

To view current Exim queue details using Perl script

To get the detailed results of Exim mail queue using a simple perl script.



____________________________________________________________________________________

root@sysadmin [~]# ./exim_queue_report.pl



                   EXIM MAIL QUEUE REPORT                  

============================================================



-> Total mails in Queue: 3

-> No of frozen emails : 2



-> Emails per CPanel User:



 COUNT   USER

----------------------------------

    2   mailnull

    1   marcm





-> Mails to following email addresses got bounced:



 COUNT   EMAIL

----------------------------------

    1   helensss@123new.com

    1   jerry1@nopytruction.com





-> Subject of emails in the mail queue:



 COUNT   SUBJECT

----------------------------------

    5   Mail delivery failed: returning message to sender

   12   Seminar topics





-> From address of mails in the mail queue:



 COUNT   FROM

----------------------------------

    2   Mailer-Daemon@server1.tchmachines.com

    1   jblac@aol.com





============================================================



-> What do you want to do?



 [1] Remove all mails of a Cpanel user

 [2] Remove all mails with specific subject

 [3] Remove all mails originated from a script source

 [4] Remove all bounced emails

 [5] Remove all frozen emails

 [6] Remove all mails From: specific email address

 [7] Chmod a script source to 000

 [8] I'm done! Exit..



Your choice ( 1 to 8 ) >;

________________________________________________________________________________



You can download the above script Download Exim Queue Report

[technomance]



Tags:-Exim mail queue,cpanel, exim mail queue scripts







Monday, July 12, 2010

Steps for changing WHM to secure your Server


For more information and tutorial,visit this url ==>>http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/WebHome

Goto Main ==>> ServerConfiguration =>> Tweak Settings in WHM

To make secure,change the settings as
1. Number (or all) of accounts to display per page in list accounts = 30
2. Disable : Allow users to park subdomains of the server’s hostname main domain
3. Disable : Allow users to Park/Addon Domains on top of domains owned by other users.
4. Disable : Allow users to Park/Addon Domains on top of domains owned by other users.
5. Disable : Allow resellers to create accounts with subdomains of the server’s hostname main domain
6. Disable : Allow Creation of Parked/Addon Domains that are not registered
7. Disable : When adding a new domain, automatically create A entries for the registered nameservers if they would be contained in the zone
8. Enable : Prevent users from parking/adding on common internet domain
9. Enable : Silently Discard all FormMail-clone requests with a bcc: header in the subject line
10. Fail: Default catch-all/default address behavior for new accounts. "fail" is usually the best choice if you are getting mail attacks.
11. disable:Track the origin of messages sent though the mail server by adding the X-Source headers (exim 4.34+ required)
12. The maximum each domain(mail limits) can send out per hour (0 is unlimited)-200 or 300
13. Disable: Prevent the user "nobody" from sending out mail to remote addresses (PHP and CGI scripts generally run as nobody if you are not using PHPSuexec and Suexec respectively.)Disable should enabled on server with phpsuexec.
14. Disable: Include a list of Pop before SMTP senders in the X-PopBeforeSMTP header when relaying mail. (exim 4.34-30+ required)
15. BoxTrapper Spam Trap
16. Disable : Add the mail. prefix for mailman urls
17. Enable:Horde Webmail
18: Enable: Mailman
19. RoundCube Webmail
20. SpamAssassin Spam Filter
21. SpamAssassin Spam Box delivery for messages marked as spam (user configurable)
22. SquirrelMail Webmail
23. Disable:Send passwords in plaintext over email when creating a new account
24. Disable:Awstats Reverse Dns Resolution
25. Disable:Analog
26. Disable:Allow users to update Awstats from cPanel
27. Enable: Notify the admin, (or the reseller), when an account has reached the "critical" Disk Usage state
28. Threshold percentage where a user's disk usage is considered to be in the "critical" state. (0 will disable this notification)-90
29. Number of days between processing log files and bandwidth usage = 1
30. Enable : Delete each domain’s access logs after stats run
31. The load average above the number of cpus at which logs file processing should be suspended = 10
32. Enable : Keep Stats Log between cPanel restarts
33. Disable : Allow Perl updates from RPM based linux vendors
34. Enable : Use jailshell as the default shell for all new accounts and modified accounts
35. Disable : Allow cPanel users to reset their password via email
36. Enable : Spamassasssin
37.Enable PHP open_basedir Protection. Tweak Security
38. Enable mod_userdir Protection.
39. Enable SMTP Tweak
40. Disable Compilers for unprivileged users.

Tags:-whm,whm configure,whm settings,whm to secure serve,server secre using whm,whm configuration,whm settings

Steps to disable website pages download using wget ?






Wget is a network utility to retrieve files from the World Wide Web using HTTP and FTP.It works non-interactively, so it can work in the background, after having logged off. The program supports recursive retrieval of web-authoring pages as well as FTP sites—you can use Wget to make mirrors of archives and home pages or to travel the Web like a WWW robot, checking for broken links.

For disabling wget to grab your site pages then simply add the code below in the .htaccess file under public_html directory [for which you wish to disable the wget grabbing].

===================================
SetEnvIfNoCase User-Agent “^Wget” bad_bot

Order Allow,Deny
Allow from all
Deny from env=bad_bot

===================================

Now, if anybody tries to grab info from your website using wget, he will receive a 403 error.

Please check this link to know more information about wget

http://wget.addictivecode.org/FrequentlyAskedQuestions

Tags:-wget,cpanel,webadmin,serveradmin,apachae,linux,commands,wget,cpanel,whm

Tuesday, July 6, 2010

Steps to disable Telnet in a Server


Telnet is a network protocol used as "bidirectional interactive text-oriented communications" underlying TCP/IP protocol for accessing remote computers.Telnet is unencrypted and sends clear text passwords and usernames through logins and should be disabled on all web servers and replaced with SSH.Some hosting providers are not disabling telnet by default but you should ensure that it has been turned off as it's a great security risk to your servers. TELNET server listens for incoming messages on port 23, and sends outgoing messages to port 23.

1. Login to your server through SSH and su to root.

2. Type pico /etc/xinetd.d/telnet

3. Look for the line: disable = no and replace with disable = yes

4. Now restart the inetd service: /etc/rc.d/init.d/xinetd restart

5. Turn off it through chkconfig as well because it can still start through that.
/sbin/chkconfig telnet off

6. Scan your server to ensure port 23 is closed.
nmap -sT -O localhost

Also run ps -aux | grep telnet and if you find anything other than "grep telnet" as result kill the process.

Tags:-Linux,telnet,disable telnet,differnece between telnet and ssh,ssh,telnet command,defenition,define telnet,ports

Wordpress Issues[Not able to login to wordpress]


Please check the .htaccess file in the public_html folder,where the word press has installed and check the below lines are missing . If it missing please create a .htaccess file and enter

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-
RewriteRule . /index.php [L]

# END WordPress


Tags:-wordpress,wordpress issues,linux,cPanel,wordpress error,Linux cpanel admin,WHM,webhosting troubles,.htaccess

Wednesday, June 30, 2010

Mod_Security [Defenition and Installation Steps


Mod security is an open source web application firewall for intrusion detection and prevention engine for web applications and is most widely deployed in web applications.Mod Security v2.5.12 (change log) has been released. This release fixes several important issues to help prevent a detection bypass and denial of service attacks against Mod Security. Mode security provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis.

Requirements:
  • Apache Web Server 1.3x or 2.x
Note: We have confirmed this security addon works with Cpanel based servers.

How to install?
1. Login to your server through SSH and su to the root user.

2. First your going to start out by grabbing the latest version of mod_security
wget http://www.modsecurity.org/download/mod_security-1.7.4.tar.gz

3. Next we untar the archive and cd into the directory:
tar zxvf mod_security-1.7.4.tar.gz
cd mod_security-1.7.4/

4. Now you need to determine which version of apache you use:
APACHE 1.3.x users
cd apache1/
APACHE 2.x users
cd apache2/

5. Lets Compile the module now:
/usr/local/apache/bin/apxs -cia mod_security.c

6. Ok, now its time to edit the httpd conf file. First we will make a backup just incase something goes wrong:

cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.backup

7. Now that we have backed it all up, we can edit the httpd.conf. Replace pico with nano depending on what you have

pico /usr/local/apache/conf/httpd.conf
8. Lets look for something in the config, do this by holding control and pressing W and you are going to search for

(altho any of the IfModules would work fine)

9. Now add this


SecFilterEngine On

SecServerSignature "Apache"
SecFilterCheckUnicodeEncoding Off
SecAuditEngine RelevantOnly
SecAuditLog logs/audit_log
SecFilterScanPOST On

SecFilterDefaultAction "deny,log,status:403"

SecFilterSelective REQUEST_METHOD "^POST$" chain
SecFilterSelective HTTP_Content-Length "^$"

SecFilterSelective HTTP_Transfer-Encoding "!^$"

SecFilterSelective ARG_PHPSESSID "!^[0-9a-z]*$"
SecFilterSelective COOKIE_PHPSESSID "!^[0-9a-z]*$"
SecFilter "../"

SecFilter "viewtopic\.php\?" chain
SecFilter "chr\(([0-9]{1,3})\)" "deny,log"

SecFilterSelective THE_REQUEST "wget "
SecFilterSelective THE_REQUEST "lynx "
SecFilterSelective THE_REQUEST "scp "
SecFilterSelective THE_REQUEST "ftp "
SecFilterSelective THE_REQUEST "cvs "
SecFilterSelective THE_REQUEST "rcp "
SecFilterSelective THE_REQUEST "curl "
SecFilterSelective THE_REQUEST "telnet "
SecFilterSelective THE_REQUEST "ssh "
SecFilterSelective THE_REQUEST "echo "
SecFilterSelective THE_REQUEST "links -dump "
SecFilterSelective THE_REQUEST "links -dump-charset "
SecFilterSelective THE_REQUEST "links -dump-width "
SecFilterSelective THE_REQUEST "links http:// "
SecFilterSelective THE_REQUEST "links ftp:// "
SecFilterSelective THE_REQUEST "links -source "
SecFilterSelective THE_REQUEST "mkdir "
SecFilterSelective THE_REQUEST "cd /tmp "
SecFilterSelective THE_REQUEST "cd /var/tmp "
SecFilterSelective THE_REQUEST "cd /etc/httpd/proxy "
SecFilterSelective THE_REQUEST "/config.php?v=1&DIR "
SecFilterSelective THE_REQUEST "/../../ "
SecFilterSelective THE_REQUEST "&highlight=%2527%252E "
SecFilterSelective THE_REQUEST "changedir=%2Ftmp%2F.php "

# Very crude filters to prevent SQL injection attacks
SecFilter "delete[[:space:]]+from"
SecFilter "insert[[:space:]]+into"
SecFilter "select.+from"

# Weaker XSS protection but allows common HTML tags
SecFilter "<[[:space:]]*script" # Prevent XSS atacks (HTML/Javascript injection) SecFilter "<(.|n)+>"


10. Save the file Ctrl + X then Y

11. Restart Apache

/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/httpd start

Tags:-Mod_Security,mode_security,mode_security installation,mode_security configuration,define,linux,linux admin,linux webhosting


Tuesday, June 29, 2010

Exim Commands and Configuration Files


Configuration Files of Exim :

  • /etc/exim.conf – exim main configuration file
  • /etc/localdomains – list of domains allowed to relay mail
  • Log : /var/log/exim_mainlog – incoming/outgoing mails are logged here
  • /var/log/exim_rejectlog – exim rejected mails are reported here
  • /exim errors are logged here
  • Mail queue: /var/spool/exim/input
  • Cpanel script to restart exim – /scripts/restartsrv_exim
  • Email forwarders and catchall address file – /etc/valiases/domainname.com
  • Email filters file – /etc/vfilters/domainname.com
  • POP user authentication file – /home/username/etc/domainname/passwd
  • catchall inbox – /home/username/mail/inbox
  • POP user inbox – /home/username/mail/domainname/popusername/inbox
  • POP user spambox – /home/username/mail/domainname/popusername/spam
  • Program : /usr/sbin/exim (suid – -rwsr-xr-x 1 root root )
  • Init Script: /etc/rc.d/init.d/exim
Trouble shooting and checking exim mail logs

1) Count the no of messages in the queue

#root@leo [~]# exim -bpc
3506
Here 3506 mails are in the queue.

2) Command To List All The Messages In The Queue.(Time, Size,Message ID,Sender,Receipient):-

#root@localhost# exim -bp
Other Options:- root@localhost#exim -bpru
If you want to list for the message for a particular domain issue the
following command:-
root@localhost# exim -bpru | grep openhelp.info

3) Command To Find The Details Of Messages In The Queue( Count, Volume,Oldest,Newest And Total):-

#root@localhost# exim -bp | exiqsumm
===========================
The result of the comand will be like this:-
1 3686 18h 18h ziro.net
1 1638 4d 4d znormativa.com
1 2662 11m 11m zoominternet.net
1 3174 24m 24m zpub.com
1 2048 2h 2h zufall.de
===========================
3583 18MB 9d 0m TOTAL

4) Command To Create And Display Exim Stats From The Log File:-

#root@localhost# eximstats /var/log/exim_mainlog
===========================================
The result of the command will be like this:-
sree @ openhelp.info = lookuphostT=remote_smtp:SMTP error from remote mail
server after end of data:mail.tripseinc.com [65.106.35.202]: 550 5.7.1
rquested action not taken: message refusedhost smtp.where.xeonerver.net
[18.19.80.14]:553 sorry, mail to that recipient is not accepted
Errors encountered: 9617
===========================================

5) Generate And Display Exim Stats For A Particular Date:-

#root@localhost# fgrep YYYY-MM-DD /var/log/exim_mainlog | eximstats
==============================================
The result of the command will be like this:-
Top 50 host destinations by message count
-----------------------------------------
Messages Bytes Average Host destination
Top 50 host destinations by volume
-----------------------------------------
Messages Bytes Average Host destination
Top 50 rejected ips by message count
-----------------------------------------
Messages Rejected ip
2 [65.98.14.123]
1 [65.98.35.126]
Top 50 temporarily rejected ips by message count
------------------------------------------------
Messages Temporarily rejected ip
8 [69.65.55.100]
============================================

6) To Print What Exim Is Doing Right Now:-

#root@localhost# exiwhat
======================================================
Result of this command will be like this:-
925 handling incoming connection from ([61.152.161.184]) [61.152.161.184]
1951 handling incoming connection from pc-206-216-44-190.cm.vtr.net [
190.44.216.206]
10714 daemon: no queue runs, listening for SMTP on port 26 (IPv4)
10720 daemon: -q1h, listening for SMTP on port 25 (IPv4)
10725 daemon: no queue runs, listening for SMTPS on port 465 (IPv4)
=====================================================

7)For Clearing All The Mails In The Queue:-

root@localhost#exim -bpru|awk {'print $3'}|xargs exim -Mrm

8)Search The Queue For Messages From A Specific Sender:-

root@localhost# exiqgrep -f [luser]@domain

9)Search The Queue For Messages From A Specific Receipient/Domain:-

root@localhost# exiqgrep -r [luser]@domain
Eg:-root@localhost# exiqgrep -r openhelp.info

10)Command To Print The Message ID’s In The Entire Queue:-

#root@localhost# exiqgrep -i
===========================
The Result of the command will be like this:-
1KZyz0-0004wH-6d
1KZzBW-0001sT-1j
===========================

11)Comand To Start A Queue Run:-

root@localhost# exim -q -v

12)Comand To Start A Queue Run For Just Local Deleveries:-

root@localhost# exim -ql -v

13)Counting The No Of Frozen Mails:-

#root@localhost#exim -bpru | grep frozen | wc -l

14)Deleting All The Frozen Mails In The Queue:-

#root@localhost#exiqgrep -z -i | xargs exim -Mrm

15)Deliver a specific Message:-

#root@localhost# exim -M

You need to give message Id After this.
Like :- root@localhost# exim -M 1KZyrO-0006Vy-R2

16)Remove A Message From The Queue:-

#root@localhost# exim -Mrm

17)Command To Freeze All Queued Mail From A Given Sender:-

root@localhost#exiqgrep -i -f l user @ domain.com | xargs exim -Mf

18)Command To View Message Header:-

#root@localhost# exim -Mvh
Eg:-root@localhost#exim -Mvh 1KZzeO-0005up-GW

19)Command To View MessageBody:-

#root@localhost# exim -Mvb
This Command will show the body of the message.
Eg:-root@localhost#exim -Mvb 2345fg-34

20)Command To View A Message’s Logs:-

#root@server1 [~]# exim -Mvl 1KZznJ-0003Wp-Vj

21)Deleting The Bounce Back Message s In The Queue:-

#root@leo [~]exiqgrep -if "<>" | xargs exim -Mrm
OR
#root@leo [~] exim -bp | grep '<>' | awk '{print $3}'| xargs exim -Mrm

Bounce Back Messages Will Be ending with "<>".

Eg:- 17m 3.1K 1KDDkk-0002YT-5G <>barry @ email.net

22)Deleting The Bounce Back Message’s for a particular Domain:-

root@xeon [~] exiqgrep -if openhelp.info | xargs exim -Mrm
root@xeon [~] exiqgrep -ir openhelp.info | xargs exim -Mrm

Tags:-exim,exim commands,exim issues,exim docs,exim troubleshooting,exim configuration files,exim server,exim logs,linux,linux exim,linux updates

Setup time zone in Linux


1. The command used to check the time zone is

[root@server123 ~]# date
MON Jan 14 14:04:01 IST 2010
Here we can see that time zone is set into Indian Standard time.

2.Take the backup of current timezone configuration.

[root@server123 ~]#mv /etc/localtime /etc/localtime-old

2. Change to the directory to /usr/share/zoneinfo. You can find all the time zone regions here. Choose the the appropriate region where you resides. If you live in India choose region kerala in the /usr/share/zoneinfo/Asia directory.

3)remove the file /etc/localtime

[root@server123 Asia]# rm /etc/localtime


4. Create a symbolic link from the appropiate timezone to /etc/localtime

[root@server123 Asia]# ln -s /usr/share/zoneinfo/Asia/Kerala /etc/localtime


5. Update the current system time by executingthe rdate command.

[root@server123 Asia]#rdate -s rdate.cpanel.net

6. Synchronize hardware clock with system clock .

[root@server123 Asia]# /sbin/hwclock – -systohc

Tags:-Time zone,linuz time zone,Linux commands,Linux time commands,linux time zone commands,Linux,cPanel,Time

Steps to change the character set of a MySQL database to utf8?


Please follow the steps as it is to change the character set to Mysql

1) Dump the data of the mysql database to data_dump.sql

root@server1 [~]# mysqldump -t -u -p >data_dump.sql;

2) Dump the schema of the mysql database to schema_dump.sql

root@server1 [~]# mysqldump -d -u -p >schema_dump.sql

3)Now edit the file schema_dump.sql and remove the entries “DEFAULT CHARSET=”from the table and column definitions.

4) Drop the existing database.
root@server1 [~]#mysqladmin drop

5) Create a new database with uft8 as the default character set:

root@server1 [~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1074337 to server version: 4.1.22-standard


Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>CREATE DATABASE DEFAULT CHARACTER SET utf8;

Now quit the mysql.

6) Import schema_dump.sql into the new database:

root@server1 [~]# mysql -u -p

7. Import data_dump.sql into the new database:
root@server1 [~]# mysql -u -p


Tags: LAMP, Linux, mysql, techzinformaticha-support, phpmyadmin

Sunday, June 27, 2010

TO VIEW THE DETAILED HARDWARE CONFIGURATION OF LINUX MACHINE

lshw - (Hardware Lister) is a small tool to provide detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC machines

While running this command it says something like -bash: lshw: command not found ".. means the command is not installed.

[root@computer ~]# lshw
-bash: lshw: command not found

So we need to install that command before running command:

[root@computer ~]# yum -y install lshw*

[If yum is run with the -y option, yum will assume a ``yes'' answer to all interactive questions. This is typically used in a script or to process ``known safe'' installs or updates.]

MS Outlook Mailclient Configuration

To configure MS Outlook

Step 1: Open your outlook and click on Tools Menu
Step 2: Select Email Accounts
Step 3: Select the option Add a new e-mail account. Click 'Next'

Step 4: Select the type of account you would like to create (IMAP or POP3). you are adding a Hotmail or similar account, you will want to use an HTTP connection. Click “Next.”

Step 5: Enter e-mail settings. Fill in:
  • Your Name – use your full name and use title case (e.g. Jane Doe) as this is how your name will appear when others receive your email
  • Email Address
  • User Name (the first half of your email address – the part before the @ unless otherwise specified by your hosting company)
  • Password (established when you set up the mail box with your hosting company)
  • Incoming mail server (ex: mail.domain.com or server name) – this is the mail server address for your hosting company where you will be checking your mail
  • Outgoing mail server (ex:mail.domain.com or server name)

Step 6: Click on the More Settings... button. Choose the Outgoing Server tab and check the My outgoing server (SMTP) requires authentication checkbox.

Check the option Use same settings as my incoming server.

Step 7: the Advanced tab and set Pop3 - incoming port : 110
{change to} SMTP - outgoing port : 26 or 465


Congratulations screen will appear. You have successfully entered the required account information. Click “Finish” to exit the email wizard. To add more email address to Outlook, repeat these steps.

Tags:Mail client,mail client configuration with pictorial representation,outlook configuration,MS outlook mail client,mailclient

Apachae and Mail logs and configurations files in Linux

Apache Logs
-----------

To view the logs of Apachae:/usr/local/apache

+ bin- apache binaries are stored here – httpd, apachectl, apxs
+ conf – configuration files – httpd.conf
+ cgi-bin
+ domlogs – domain log files are stored here
+ htdocs
+ include – header files
+ libexec – shared object (.so) files are stored here – libphp4.so,mod_rewrite.so
+ logs – apache logs – access_log, error_log, suexec_log
+ man – apache manual pages
+ proxy -
+ icons -

Init Script :/etc/rc.d/init.d/httpd – apache start script
Cpanel script to restart apache – /scripts/restartsrv_httpd

Mail Logs and Mail configuration files:
----------------------------------------------------
  • /etc/exim.conf – exim main configuration file
  • /etc/localdomains – list of domains allowed to relay mail
  • Log : /var/log/exim_mainlog – incoming/outgoing mails are logged here
  • /var/log/exim_rejectlog – exim rejected mails are reported here
  • /exim errors are logged here
  • Mail queue: /var/spool/exim/input
  • Cpanel script to restart exim – /scripts/restartsrv_exim
  • Email forwarders and catchall address file – /etc/valiases/domainname.com
  • Email filters file – /etc/vfilters/domainname.com
  • POP user authentication file – /home/username/etc/domainname/passwd
  • catchall inbox – /home/username/mail/inbox
  • POP user inbox – /home/username/mail/domainname/popusername/inbox
  • POP user spambox – /home/username/mail/domainname/popusername/spam
  • Program : /usr/sbin/exim (suid – -rwsr-xr-x 1 root root )
  • Init Script: /etc/rc.d/init.d/exim
Tags:-Linux,Linux admin interview questions,Linux apachae logs,Linux mail logs


Sunday, September 6, 2009

How to make a red hat boot usb from windows?

* A 64MB or larger USB flash drive
* HP-USB Format tool (optional)
* 7-Zip (or another extracting utility)
* Syslinux
* Dsl-embedded.zip

Installation

1. Download the HP-USB Format tool and format your flash drive using the Fat or Fat32 option
2. Download the dsl-embedded.zip and extract the contents using 7-Zip to your USB flash drive
3. Download syslinux-3.36.zip and unzip the files to a directory called syslinux on your computer
4. From Windows click start-> run-> cmd
5. From the command window, type
cd \syslinux\win32

6. Type
syslinux.exe -ma X: (replace X with your USB drive letter) to make the drive bootable
7. Reboot your computer and set your system BIOS or Boot Menu to boot from the USB device. In some cases, you might also need to set the hard disk boot priority to boot from the USB stick if your BIOS lists the device as a hard drive.

Tags:-Booting,Linux booting,USB Bootable device,USB bootable for Linux,How to install linux to a USBflash pendrive


Thursday, August 27, 2009

Quota Check in Linux

The idea behind the Quota check is that the users are forced to stay under the disk consumption limit taking away their ability to consume unlimited disk space on a system.

Step 1) vi /etc/fstab

Partitions that you have not yet enabled quota normally look something like:

/dev/hda1 / ext2 defaults 1 1
/dev/hda2 /home ext2 defaults 1 1

To enable user quota support on a file system, add "usrquota" to the fourth field containing the word

/dev/hda1 / ext2 defaults 1 1
/dev/hda2 /home ext2 defaults,usrquota 1 1
Replace "usrquota" with "grpquota", should you need group quota support on a file system.

Step 2) Remount the File System to Enable Quota Support
# mount -o remount /home

Step 3)Initialize the new Quota Data Base
# quotacheck -c /home
Then a file named aquota.usr is created in the home directory

Step 4)
Start the assigned quota by
#quotaon /home
To off the Quota--- #quotaoff /home

Step 5)
The user policies can be implemented by editing the Quota File
#edquota -u username
/dev/hda3: blocks in use: 2594, limits (soft = 5000, hard = 6500)
inodes in use: 356, limits (soft = 1000, hard = 1500)

Block in use-Used Space
Soft-Get Warning(The size reaches a particular point it shows warning)
Hard-Maximum Limit(Quota Exceeding Size)
inode-No of Files

For Checking the status of user Quota
# repquota −a

For Checking the Quota

Step 1)Switch to that user
# su - username

Step2)Create files in this home directory
#dd if=/dev/zero of=filename bs=1024 count=50
{Here 50 Kb is allocated to that directory...By giving more size you can check this}

Tags:-Quota ,Quota check in Linux,Quota users,how to do quota in Linux,How to Check Quota in Linux,Quota Commands,Quota commands in Linux,Quota informations in Linux,Methods to do Quota,Methods to do Quota in Linux,Steps to do Quota Check in Linux



Monday, August 24, 2009

How to Create UBUNTU Bootable USB/Pendrive from Windows

Minimum Requirements:
  • Above 1GB USB.Flash Drive
  • Ubuntu ISO
  • CD Burner/Recorder
  • 7-zip (or another ISO extracting tool)

Steps:


Partition and make the USB flash drive bootable:

  1. Download the Ubuntu 6.10 ISO and burn it to CD
  2. Restart your computer (booting from the Ubuntu Live CD)
  3. Insert a 1GB or larger USB flash drive
  4. Open a terminal window and type sudo su
  5. Now type fdisk -l to list available drives/partitions (note which device is your flash drive Example: /dev/sdb). Throughout this tutorial, replace all instances of x with your flash drive letter. For example, if your flash drive is sdb, replace x with b.
  6. Type umount /dev/sdx1
  7. Type fdisk /dev/sdx
    • type p to show the existing partition and d to delete it
    • type p again to show any remaining partitions (if partitions exist, repeat the previous step)
    • type n to make a new partition
    • type p for primary partition
      • type 1 to make this the first partition
      • hit enter to use the default 1st cylinder
      • type +750M to set the partition size
      • type a to make this partition active
      • type 1 to select partition 1
      • type t to change the partition filesystem
      • type 6 to select the fat16 file system
    • type n to make another new partition
    • type p for primary partition
      • type 2 to make this the second partition
      • hit enter to use the default cylinder
      • hit enter again to use the default last cylinder
      • type w to write the new partition table
  8. Type umount /dev/sdx1 to unmount the partition
  9. Type mkfs.vfat -F 16 -n usb /dev/sdx1 to format the first partition

    "Alternately you can try mkfs.vfat -F 32 -n usb /dev/sdx1 (doesn't always work)"

  10. Type umount /dev/sdx2 to ensure the partition is unmounted
  11. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
  12. Remove and Re-insert your flash drive
  13. Back at the terminal, type sudo apt-get install syslinux mtools
  14. Type syslinux -sf /dev/sdx1
  15. Restart your computer, remove the CD and boot back into Windows

Using Windows to prepare and move the files to the USB Stick:

  1. Create a folder named USB on your computer
  2. Download UBconvert.zip and extract the files to the USB folder
  3. Move the Ubuntu 6.10 ISO downloaded earlier to the USB folder
  4. Click fixu.bat from the USB folder (follow on screen instructions)
  5. Move all files from the ubuntu directory to your memory stick
  6. Reboot your computer and set your system BIOS to boot from USB-HDD or USB-ZIP. Also set the "Hard Disk Boot Priority" if necessary.

You should now be booting into Ubuntu Linux from your USB drive!

Tags:-USB Bootable,install ubuntu through USB,How to make Ubutntu bootable from a USB,Ubuntu bootable from USBor Flash Drives