<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5374034941645378319</id><updated>2011-11-28T05:14:23.607+05:30</updated><title type='text'>Linux Tutorials</title><subtitle type='html'>The place where you learn Linux. Short tutorials for people who want to learn the basics and advanced Linux trouble shooting. Blog also explains about various  Linux issues faced in day to day life.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-8815291754591617969</id><published>2008-04-02T20:05:00.004+05:30</published><updated>2009-04-15T01:46:02.333+05:30</updated><title type='text'>Why is Sendmail not accepting connections from any host except localhost (127.0.0.1)</title><content type='html'>By default, Sendmail is configured to only accept connections from localhost (127.0.0.1). To allow connections from ALL hosts, please do the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: This will setup Sendmail to allow connections from ALL IP's and all interfaces on the machine.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Install the package with the following option # up2date sendmail-cf&lt;br /&gt;Edit /etc/mail/sendmail.mc and change the following line:  &lt;br /&gt;DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl&lt;br /&gt;To look like the following (removing the localhost restrictions):  &lt;br /&gt;DAEMON_OPTIONS(`Port=smtp,Name=MTA')dnl&lt;br /&gt;Save the file. &lt;br /&gt;Execute the following command to rebuild the Sendmail files: make -C /etc/mail&lt;br /&gt;Restart Sendmail with: service sendmail restart ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-8815291754591617969?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/8815291754591617969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=8815291754591617969' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8815291754591617969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8815291754591617969'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/why-is-sendmail-not-accepting.html' title='Why is Sendmail not accepting connections from any host except localhost (127.0.0.1)'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3490575355156898909</id><published>2008-04-02T20:02:00.000+05:30</published><updated>2008-04-02T20:04:18.490+05:30</updated><title type='text'>How do you setup cyrus for POP3 to work with Sendmail with Red Hat Enterprise Linux 4?</title><content type='html'>All of the command provided are required to run locally. We recommend that you back-up any files that you will edit, before editing them. For example, us the cp (copy) command to save an instance of the file before you edit: &lt;br /&gt;&lt;br /&gt;cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.bak&lt;br /&gt;To begin, first run: &lt;br /&gt;&lt;br /&gt;service saslauthd status&lt;br /&gt;service cyrus-imapd status&lt;br /&gt;service sendmail status&lt;br /&gt;To setup cyrus, leave /etc/imapd.conf as default from the RPM package. For /etc/cyrus.conf leave as default except for the following: # UNIX sockets start with a slash and are put into /var/lib/imap/sockets&lt;br /&gt;SERVICES {&lt;br /&gt;# add or remove based on preferences &lt;br /&gt;imap          cmd="imapd" listen="imap" prefork=5&lt;br /&gt;#  imaps                cmd="imapd -s" listen="imaps" prefork=1 &lt;br /&gt;pop3          cmd="pop3d" listen="pop3" prefork=3 &lt;br /&gt;#  pop3s                cmd="pop3d -s" listen="pop3s" prefork=1 &lt;br /&gt;#  sieve                cmd="timsieved" listen="sieve" prefork=0 &lt;br /&gt;&lt;br /&gt;# these are only necessary if receiving/exporting usenet via NNTP &lt;br /&gt;#  nntp         cmd="nntpd" listen="nntp" prefork=3 &lt;br /&gt;#  nntps                cmd="nntpd -s" listen="nntps" prefork=1 &lt;br /&gt;&lt;br /&gt;# at least one LMTP is required for delivery &lt;br /&gt;#  lmtp         cmd="lmtpd" listen="lmtp" prefork=0 &lt;br /&gt;  lmtpunix      cmd="lmtpd" listen="/var/lib/imap/socket/lmtp" prefork=1 &lt;br /&gt;&lt;br /&gt;# this is only necessary if using notifications &lt;br /&gt;#  notify       cmd="notifyd" listen="/var/lib/imap/socket/notify" proto="udp" prefork=1 &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Note: You will need imap even if you are not planning on running an imap server. &lt;br /&gt;&lt;br /&gt;Next, set the password for cyrus: &lt;br /&gt;&lt;br /&gt;passwd cyrus &lt;br /&gt;Set the saslauthd password: saslpasswd -c cyrus  &lt;br /&gt;su to the cyrus user and execute: /usr/lib/cyrus-imapd/mkimap  &lt;br /&gt;Add a user with both passwords: useradd testuser &lt;br /&gt;saslpasswd -c testuser &lt;br /&gt;Now restart or start the services and turn them on to start at boot time: service saslauthd restart  &lt;br /&gt;service cyrus-imapd restart  &lt;br /&gt;service sendmail restart  &lt;br /&gt;service xinetd restart &lt;br /&gt;chkconfig saslauthd on &lt;br /&gt;chkconfig cyrus-imapd on &lt;br /&gt;chkconfig sendmail on &lt;br /&gt;You might need to reboot to allow cyrus to take ownership of the port. &lt;br /&gt;&lt;br /&gt;Login in as cyrus to cyrus-imap: &lt;br /&gt;&lt;br /&gt;cyradm --user cyrus localhost &lt;br /&gt;You can type help for more information. The prompt should also change: localhost.localdomain&gt; help &lt;br /&gt;Now make the users mailbox. Note the "user." must come before the username: localhost.localdomain&gt; cm user.testuser &lt;br /&gt;You can now exit: localhost.localdomain&gt; quit &lt;br /&gt;You can now test the user: telnet localhost 110 &lt;br /&gt;the login:&lt;br /&gt;user testuser &lt;br /&gt;pass test &lt;br /&gt;You should see:&lt;br /&gt;+OK Name is a valid mailbox&lt;br /&gt;+OK Mailbox locked and ready&lt;br /&gt;You now have cyrus working correctly. The mail box should show up:  &lt;br /&gt;/var/spool/imap/t/user/ &lt;br /&gt;You will now need to set Sendmail up to receive mail and send it to cyrus. Edit the configuration file /etc/mail/sendmail.mc and add this line to the bottom: dnl MAILER(smtp)dnl&lt;br /&gt;dnl MAILER(procmail)dnl&lt;br /&gt;define(`confLOCAL_MAILER', `cyrus')&lt;br /&gt;MAILER(`cyrus')&lt;br /&gt;If you want Sendmail to be able to receive mail from other places then itself, change this line from: DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnlto dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnlNext, execute: # m4 /etc/mail/sendmail.mc &gt; /etc/mail/sendmail.cf &lt;br /&gt;You will then need to restart Sendmail: service sendmail restart &lt;br /&gt;You can test, by doing: # mail testuser@localhost &lt;br /&gt;Subject: test &lt;br /&gt;test&lt;br /&gt;.&lt;br /&gt;#make sure you put the ?.? at the end of the email.&lt;br /&gt;The mail should show up in: /var/spool/imap/t/user/testuser/ and you should be able to check it with any local POP3 client&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3490575355156898909?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3490575355156898909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3490575355156898909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3490575355156898909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3490575355156898909'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-you-setup-cyrus-for-pop3-to-work.html' title='How do you setup cyrus for POP3 to work with Sendmail with Red Hat Enterprise Linux 4?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-7333602836121201498</id><published>2008-04-02T19:57:00.000+05:30</published><updated>2008-04-02T20:01:31.086+05:30</updated><title type='text'>How do I configure Samba to use domain accounts for authentication?</title><content type='html'>The following is a bare bones smb.conf file that will authenticate users off of a domain controller. Keep in mind that if you wish to apply user/group permissions locally you should create identical user accounts on the linux system. These accounts do not need to have access, and it is advisable to set their shells to /bin/false. &lt;br /&gt;&lt;br /&gt;Replace MACHINE with the name you wish your server to be associated with via netbios. Normally this would be identical to your hostname. Replace WORKGROUP with the name of the domain you wish to be a member of. &lt;br /&gt;&lt;br /&gt;If the "password server = *" is used, Samba will search for a domain controller to authenticate against. Alternatively you can specify the tcp/ip address(es) of your domain controller(s). &lt;br /&gt;&lt;br /&gt;[global]&lt;br /&gt;        workgroup = EXAMPLE&lt;br /&gt;        netbios name = MACHINE&lt;br /&gt;        password server = *&lt;br /&gt;        encrypt passwords = Yes&lt;br /&gt;        preferred master = No&lt;br /&gt;        domain master = No&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-7333602836121201498?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/7333602836121201498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=7333602836121201498' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7333602836121201498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7333602836121201498'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-configure-samba-to-use-domain.html' title='How do I configure Samba to use domain accounts for authentication?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-1311992716138623711</id><published>2008-04-02T19:51:00.000+05:30</published><updated>2008-04-02T19:52:46.993+05:30</updated><title type='text'>How do I join a Windows 2000/2003 Active Directory domain from Red Hat Enterprise Linux?</title><content type='html'>After configuring your /etc/samba/smb.conf and your /etc/krb5.conf files appropriately, enter the following command: &lt;br /&gt;net ads join -U Administrator&lt;br /&gt;You will then be prompted to enter the domain administrator's password. The domain name used is whatever workgroup = field is set to in smb.conf. To verify that the join is successful, look for the server in the directory controller's server management tool&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-1311992716138623711?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/1311992716138623711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=1311992716138623711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1311992716138623711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1311992716138623711'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-join-windows-20002003-active.html' title='How do I join a Windows 2000/2003 Active Directory domain from Red Hat Enterprise Linux?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3032169772326892155</id><published>2008-04-02T19:50:00.000+05:30</published><updated>2008-04-02T19:51:43.629+05:30</updated><title type='text'>How do I configure the Winbind service to authenticate itself so it is compatible with Windows domain controllers that restrict anonymous access to us</title><content type='html'>The Winbind service communicates with Domain Controllers (DC's) using anonymous (non-authenticated) connections by default, to properly emulate the behavior of legacy Windows clients such as NT and Win9x when requesting user and group data from DC's.&lt;br /&gt;&lt;br /&gt;This behavior can cause problems for Winbind if the domain uses DC's which are set up to restrict anonymous access. For example, if the Windows admin selected the "Permissions compatible with Windows 2000 servers only" option when adding the DC role to a Windows 2000 or Windows 2003 server. Although Winbind may be configured as recommended by Red Hat, the service may still fail to work properly because the DC's are refusing to service anonymous requests.&lt;br /&gt;&lt;br /&gt;If this option was chosen during DC setup or other security policy changes have been made to the DC afterwards - perhaps even by the installation of a Windows service pack - the DC will refuse to provide the user and group information requested by Winbind if the service has not been configured to authenticate itself with a valid domain user account. As noted above, Winbind will use anonymous connections until configured to do otherwise.&lt;br /&gt;&lt;br /&gt;The --set-auth-user option of the wbinfo command can be used to set a domain user account and password for the Winbind service to use. The user account specified needs to exist on the domain, but any regular user account should suffice -- it should not be necessary to specify a Domain Admin account unless security policies and/or user rights have been extensively modified on the DC's.&lt;br /&gt;&lt;br /&gt;Many system administrators will create a user on the domain named winbind for the Winbind service to use, so that Winbind's activities can be monitored or audited on the DC. The example command shown below assumes such a user exists on the domain.&lt;br /&gt;&lt;br /&gt;When running wbinfo --set-auth-user, it is not necessary to provide the password for the specified domain user on the command line. wbinfo will prompt for the specified user's password and using the command in this manner prevents the user's password from being stored in the root user's command history:&lt;br /&gt;&lt;br /&gt;# wbinfo --set-auth-user winbind&lt;br /&gt; Password:&lt;br /&gt;The username and password provided will be stored for future use. Care should be taken to type the user's password correctly when prompted, because no error message will be displayed if the password is entered incorrectly.&lt;br /&gt;&lt;br /&gt;The command can be run again whenever necessary to change the username and/or password the Winbind service should use.&lt;br /&gt;&lt;br /&gt;wbinfo --get-auth-user can be run to view the username and password currently set for the Winbind service:&lt;br /&gt;&lt;br /&gt; # wbinfo --get-auth-user&lt;br /&gt; TESTDOMAIN+winbind%thispassword&lt;br /&gt;In the example output shown above, TESTDOMAIN is the example domain's "short" domain name and the string following the percent symbol - thispassword in this example - is the password set for the winbind user.&lt;br /&gt;&lt;br /&gt;For more information regarding Winbind and Samba configuration, we would recommend the following sources of information:&lt;br /&gt;&lt;br /&gt;The wbinfo man page, viewable by running the command man wbinfo. &lt;br /&gt;The smb.conf man page, viewable by running the command man smb.conf. &lt;br /&gt;The Samba documentation contained in /usr/share/doc/samba-&lt;version&gt;, on any Red Hat system with the base samba RPM installed. Complete illustrated reference manuals are provided in both PDF and HTML formats in this directory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3032169772326892155?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3032169772326892155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3032169772326892155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3032169772326892155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3032169772326892155'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-configure-winbind-service-to.html' title='How do I configure the Winbind service to authenticate itself so it is compatible with Windows domain controllers that restrict anonymous access to us'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-8817706931588788785</id><published>2008-04-02T19:48:00.002+05:30</published><updated>2008-04-02T19:49:49.924+05:30</updated><title type='text'>I made some changes to my /etc/inittab file. How can I make those changes effective without rebooting?</title><content type='html'>To make changes to the /etc/inittab effective without a reboot, issue either of these two commands as the root user: &lt;br /&gt;# init q&lt;br /&gt;&lt;br /&gt;# telinit q&lt;br /&gt;The init q or telinit q command wakes up init and tells it to re-examine the /etc/inittab file so changes to the file are effective immediately.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-8817706931588788785?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/8817706931588788785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=8817706931588788785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8817706931588788785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8817706931588788785'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/i-made-some-changes-to-my-etcinittab.html' title='I made some changes to my /etc/inittab file. How can I make those changes effective without rebooting?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-441214038422854398</id><published>2008-04-02T19:48:00.001+05:30</published><updated>2008-04-02T19:48:34.633+05:30</updated><title type='text'>How do I change the runlevel for a system without rebooting?</title><content type='html'>To change the runlevel for a system without rebooting or changing the /etc/inittab file, execute the following command as the root user: &lt;br /&gt;&lt;br /&gt;telinit  &lt;runlevel_value&gt;With &lt;runlevel_value&gt; having the following values: &lt;br /&gt;&lt;br /&gt;0 ? Halt &lt;br /&gt;&lt;br /&gt;1 ? Single-user mode &lt;br /&gt;&lt;br /&gt;2 ? Not used (user-definable) &lt;br /&gt;&lt;br /&gt;3 ? Full multi-user mode &lt;br /&gt;&lt;br /&gt;4 ? Not used (user-definable)&lt;br /&gt;&lt;br /&gt;5 ? Full multi-user mode (with an X-based login screen) &lt;br /&gt;&lt;br /&gt;6 ? Reboot&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-441214038422854398?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/441214038422854398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=441214038422854398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/441214038422854398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/441214038422854398'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-change-runlevel-for-system.html' title='How do I change the runlevel for a system without rebooting?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-1630880163929842172</id><published>2008-04-02T19:47:00.001+05:30</published><updated>2008-04-02T19:47:35.530+05:30</updated><title type='text'>How do I change the system to boot into the graphical login (runlevel 5) instead of text mode (runlevel 3)?</title><content type='html'>In order to change what run level the system boots to, modify the /etc/inittab file. This is a sample from the inittab file: &lt;br /&gt;&lt;br /&gt;# Default runlevel. The runlevels used by RHS are:&lt;br /&gt;#   0 - halt (Do NOT set initdefault to this)&lt;br /&gt;#   1 - Single user mode&lt;br /&gt;#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)&lt;br /&gt;#   3 - Full multiuser mode&lt;br /&gt;#   4 - unused&lt;br /&gt;#   5 - X11&lt;br /&gt;#   6 - reboot (Do NOT set initdefault to this)&lt;br /&gt;#&lt;br /&gt;id:3:initdefault:&lt;br /&gt;The runlevel is determined by this line: &lt;br /&gt;&lt;br /&gt; id:3:initdefault:&lt;br /&gt;Change the above line to: &lt;br /&gt;&lt;br /&gt;id:5:initdefault:and your system will now boot to runlevel 5 or to a graphical login&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-1630880163929842172?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/1630880163929842172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=1630880163929842172' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1630880163929842172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1630880163929842172'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-change-system-to-boot-into_02.html' title='How do I change the system to boot into the graphical login (runlevel 5) instead of text mode (runlevel 3)?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-4266386255107988691</id><published>2008-04-02T19:42:00.000+05:30</published><updated>2008-04-02T19:46:52.957+05:30</updated><title type='text'>How do I change the system to boot into text mode (runlevel 3) instead of the graphical login (runlevel 5)?</title><content type='html'>In order to change what runlevel the system boots to, modify the /etc/inittab file. This is a sample from the inittab file: &lt;br /&gt;&lt;br /&gt;# Default runlevel. The runlevels used by RHS are:&lt;br /&gt;#   0 - halt (Do NOT set initdefault to this)&lt;br /&gt;#   1 - Single user mode&lt;br /&gt;#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)&lt;br /&gt;#   3 - Full multiuser mode&lt;br /&gt;#   4 - unused&lt;br /&gt;#   5 - X11&lt;br /&gt;#   6 - reboot (Do NOT set initdefault to this)&lt;br /&gt;#&lt;br /&gt;id:5:initdefault:&lt;br /&gt;runlevel is determined by this line: &lt;br /&gt;&lt;br /&gt; id:5:initdefault:&lt;br /&gt;Change the above line to: &lt;br /&gt;&lt;br /&gt;id:3:initdefault:and your system will now boot to runlevel 3 or text mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-4266386255107988691?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/4266386255107988691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=4266386255107988691' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/4266386255107988691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/4266386255107988691'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-change-system-to-boot-into.html' title='How do I change the system to boot into text mode (runlevel 3) instead of the graphical login (runlevel 5)?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-7487514120882960918</id><published>2008-04-02T19:38:00.000+05:30</published><updated>2008-04-02T19:41:48.735+05:30</updated><title type='text'>How do I disable X from loading on start up, but start and exit the X Window System when I need to?</title><content type='html'>In order to disable X from loading during the boot sequence, it is recommended that you boot your system to runlevel 3. Booting your system to runlevel 3 will still allow you to log in as a system user but will provide a command line login instead of a graphical login. Once you are successfully logged in, you can then use the startx command to bring your system into graphical mode or runlevel 5: &lt;br /&gt;&lt;br /&gt; startx&lt;br /&gt;In order to shut down GNOME or KDE, go to your Main Menu and select the "Log Out" menu option. This should shut down Xwindows and return you to a command line or runlevel 3. In order to configure your system to boot into runlevel 3, you can modify the /etc/inittab file and change the id initdefault line to runlevel 3 as shown below: &lt;br /&gt;&lt;br /&gt;# Default runlevel. The runlevels used by RHS are:&lt;br /&gt;#   0 - halt (Do NOT set initdefault to this)&lt;br /&gt;#   1 - Single user mode&lt;br /&gt;#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)&lt;br /&gt;#   3 - Full multiuser mode&lt;br /&gt;#   4 - unused&lt;br /&gt;#   5 - X11&lt;br /&gt;#   6 - reboot (Do NOT set initdefault to this)&lt;br /&gt;#&lt;br /&gt;id:3:initdefault:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-7487514120882960918?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/7487514120882960918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=7487514120882960918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7487514120882960918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7487514120882960918'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-disable-x-from-loading-on.html' title='How do I disable X from loading on start up, but start and exit the X Window System when I need to?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3844395557313994964</id><published>2008-04-02T18:55:00.000+05:30</published><updated>2008-04-02T19:37:14.971+05:30</updated><title type='text'>Why does lsmod not show the mt or SCSI card modules as being loaded?</title><content type='html'>If lsmod does not show the mt or SCSI card modules as being loaded, you can load the SCSI modules by doing the following: &lt;br /&gt;Determine modules SCSI card is using &lt;br /&gt;Run: &lt;br /&gt;# modprobe module_name&lt;br /&gt;# modprobe st &lt;br /&gt;&lt;br /&gt;The tape drive should now appear as a sequential access device and you should be able to access the tape drive now. &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;# cat /proc/scsi/scsi&lt;br /&gt;Attached devices: &lt;br /&gt;Host: scsi0 Channel: 00 Id: 00 Lun: 00 &lt;br /&gt;  Vendor: SONY     Model: SDX-400V         Rev: 0101 &lt;br /&gt;  Type:   Sequential-Access                ANSI SCSI revision: 02 &lt;br /&gt;------------------------------------------------------------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3844395557313994964?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3844395557313994964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3844395557313994964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3844395557313994964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3844395557313994964'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/why-does-lsmod-not-show-mt-or-scsi-card.html' title='Why does lsmod not show the mt or SCSI card modules as being loaded?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-530907793567647145</id><published>2008-04-01T19:59:00.000+05:30</published><updated>2008-04-01T20:11:32.232+05:30</updated><title type='text'>How do I enforce user passwords to expire after a set amount of time?</title><content type='html'>To force users to change their passwords the maxdays variable has to be set for that user. An example of how to do this can be found below: &lt;br /&gt;&lt;br /&gt;chage -M 30 &lt;user&gt;The above will expire the associated users password every 30 days. This can also be done when first assigning a password to a user when creating their account with the command below: passwd -x 30 &lt;user&gt;&lt;br /&gt;It would also be wise to warn your users that their account password is about to expire. This can be done by changing the warndays variable shown below. &lt;br /&gt;&lt;br /&gt;chage -W 4 &lt;user&gt;This will warn the user 4 days before their password expires that they will need to change their password. &lt;br /&gt;&lt;br /&gt;To retrieve expiry information about an existing account, use the command below: &lt;br /&gt;&lt;br /&gt;chage -l &lt;user&gt;The above command will result in the output below: Minimum:        0&lt;br /&gt;Maximum:        30&lt;br /&gt;Warning:        4&lt;br /&gt;Inactive:       -1&lt;br /&gt;Last Change:            Mar 03, 2005&lt;br /&gt;Password Expires:       Apr 02, 2005&lt;br /&gt;Password Inactive:      Never&lt;br /&gt;Account Expires:        Never&lt;br /&gt;&lt;br /&gt;Further information on all of the options for the chage and passwd commands can be foudn in the man pages. To view the manual page, issue the commands below at a terminal: &lt;br /&gt;&lt;br /&gt;man chage &lt;br /&gt;man passwd&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-530907793567647145?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/530907793567647145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=530907793567647145' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/530907793567647145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/530907793567647145'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-enforce-user-passwords-to.html' title='How do I enforce user passwords to expire after a set amount of time?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-5113062343781376903</id><published>2008-04-01T19:57:00.000+05:30</published><updated>2008-04-01T19:58:54.086+05:30</updated><title type='text'>How can password expiration be turned off?</title><content type='html'>The password expiration information for a user is contained in the last 6 fields of the file /etc/shadow (the last field is reserved for future use). Password expiration for a particular user can be disabled by editing the shadow file and removing values from the corresponding colon delimited entries in the file&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-5113062343781376903?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/5113062343781376903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=5113062343781376903' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5113062343781376903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5113062343781376903'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-can-password-expiration-be-turned.html' title='How can password expiration be turned off?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-7486719234645052984</id><published>2008-04-01T18:47:00.000+05:30</published><updated>2008-04-01T19:55:46.216+05:30</updated><title type='text'>How do I set an expiration date for a users password or lockout out a user using User Manager?</title><content type='html'>To use the User Manager, you must be running the XWindow System, have root privileges, and have the redhat-config-users RPM package installed. To start the User Manager from the desktop, go to the Main Menu Button (on the Panel) =&gt; System Settings =&gt; Users &amp; Groups. Or, type the command redhat-config-users at a shell prompt (for example, in an XTerm or a GNOME terminal).&lt;br /&gt;&lt;br /&gt;Click the Account Info tab. Select Enable account expiration if you want the account to expire on a certain date. Enter the date in the provided fields. Select User account is locked to lock the user account so that the user cannot log in to the system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-7486719234645052984?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/7486719234645052984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=7486719234645052984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7486719234645052984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7486719234645052984'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-set-expiration-date-for-users.html' title='How do I set an expiration date for a users password or lockout out a user using User Manager?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-5435933217709538604</id><published>2008-04-01T18:46:00.000+05:30</published><updated>2008-04-01T18:47:16.433+05:30</updated><title type='text'>How do I make users set a password the first time they log in using command line tools?</title><content type='html'>If a system administrator wants a user to set a password the first time the user log in, the user's initial or null password can be set to expire immediately, forcing the user to change it immediately after logging in for the first time.&lt;br /&gt;&lt;br /&gt;To force a user to configure a password the first time the user logs in at the console, follow these steps. Note, this process does not work if the user logs in using the SSH protocol.&lt;br /&gt;&lt;br /&gt;Lock the user's password - If the user does not exist, use the useradd command to create the user account, but do not give it a password so that it remains locked. If the password is already enabled, lock it with the command:usermod -L usernameForce immediate password expiration - Type the following command: chage -d 0 usernameThis command sets the value for the date the password was last changed to the epoch (January 1, 1970). This value forces immediate password expiration no matter what password aging policy, if any, is in place.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-5435933217709538604?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/5435933217709538604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=5435933217709538604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5435933217709538604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5435933217709538604'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-make-users-set-password-first.html' title='How do I make users set a password the first time they log in using command line tools?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-5120606634802630403</id><published>2008-04-01T17:58:00.000+05:30</published><updated>2008-04-01T17:59:16.854+05:30</updated><title type='text'>How do I lock out a user after a set number of login attempts in Red Hat Enterprise Linux 2.1?</title><content type='html'>The PAM (Pluggable Authentication Module) module pam_tally keeps track of unsuccessful login attempts then disables user accounts when a preset limit is reached. This is often referred to as account lockout. &lt;br /&gt;To lock out a user after 4 attempts, two entries need to be added in the /etc/pam.d/system-auth file: &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;auth        required        /lib/security/pam_tally.so onerr=fail no_magic_root&lt;br /&gt;account     required        /lib/security/pam_tally.so deny=3 no_magic_root reset&lt;br /&gt;&lt;br /&gt;In addition, run the command touch /var/log/faillog to create this empty file. This is where the attempts will be logged.&lt;br /&gt;&lt;br /&gt;The options used above are described below: &lt;br /&gt;&lt;br /&gt;onerr=fail &lt;br /&gt;If something strange happens, such as unable to open the file, this determines how the module should react. &lt;br /&gt;&lt;br /&gt;no_magic_root&lt;br /&gt;This is used to indicate that if the module is invoked by a user with uid=0, then the counter is incremented. The sys-admin should use this for daemon-launched services, like telnet/rsh/login. &lt;br /&gt;&lt;br /&gt;deny=3&lt;br /&gt;The deny=3 option is used to deny access if tally for this user exceeds 3. &lt;br /&gt;&lt;br /&gt;reset&lt;br /&gt;The reset option instructs the module to reset count to 0 on successful entry. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;See below for a complete example of implementing this type of policy: &lt;br /&gt;&lt;br /&gt;auth        required      /lib/security/pam_env.so&lt;br /&gt;auth        required      /lib/security/pam_tally.so onerr=fail no_magic_root&lt;br /&gt;auth        sufficient    /lib/security/pam_unix.so likeauth nullok&lt;br /&gt;auth        required      /lib/security/pam_deny.so&lt;br /&gt;&lt;br /&gt;account     required      /lib/security/pam_unix.so&lt;br /&gt;account     required      /lib/security/pam_tally.so deny=5 no_magic_root reset&lt;br /&gt;&lt;br /&gt;password    requisite     /lib/security/$ISA/pam_cracklib.so retry=3&lt;br /&gt;password    sufficient    /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow&lt;br /&gt;password    required      /lib/security/$ISA/pam_deny.so&lt;br /&gt;&lt;br /&gt;session     required      /lib/security/$ISA/pam_limits.so&lt;br /&gt;session     required      /lib/security/$ISA/pam_unix.so&lt;br /&gt;&lt;br /&gt;For more detailed information on the PAM system please see the documentation contained under /usr/share/doc/pam-&lt;version&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-5120606634802630403?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/5120606634802630403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=5120606634802630403' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5120606634802630403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5120606634802630403'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-lock-out-user-after-set-number.html' title='How do I lock out a user after a set number of login attempts in Red Hat Enterprise Linux 2.1?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-6896510589481919777</id><published>2008-04-01T17:48:00.000+05:30</published><updated>2008-04-01T17:49:40.861+05:30</updated><title type='text'>How do I prevent the reuse of old passwords?</title><content type='html'>Resolution:The PAM module pam_unix.so can be configured to maintain a list of old passwords for every user prohibiting the reuse of old passwords. The list is located in the /etc/security/opasswd file. This is not a plain text file, but should be protected the same as the /etc/shadow file. This is normally referred to as password history. &lt;br /&gt;&lt;br /&gt;To remember the last 15 passwords, add the line below to the /etc/pam.d/system-auth file: &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;password   sufficient   /lib/security/pam_unix.so use_authtok md5 shadow remember=15&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can replace the number 15 used above with an integer you want, to enforce your password security policy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-6896510589481919777?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/6896510589481919777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=6896510589481919777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6896510589481919777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6896510589481919777'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-prevent-reuse-of-old-passwords.html' title='How do I prevent the reuse of old passwords?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-9154675552503494978</id><published>2008-04-01T17:24:00.001+05:30</published><updated>2008-04-01T17:25:59.395+05:30</updated><title type='text'>How do I disable null passwords?</title><content type='html'>Resolution:A null password allows users to log onto a system without having to first supply a valid password string. When users have null passwords, they can press the [Enter] key when prompted for a password and gain access to systems without a password. This poses a significant security risk to the system and to the accountability of actions performed by users. &lt;br /&gt;&lt;br /&gt;To disable null passwords make a backup of the /etc/pam.d/system-auth file, then modify the original by removing nullok from one of the lines. &lt;br /&gt;Backup /etc/pam.d/system-auth &lt;br /&gt;cp /etc/pam.d/system-auth /etc/pam.d/system-auth.backup&lt;br /&gt;Remove nullok from the following line in /etc/pam.d/system-auth &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;auth sufficient /lib/security/pam_unix.so likeauth nullok&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;after removal the line should look like: &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;auth sufficient /lib/security/pam_unix.so likeauth&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-9154675552503494978?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/9154675552503494978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=9154675552503494978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/9154675552503494978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/9154675552503494978'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/04/how-do-i-disable-null-passwords.html' title='How do I disable null passwords?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-2087382894616673701</id><published>2008-03-31T18:14:00.001+05:30</published><updated>2008-03-31T18:15:52.948+05:30</updated><title type='text'>Managing Unix security part 2</title><content type='html'>Administrators (and, if they log onto the servers, users) have to care about security of the system. Why? Maybe you are concerned about attackers breaking in, or maybe auditors or insurers require you maintain a certain level of security. Make sure that everyone understands what the drivers are. This seems obvious but is surprisingly rare. Security staff tend to see security as intrinsically a good thing that needs no justification, so they forget to give one. But administrators tend to see security as intrinsically an annoyance which make it more difficult for them to do their jobs, so they very much need one. Of course, telling all your staff where the security weak points are in detail may be counterproductive, but an overview that includes real-life examples of security breaches can get people interested in the topic.&lt;br /&gt;&lt;br /&gt;Having understood why security is important to your organisation, the administration staff need to know what the rules are. There are a couple of things you can be pretty certain of: Your administrators will think that some of the security rules are pointless, and they will think that some of the rules are completely unworkable. They will probably be entirely correct in some of their concerns. A rule that seems entirely workable when devised often turns out to have a major flaw in real life. For example, a rule might ban NFS, but if the company has just invested heavily in an application that requires it, security planners are going to have to give some ground.&lt;br /&gt;&lt;br /&gt;Listen to your administrators. If they say that a security rule isn't workable, don't ignore them. Find out their reasons. Ideally, everyone should end up in agreement (if grudging) that either the rule needs amending or there is a workable way to implement it. Not involving the administrators is just asking for the rules to be bypassed, and whilst it might seem easy to blame the staff for this, the security people are at least as much at fault. In some cases, making a rule workable might require having a vendor make software changes. If the vendor is one of the big boys and you're not a major customer, this may be unrealistic (but you can try). If the vendor is a smaller company or the software is open source, you should have a lot more luck getting changes put in, or least getting a good explanation of why it can't be done that way with suggestions of alternatives.&lt;br /&gt;&lt;br /&gt;Because of the lack of security updates, security rules that prevent unauthorised command line access are especially important, as they protect the server perimeter (not to be confused with the network perimeter). On the technical side, this means rules that prevent passwords going across accessible networks in the clear, and rules which prevent a server being tricked into a trusted relationship with another host. They cover protocols such as telnet, rsh, ftp, DNS, NIS, and NFS. They cover password rules: technical rules preventing weak passwords and enforcing password aging, for example. Most Unix/Linux flavours have other advanced account controls you can use as well, such as the ability to check passwords against a dictionary, prevent a password being reused within a time limit, and expire passwords after a period of time (normally one month).&lt;br /&gt;&lt;br /&gt;Enforcing strong passwords is critical. Running a password cracker such as Crack or John the Ripper can be a real eye-opener: If you haven't trained your users in choosing good passwords, it's very likely that you'll crack at least a few accounts within a minute.&lt;br /&gt;&lt;br /&gt;Ross Anderson at Cambridge University has done some research on different methods for choosing passwords. He looked at randomly chosen simple passwords to see how secure and how easy to remember (Post-it Note resistant) they were. He found one method that was easy to remember and difficult to crack. In this initial letter method, the password is made up of the initial letters of a phrase that is meaningful to the user, with some numbers and punctuation substituted for letters. For example, if the phrase was "Hit me baby one more time -- Britney Spears," the password might be *Mb1mtBs.&lt;br /&gt;&lt;br /&gt;Encourage administrators to use the initial letter method of choosing passwords, and run regular cracking sessions to spot users who don't. A quiet notification that someone's password has been cracked, along with a reminder of how to choose a strong password and the reasons for doing so, should be enough to get the user to change his ways.&lt;br /&gt;&lt;br /&gt;With all this security in place across a large server environment, the risk goes up that either the security or the functionality of the system will get broken by someone either making a mistake or changing something on purpose. For example, file permissions may be changed, or a configuration file might be incorrectly amended. There has to be some ongoing check for compliance, and an audit every two years won't be enough. There doesn't have to be anything too complex or expensive. A simple shell script that runs daily or weekly should be sufficient. It should check everything it can, report non-compliance, and, if at all possible, automatically correct problems to bring the server in line with the standards. A great deal of caution is appropriate when having a script make automatic corrections to a server, but the alternative -- having someone manually fix the problems -- probably will not stand the test of time.&lt;br /&gt;&lt;br /&gt;Having everyone protect their user accounts is important, but may not be critical if there are accounts no one is looking after. These may be accounts of people who have left the organization, or they could be accounts installed by an application that has never been used. Of course you have a well-documented process for deleting accounts when someone leaves the company or moves departments, but processes are never perfect, so you should have a backup method. In a script (like the script to check ongoing compliance), check for dormant accounts that have never been used, or haven't been used for a few months. Be careful -- no one's going to thank you if the guy on call can't log onto a server at 3 a.m. because his account was automatically deleted the previous month. You can automatically delete accounts, but if you do, you have to be very confident that all your administrators and users log onto every server they need access to on a regular basis, and you need to exclude application accounts. One way of doing this is to have administrators manually run a script once a month that automatically logs onto every server they manage, just as a handshake to update the last login time (though you can use it to do other things as well, such as change passwords).&lt;br /&gt;&lt;br /&gt;Social engineering is an obvious way for an attacker to gain command-line access to a server. Many IT departments are large and geographically spread out, maybe even with teams in different countries. Some of your administrators may never have met each other. If a new person joins the team, some people may not find out for some time. These sorts of departments are easy targets for a social engineering attack. An attacker with some minimal knowledge of how things work in the organisation has a good chance of getting an account created or a password reset with a well-placed, convincing phone call.&lt;br /&gt;&lt;br /&gt;It may sound odd, but make sure your administrators know who is on the team. It's not uncommon these days for companies to have administration teams spread across different locations; maybe even across countries or continents. When someone gets a phone call, he needs to know who is a legitimate administrator and who isn't. It's amazing how often new staff are introduced to the people in their own office, but no one else is even told they exist. (Even introductions within the office can be missed, until a few days later someone timidly asks who the guy in the corner is and what he's doing.) Following the same principle, the security team should be familiar to the administrators (and vice versa) with easy communication routes in both directions, whether it is just being contactable on the telephone or sending out a regular security newsletter. This all seems simple, but in modern companies it can be hard to figure out which department you're in yourself after the latest reorganisation, without worrying about who is in other departments.&lt;br /&gt;&lt;br /&gt;Recognise that keeping the servers secure is an achievement to be proud of, and the people who manage it should be shown appreciation. Keep up the security training and awareness with boosters for existing staff as well as education for new people. Keep involving the administrators and listening to them. Consider having non-security staff going on external security training courses as part of their personal development.&lt;br /&gt;&lt;br /&gt;Be aware of security fatigue. Time goes by and there are no (known) security breaches. People naturally start dropping their guard. What was all that security business about anyway? We don't have a security problem. Before you know it, you're back to square one. There are a few strategies to counter this. Easiest of all, keep an eye on security break-ins reported in the media and pass on details to staff. This at least keeps awareness high that the criminals are out there, even if they aren't in here right now. Repeat audits are important, but do the audit correctly. There is very little point in auditing the security documentation: most attackers won't check your security rules before breaking in, they'll just see what is actually implemented. Better to do spot checks on real servers, even if only a small number. Also, run some penetration tests. Give some external consultant access inside your perimeter and have him try to break into the computers. Involving external people is useful as they might spot problems you've missed, and they should be able to give you some insight as to how you compare with other organisations.&lt;br /&gt;&lt;br /&gt;All being well, you end up with security that is good enough to protect the business whilst being workable for the administrators and acceptable for the owners and users. All being really well, you'll still have that security in place a year or two down the line&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-2087382894616673701?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/2087382894616673701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=2087382894616673701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/2087382894616673701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/2087382894616673701'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/managing-unix-security-part-2.html' title='Managing Unix security part 2'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-981148348204775779</id><published>2008-03-31T18:09:00.000+05:30</published><updated>2008-03-31T18:10:20.344+05:30</updated><title type='text'>Managing Unix security in large organisations, part 1</title><content type='html'>Managing security in large organizations can be a challenge. Here are some practical tips for keeping your organization sealed tight. &lt;br /&gt;In large heterogeneous Unix/Linux environments with several hundred servers, keeping up to date with security patches, which are the number one requirement for strong security, is next to impossible. Pushing out patches across hundreds of servers, with a mix of different operating systems, kernels, and versions, is complex, time-consuming, risky, and very expensive. For most large companies a six-month refresh of security patches is the best you can hope for, and even that is optimistic. This means that your servers will have exploitable security bugs most of the time. The challenge is not to eliminate those bugs but to mitigate the risk they pose.&lt;br /&gt;&lt;br /&gt;The vast majority of exploitable bugs require local access for an attacker to be able to use the exploit; he has to be logged onto the server. We tend to think that the main aim of Unix security is to guard root, but for most servers in large companies this doesn't work. A competent attacker with any local login can probably find an exploit to get root; so the real challenge is to prevent attackers from getting a local command line login.&lt;br /&gt;&lt;br /&gt;This is a big problem because all of your administrators (and maybe users too) have an account. Any one of them can allow an attacker in. No one can remember 200 passwords, so if an attacker gets a login to one box, he's probably got a login to tens or hundreds.&lt;br /&gt;&lt;br /&gt;The first way to mitigate this risk is to compartmentalise the users and administrators. You may be able to prevent some people having command line access. Maybe they can be locked into a menu or launched into a single command (e.g. to change their password). In some cases, a chrooted environment may be suitable for users.&lt;br /&gt;&lt;br /&gt;One method is to have each of your administrators responsible for certain groups of servers. If Bob only has access to 30 servers and his password is compromised, at least you've limited the damage that can be done. Unfortunately, this works less well in practise, because it clashes with a key aim of most IT departments to save money by consolidating support personnel. If you have your administrators compartmentalised into five teams, that's five different on-call rotas. Worse that this, you risk splitting up the Unix expertise and limiting communication between teams, which reduces everyone's effectiveness. This is a problem we'll see again: the contention between security and efficiency.&lt;br /&gt;&lt;br /&gt;There are ways that compartmentalising can have a chance of working, but they are not very satisfactory. For example, separate teams could perform day-to-day administration on groups of systems, but with only one on-call rota shared between the teams. You set up a special on-call user account which is maintained across the servers, store the passwords securely, and allow the on-call engineer to access them as needed. If a password is accessed, change it the next day. In this way, any administrator can access any server.&lt;br /&gt;&lt;br /&gt;Notice that identification and authentication are separated from authorisation in this model. Identification and authentication occur not on the server but when the password is accessed, which means that there needs to be a reasonably strong authorisation method for password access. When people access the server with this protocol, they are merely confirming that they are someone who has gained access to the password, which in itself is not too impressive. Whatever method of holding and accessing passwords is used, it is important that only approved people can access the on-call password and that the identity of the person who does so is correctly recorded.&lt;br /&gt;&lt;br /&gt;With this route there's still a basic problem on the efficiency side. The people on call are required to fix problems, at all hours of the night, on systems that they do not normally log onto and so have no familiarity with. In the unlikely event that the servers are either very well documented or have very standarised builds, this might work. More likely, every server has its quirks and having a problem worked on by someone unfamiliar with those could add substantially to the time it takes to fix problems and get the production system working again.&lt;br /&gt;&lt;br /&gt;There are other methods of compartmentalising, but these mostly restrict who has access to root commands (e.g. with the wheel group, user roles, or sudo). Because of all those security holes, this is rather like locking the stable door after the horse has bolted. To be fair, it's not pointless - not every attacker will have root exploits up his sleeve - but it's certainly not sufficient.&lt;br /&gt;&lt;br /&gt;One other compartmentalisation method which is worth implementing is to ensure that users do not have write access to others' home directories. By default they should not, but it's common for someone to allow world write access for convenience. This allows attackers who break into one account to take control of others too, even before they have root access.&lt;br /&gt;&lt;br /&gt;Whether or not you can compartmentalise your administrators and users, there are other techniques to make it more difficult for attackers to gain command-line user access.&lt;br /&gt;&lt;br /&gt;One option is to enforce access by secure shell with public/private key pairs and pass-phrases. This puts a significant barrier in the way of an attacker. Instead of just getting a password, he now has to get a private key and pass-phrase: something I have and something I know. Of course for this to work, password access must be blocked.&lt;br /&gt;&lt;br /&gt;In large environments, public/private key access are tough to manage. First there's the problem of key distribution. If there are 20 administrators and 200 servers, that's 4,000 individual keys to push around onto servers. If someone changes his key, the new key has to be pushed out to all the servers again. On the client side, each administrator's private key must be on each client machine the administrator might use to access servers (or on a network directory mounted onto every client machine). This may include home PCs and laptops that are easily stealable.&lt;br /&gt;&lt;br /&gt;There are other problems with using public key access. Enforcing good pass-phrases and key aging is difficult. Revoking keys is also difficult. If an administrator leaves, his account should be locked or deleted. But because he had root access, he could have hidden his public key in someone else's account to give himself a back door onto the system, or created a fake user account. To some extent this can be checked for. For example, scripts can flag up accounts with more than one key, but this isn't easy, and is certainly hard work.&lt;br /&gt;&lt;br /&gt;This is one situation where a public key infrastructure (PKI) is effective. Having a PKI allows keys to be revoked and can also overcome the key distribution problem. It doesn't make people choose strong pass-phrases though; and it is certainly non-trivial to implement.&lt;br /&gt;&lt;br /&gt;One last thing to consider with the public key solution is the efficiency angle. A critical requirement for any solution is that administrators and users can get onto any server when they need to. As protocols get more complex, there are more things that can go wrong and prevent access, and a greater chance that the people using a product won't understand how it works and will break it, or compromise security by using it wrongly. For example, there are various file permissions which prevent secure shell working but do not cause telnet a problem. How confident are you that your solution will always allow the right people on while keeping the wrong people off? If you are not too confident, you may need an alternative method to access the servers.&lt;br /&gt;&lt;br /&gt;Two possible server access methods that can be used in emergencies are TCP-wrappered telnet (so people can telnet to a server, but only from a specific other server within the same location, with the plain text password not leaving the computer room) and remote console access, again within a secure computer room.&lt;br /&gt;&lt;br /&gt;All of these techniques are helpful in maintaining security&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-981148348204775779?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/981148348204775779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=981148348204775779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/981148348204775779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/981148348204775779'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/managing-unix-security-in-large.html' title='Managing Unix security in large organisations, part 1'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3281123453317964978</id><published>2008-03-31T17:58:00.001+05:30</published><updated>2008-03-31T18:05:55.649+05:30</updated><title type='text'>Comparing Linux and AIX</title><content type='html'>Linux can learn valuable lessons from its elder cousins in the enterprise, the proprietary Unixes from the likes of IBM, Sun, and HP. Those operating systems, in turn, can learn some lessons from Linux. Comparing the features of the more enterprise-ready Linux distros with AIX, one of the leading proprietary Unixes, helps identify some of those lessons. &lt;br /&gt;AIX was developed primarily for administrators, whereas Linux has been developed for and by hackers. Right from the start, a key goal of commercial Unixes is to make things easy for the people running them (though they don't always succeed). Only recently has this been a major factor in the Linux world. Some deficiencies can be fixed with improved tools, while others are more fundamental to the operating systems.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The benefit of proprietary hardware&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;AIX runs only on IBM's own hardware, based around the POWER family of processors, of which the POWER5 is the latest. (Apple's G5 chip is the baby brother of the POWER4.) Pretty much all the adapters and components that run in those servers are either made or rebadged by IBM. In the past IBM has almost given AIX away, making money from the hardware and services instead of the operating system software.&lt;br /&gt;&lt;br /&gt;Using a single hardware architecture removes a big headache for AIX developers. There is no struggling to write device drivers for thousands of obscure devices, for a start. By controlling the hardware platform IBM can offer high-end hardware features such as hot-swap adapters and logical partitioning, not to mention servers where the firmware (equivalent of the BIOS) can be accessed through a Web browser when the server is powered off.&lt;br /&gt;&lt;br /&gt;There is a significant price premium for this hardware, but there are great benefits too. CPU and memory are not all that matters (though IBM's latest model comes with up to 512GB of RAM, which should be enough for most people). Many companies are happy to pay more, or sacrifice speed, to improve reliability, availability, and serviceability. If an hour of downtime costs your business tens of thousands of dollars, this is a big deal.&lt;br /&gt;&lt;br /&gt;Luckily, Linux is coming to have the best of both worlds. Those who want to take advantage of IBM's fancy hardware features can now run SUSE or Red Hat Linux on just about any server than IBM makes and, with logical partitioning, can even run Linux and AIX on the same server at the same time.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Device management&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Linux has always been somewhat clumsy at device management. I often find myself trawling through dmesg and playing "guess the device" to figure out if some device is there and how it has been configured. Whether a particular piece of information about a device is available often seems a matter of luck. A variety of other commands with different syntaxes and outputs help to cobble together an overall picture of the hardware on a system.&lt;br /&gt;&lt;br /&gt;AIX is a breath of fresh air in comparison. Devices can be queried easily through a few commands. The syntax for amending device settings is clear and consistent across all devices, and the amount of information available on each device is huge.&lt;br /&gt;&lt;br /&gt;If new devices are added to a running system, a single command configures them all and installs device drivers where needed.&lt;br /&gt;&lt;br /&gt;On my home PC, with a handful of disks and adapters, maybe I don't need the device information to be so easy to access and update. On an enterprise server with 150 PCI adapters and a few hundred disks, however, it becomes a lot more important to have good accurate information about exactly what and where everything is and what it is all doing.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Systems management&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;For new and experienced AIX administrators alike, AIX's Systems Management Interface Tool (SMIT) is a useful (and often essential) tool. Think of it as YaST2 with fewer sexy graphics but more functionality. About 80% of administration tasks on an AIX system can be done using SMIT. It's simple, easy to understand, mature, and it works. One nice feature is that it always saves the command or script it has run to a file, so you can do something once in SMIT and then script it thereafter. You can even say "don't do this for real, but log the command you would have run."&lt;br /&gt;&lt;br /&gt;AIX also has a Web administration tool which, while slow (accessing via the bundled Windows or Linux PC client speeds it up) and occasionally buggy, is still a long way ahead of anything Linux has to offer. Want to set up ipsec? AIX has a nice wizard that makes it easy.&lt;br /&gt;&lt;br /&gt;Linux is improving quickly with systems management, but some developers still seem to feel that if is isn't obscure and complicated, there's something wrong. That's fine for hackers, but companies want to employ administrators to run their systems, not hackers, and administrators like things to be easy, especially when they've got a few hundred systems to manage.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Installation and upgrades&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Major OS upgrades are still a weak point for Linux. I've tried upgrades on a number of different Linux distros. Sometimes they work, sometimes they don't, and more often than not, I end up installing from scratch.&lt;br /&gt;&lt;br /&gt;In comparison, AIX very rarely has a problem with upgrades, even when jumping several versions. I go into an AIX upgrade confident that it will work, and I go into a Linux upgrade with a feeling that it's 50/50.&lt;br /&gt;&lt;br /&gt;For new installations, the picture is more balanced. AIX has few problems with new installs. If Linux has a problem, it's normally with some odd hardware -- not a problem AIX has to deal with, of course. Where AIX falls down is the lack of installation options. Only in the latest version of AIX has it been possible to specify a graphics-free installation, and the ability to choose packages at installation time is very limited.&lt;br /&gt;&lt;br /&gt;AIX includes the Network Installation Manager (NIM), which can perform new installations, upgrades, software installation, and a number of other tasks across the network. It is easy to set up (via command line, menu, or wizard) and it works well. Similar tools exist for Linux, but right now they lack some of the functionality.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The proprietary Unixes have traditionally fallen down a little on security, and AIX is no exception. From a commercial perspective it makes sense to not alienate your users, so usability has always taken precedence over security. The last thing IBM or Sun wants is businesses performing upgrades that stop their applications working correctly.&lt;br /&gt;&lt;br /&gt;The result of this corporate caution is that a fresh install of AIX has gaping security holes. Services such as telnet, ftp, and rshd are enabled by default. Secure Shell (SSH) and TCP Wrappers aren't even installed (IBM ships both, but on a separate CD). AIX does come with some basic packet filtering, but there's no firewall on by default and it isn't easy to configure. Filesystem and swap space encryption aren't there either.&lt;br /&gt;&lt;br /&gt;Compare this to Linux, where SSH is the default, most insecure services are disabled, a wealth of security software is shipped with almost every distro, and much effort has been put into helping users secure their systems.&lt;br /&gt;&lt;br /&gt;AIX can be configured securely. IBM has a nice white paper that guides you through a lot of the tasks, but it isn't trivial to do, and the result is that a lot of companies don't, and tools like telnet are still a lot more common than they should be.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Managing disks and filesystems&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Disk and filesystem management is an area where AIX is still well ahead of Linux. AIX doesn't have partitions or slices -- it has a logical volume manager instead. Logical volumes and volume groups are fundamentals on AIX, not add-ons.&lt;br /&gt;&lt;br /&gt;To show how this can help, let's look at some of the things than can be done on AIX while the system is running normally, all using software.&lt;br /&gt;&lt;br /&gt;Data can be mirrored and unmirrored online between any two disks. Want to mirror data between a local SCSI disk and a NAS-attached iSCSI disk of different sizes? No problem. A mirror copy can be broken off to create a "point-in-time" backup of how the system looked at that moment, then re-integrated later on.&lt;br /&gt;&lt;br /&gt;Whole filesystems can be moved between disks, or spread out over different disks, all while users carry on oblivious. How about setting up a group of disks and making one a spare, so if another fails the spare automatically takes over, the data being copied over to it? That's simple too.&lt;br /&gt;&lt;br /&gt;The OS can even be upgraded on a running system. You can create a copy of the OS disks, upgrade the copy, and then reboot from the upgraded disk; if it doesn't work, just switch back to the old one.&lt;br /&gt;&lt;br /&gt;All of these, and more, come standard with the AIX operating system and can be done from simple command lines and menus. By contrast, even something like software mirroring on Linux is complicated in comparison to the one-line AIX commands.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Workload management&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A perpetual problem with high-end computers is that they have too much computing capacity. Both Sun and IBM believe that their servers are often no more than 20% utilised. Luckily, all the major vendors have come up with solutions to help customers make effective use of the computing power they've spent so much money on.&lt;br /&gt;&lt;br /&gt;Logical partitioning is the flavour of the day, with the ability to split servers up and have multiple instances running. Sun have extended this with its N-1 Grid Containers, effectively an advanced chrooted environment with multiple instances running under the same OS environment.&lt;br /&gt;&lt;br /&gt;IBM have achieved a similar result in a slightly different way. With IBM's latest hardware, what looks like a separate computer can run on as little as one-tenth of a CPU, meaning that twenty instances of AIX can run on a dual-processor server. Even better, they can share Ethernet adapters and disks, so there is no need to have hundreds of adapters (though you can if you want to). You can even have your partitions talk to each other over the network adapter, using a virtual switch (with VLAN functionality) held in the server firmware. These partitions do not sit on top of an underlying OS; they run directly on the server.&lt;br /&gt;&lt;br /&gt;Most of these functions are available for SUSE and Red Hat Linux on the POWER5 platform too, for those with generous hardware budgets.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Linux has come a long way in the last few years, but for high-end functionality and maturity, the likes of AIX and other high-end Unixes still have a significant edge. When it comes to security, though, Linux is ahead of the game, so the catching up is on the other side.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3281123453317964978?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3281123453317964978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3281123453317964978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3281123453317964978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3281123453317964978'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/comparing-linux-and-aix.html' title='Comparing Linux and AIX'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3763597551894979653</id><published>2008-03-31T17:49:00.001+05:30</published><updated>2008-03-31T17:57:06.405+05:30</updated><title type='text'>AIX Affinity With Linux</title><content type='html'>Linux Background:&lt;br /&gt;The Linux operating system has gained popularity through its close connection with&lt;br /&gt;Internet computing and e-business. The operating system has gained a large share of this business because of the high number of applications that have been developed.&lt;br /&gt;Linux’s initial attraction was that it was a “free” operating system, meaning that the source code was made available without charge. While the lack of a cost was an initial appeal, the real appeal is proving to be the applications that have been either developed or ported to Linux. Examples include Sendmail, Apache web server, and Samba (NT file and Print server emulator).&lt;br /&gt;Every successful operating system has had a breakthrough application, the breakthrough application for Linux was (and still is) the Apache Web Server. Apache is by far the most widely used HTTP server on the Internet.&lt;br /&gt;Further spurring the growth of Linux is the availability of the GNU tools. GNU is an&lt;br /&gt;open source project that has developed a series of tools from compilers to text editors.These tools have been ported to Linux and are the tools of choice for many developers of Linux applications.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why AIX Affinity with Linux?&lt;/strong&gt;&lt;br /&gt;The value is in the data and the applications. Developing applications is a costly and time-consuming process. If a company needed to move from a low end Intel based&lt;br /&gt;system to a high performing IBM ^ pSeries or IBM RS/6000® system they&lt;br /&gt;usually had to develop all new applications.&lt;br /&gt;The first issue became how to assist companies that currently use Linux based application and need a mission critical system easily move to AIX 5L. The answer is to offer a set of integrated API’s and header files that will allow a Linux application to be recompiled to run on AIX 5L. AIX version 4.3.3 and AIX 5L version 5.0 today has many of the necessary APIs to run Linux application, with AIX 5L Version 5.1, there will be an even greater degree of compatibility between AIX and Linux.&lt;br /&gt;The second issue is that applications are in a constant state of development, either&lt;br /&gt;through enhancements or through fixing of bugs. Thus it is important that these&lt;br /&gt;companies be able to work on their applications using familiar tools. The answer was to port key components of the GNU tool set, along with other open source tools, to AIX 5L.&lt;br /&gt;GNU tools allows customers to work on existing applications, as well as develop new&lt;br /&gt;applications using tools that they are familiar with. GNU tools are also the tools needed to recompile Linux applications to run on AIX 5L and AIX 4.3.3. This issue is addressed by the AIX Toolbox for Linux Applications, with GNU tools that have been recompiled for AIX as well as many other useful open source tools and utilities&lt;br /&gt;&lt;br /&gt;AIX 4.3.3 and AIX 5L Version 5.0 already have affinity with Linux. Thus, you can&lt;br /&gt;benefit today from AIX affinity with Linux with additional source compatibility available in AIX 5L Version 5.1.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;When to use:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When considering how to best utilize AIX Affinity with Linux it is important to consider impacts to performance. AIX Affinity with Linux is designed to provide the best performance possible, however there are a couple of issues to consider that are outside the control of AIX Affinity with Linux that can influence performance.&lt;br /&gt;The Linux application being deployed on AIX will have full access to all AIX&lt;br /&gt;functionality, just like an application natively developed for AIX. AIX currently has a high level of compatibility with Linux, and with AIX 5L version 5.1, IBM plans to provide an even greater affinity between AIX and Linux. Thus, for a Linux application to take advantage of AIX it does not need to run through any additional layer or wrapper.&lt;br /&gt;The question of performance is not one of the functionality of the recompiled Linux&lt;br /&gt;application to take advantage of AIX and the IBM POWER architecture (and in the future the Intel Itanium architecture) but one of the performance of the compiler used to build the application. Most applications that have been developed natively for AIX use the IBM Visual Age compiler, while applications developed natively for Linux utilize the GNU compilers. Thus, you can expect to see a performance advantage for AIX applications that have been built using the IBM Visual Age compiler. At this time the IBM Visual Age compiler is not available for Linux applications.&lt;br /&gt;The Application Programming Interface (API) method that AIX utilizes, provides a higher degree of integration between the application and the operating system than can be achieved using a layered or wrapper approach such as found in an Application Binary Interface (ABI) approach&lt;br /&gt;&lt;br /&gt;When considering where to utilize AIX Affinity with Linux it is important to consider what applications you will be using for front-end and back-end. Many back-end applications such as databases are available on AIX. If the back-end application you are using is currently available natively on AIX, you should consider using that application rather than porting the Linux version to AIX. Another consideration is what applications in your portfolio are not performance sensitive, do not have a lot of computational requirements etc... that would benefit from the IBM Visual Age Compiler.&lt;br /&gt;An example of how to utilize AIX Affinity with Linux technology is for front-end&lt;br /&gt;applications. These are applications that are communicating with a back-end application.&lt;br /&gt;Front-end applications typically have little or no areas where a compiler would make a significant performance advantage.&lt;br /&gt;Thus, a company that develops its front-end applications on Linux can deploy them&lt;br /&gt;across IBMs range of AIX and Linux enabled servers being it on Native Linux or AIX.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For back-end applications where performance is key, it is best to deploy an application that was developed for AIX. Most of these applications will have been developed utilizing the high performance IBM Visual Age compilers. However, there is nothing to preclude a back-end application from being developed on Linux and deployed on AIX. The performance difference will depend upon the application, and may be negligible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3763597551894979653?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3763597551894979653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3763597551894979653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3763597551894979653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3763597551894979653'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/aix-affinity-with-linux.html' title='AIX Affinity With Linux'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-6875749438215996985</id><published>2008-03-30T21:45:00.000+05:30</published><updated>2008-03-30T21:49:25.347+05:30</updated><title type='text'>perl - Practical Extraction and Report Language</title><content type='html'>Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).&lt;br /&gt;&lt;br /&gt;Perl combines (in the author's opinion, anyway) some of the best features of C, sed, awk, and sh, so people familiar with those languages should have little difficulty with it. (Language historians will also note some vestiges of csh, Pascal, and even BASIC-PLUS.) Expression syntax corresponds closely to C expression syntax. Unlike most Unix utilities, Perl does not arbitrarily limit the size of your data--if you've got the memory, Perl can slurp in your whole file as a single string. Recursion is of unlimited depth. And the tables used by hashes (sometimes called "associative arrays") grow as necessary to prevent degraded performance. Perl can use sophisticated pattern matching techniques to scan large amounts of data quickly. Although optimized for scanning text, Perl can also deal with binary data, and can make dbm files look like hashes. Setuid Perl scripts are safer than C programs through a dataflow tracing mechanism that prevents many stupid security holes.&lt;br /&gt;&lt;br /&gt;If you have a problem that would ordinarily use sed or awk or sh, but it exceeds their capabilities or must run a little faster, and you don't want to write the silly thing in C, then Perl may be for you. There are also translators to turn your sed and awk scripts into Perl scripts.&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;SYNOPSIS&lt;/strong&gt;&lt;br /&gt;perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ] [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ] [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ] [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ] [ -C [number/list] ] [ -P ] [ -S ] [ -x[dir] ] [ -i[extension] ] [ -e 'command' ] [ -- ] [ programfile ] [ argument ]...&lt;br /&gt;&lt;br /&gt;If you're new to Perl, you should start with perlintro, which is a general intro for beginners and provides some background to help you navigate the rest of Perl's extensive documentation.&lt;br /&gt;&lt;br /&gt;For ease of access, the Perl manual has been split up into several sections.&lt;br /&gt;&lt;br /&gt;Overview&lt;br /&gt;    perl  Perl overview (this section)&lt;br /&gt;    perlintro  Perl introduction for beginners&lt;br /&gt;    perltoc  Perl documentation table of contentsTutorials&lt;br /&gt;    perlreftut  Perl references short introduction&lt;br /&gt;    perldsc  Perl data structures intro&lt;br /&gt;    perllol  Perl data structures: arrays of arrays    perlrequick  Perl regular expressions quick start&lt;br /&gt;    perlretut  Perl regular expressions tutorial    perlboot  Perl OO tutorial for beginners&lt;br /&gt;    perltoot  Perl OO tutorial, part 1&lt;br /&gt;    perltooc  Perl OO tutorial, part 2&lt;br /&gt;    perlbot  Perl OO tricks and examples    perlstyle  Perl style guide    perlcheat  Perl cheat sheet&lt;br /&gt;    perltrap  Perl traps for the unwary&lt;br /&gt;    perldebtut  Perl debugging tutorial    perlfaq  Perl frequently asked questions&lt;br /&gt;      perlfaq1  General Questions About Perl&lt;br /&gt;      perlfaq2  Obtaining and Learning about Perl&lt;br /&gt;      perlfaq3  Programming Tools&lt;br /&gt;      perlfaq4  Data Manipulation&lt;br /&gt;      perlfaq5  Files and Formats&lt;br /&gt;      perlfaq6  Regexes&lt;br /&gt;      perlfaq7  Perl Language Issues&lt;br /&gt;      perlfaq8  System Interaction&lt;br /&gt;      perlfaq9  NetworkingReference Manual&lt;br /&gt;    perlsyn  Perl syntax&lt;br /&gt;    perldata  Perl data structures&lt;br /&gt;    perlop  Perl operators and precedence&lt;br /&gt;    perlsub  Perl subroutines&lt;br /&gt;    perlfunc  Perl built-in functions&lt;br /&gt;      perlopentut Perl open() tutorial&lt;br /&gt;      perlpacktut Perl pack() and unpack() tutorial&lt;br /&gt;    perlpod  Perl plain old documentation&lt;br /&gt;    perlpodspec  Perl plain old documentation format specification&lt;br /&gt;    perlrun  Perl execution and options&lt;br /&gt;    perldiag  Perl diagnostic messages&lt;br /&gt;    perllexwarn  Perl warnings and their control&lt;br /&gt;    perldebug  Perl debugging&lt;br /&gt;    perlvar  Perl predefined variables&lt;br /&gt;    perlre  Perl regular expressions, the rest of the story&lt;br /&gt;    perlrebackslash Perl regular expression backslash sequences&lt;br /&gt;    perlrecharclass Perl regular expression character classes&lt;br /&gt;    perlreref  Perl regular expressions quick reference&lt;br /&gt;    perlref  Perl references, the rest of the story&lt;br /&gt;    perlform  Perl formats&lt;br /&gt;    perlobj  Perl objects&lt;br /&gt;    perltie  Perl objects hidden behind simple variables&lt;br /&gt;      perldbmfilter Perl DBM filters    perlipc  Perl interprocess communication&lt;br /&gt;    perlfork  Perl fork() information&lt;br /&gt;    perlnumber  Perl number semantics    perlthrtut  Perl threads tutorial&lt;br /&gt;      perlothrtut Old Perl threads tutorial    perlport  Perl portability guide&lt;br /&gt;    perllocale  Perl locale support&lt;br /&gt;    perluniintro Perl Unicode introduction&lt;br /&gt;    perlunicode  Perl Unicode support&lt;br /&gt;    perlunifaq  Perl Unicode FAQ&lt;br /&gt;    perlunitut  Perl Unicode tutorial&lt;br /&gt;    perlebcdic  Considerations for running Perl on EBCDIC platforms    perlsec  Perl security    perlmod  Perl modules: how they work&lt;br /&gt;    perlmodlib  Perl modules: how to write and use&lt;br /&gt;    perlmodstyle Perl modules: how to write modules with style&lt;br /&gt;    perlmodinstall Perl modules: how to install from CPAN&lt;br /&gt;    perlnewmod  Perl modules: preparing a new module for distribution&lt;br /&gt;    perlpragma  Perl modules: writing a user pragma    perlutil  utilities packaged with the Perl distribution    perlcompile  Perl compiler suite intro    perlfilter  Perl source filters    perlglossary Perl GlossaryInternals and C Language Interface&lt;br /&gt;    perlembed  Perl ways to embed perl in your C or C++ application&lt;br /&gt;    perldebguts  Perl debugging guts and tips&lt;br /&gt;    perlxstut  Perl XS tutorial&lt;br /&gt;    perlxs  Perl XS application programming interface&lt;br /&gt;    perlclib  Internal replacements for standard C library functions&lt;br /&gt;    perlguts  Perl internal functions for those doing extensions&lt;br /&gt;    perlcall  Perl calling conventions from C&lt;br /&gt;    perlreapi  Perl regular expression plugin interface&lt;br /&gt;    perlreguts  Perl regular expression engine internals    perlapi  Perl API listing (autogenerated)&lt;br /&gt;    perlintern  Perl internal functions (autogenerated)&lt;br /&gt;    perliol  C API for Perl's implementation of IO in Layers&lt;br /&gt;    perlapio  Perl internal IO abstraction interface    perlhack  Perl hackers guideMiscellaneous&lt;br /&gt;    perlbook  Perl book information&lt;br /&gt;    perlcommunity Perl community information&lt;br /&gt;    perltodo  Perl things to do    perldoc  Look up Perl documentation in Pod format    perlhist  Perl history records&lt;br /&gt;    perldelta  Perl changes since previous version&lt;br /&gt;    perl595delta Perl changes in version 5.9.5&lt;br /&gt;    perl594delta Perl changes in version 5.9.4&lt;br /&gt;    perl593delta Perl changes in version 5.9.3&lt;br /&gt;    perl592delta Perl changes in version 5.9.2&lt;br /&gt;    perl591delta Perl changes in version 5.9.1&lt;br /&gt;    perl590delta Perl changes in version 5.9.0&lt;br /&gt;    perl588delta Perl changes in version 5.8.8&lt;br /&gt;    perl587delta Perl changes in version 5.8.7&lt;br /&gt;    perl586delta Perl changes in version 5.8.6&lt;br /&gt;    perl585delta Perl changes in version 5.8.5&lt;br /&gt;    perl584delta Perl changes in version 5.8.4&lt;br /&gt;    perl583delta Perl changes in version 5.8.3&lt;br /&gt;    perl582delta Perl changes in version 5.8.2&lt;br /&gt;    perl581delta Perl changes in version 5.8.1&lt;br /&gt;    perl58delta  Perl changes in version 5.8.0&lt;br /&gt;    perl573delta Perl changes in version 5.7.3&lt;br /&gt;    perl572delta Perl changes in version 5.7.2&lt;br /&gt;    perl571delta Perl changes in version 5.7.1&lt;br /&gt;    perl570delta Perl changes in version 5.7.0&lt;br /&gt;    perl561delta Perl changes in version 5.6.1&lt;br /&gt;    perl56delta  Perl changes in version 5.6&lt;br /&gt;    perl5005delta Perl changes in version 5.005&lt;br /&gt;    perl5004delta Perl changes in version 5.004    perlartistic Perl Artistic License&lt;br /&gt;    perlgpl  GNU General Public LicenseLanguage-Specific&lt;br /&gt;    perlcn  Perl for Simplified Chinese (in EUC-CN)&lt;br /&gt;    perljp  Perl for Japanese (in EUC-JP)&lt;br /&gt;    perlko  Perl for Korean (in EUC-KR)&lt;br /&gt;    perltw  Perl for Traditional Chinese (in Big5)Platform-Specific&lt;br /&gt;    perlaix  Perl notes for AIX&lt;br /&gt;    perlamiga  Perl notes for AmigaOS&lt;br /&gt;    perlapollo  Perl notes for Apollo DomainOS&lt;br /&gt;    perlbeos  Perl notes for BeOS&lt;br /&gt;    perlbs2000  Perl notes for POSIX-BC BS2000&lt;br /&gt;    perlce  Perl notes for WinCE&lt;br /&gt;    perlcygwin  Perl notes for Cygwin&lt;br /&gt;    perldgux  Perl notes for DG/UX&lt;br /&gt;    perldos  Perl notes for DOS&lt;br /&gt;    perlepoc  Perl notes for EPOC&lt;br /&gt;    perlfreebsd  Perl notes for FreeBSD&lt;br /&gt;    perlhpux  Perl notes for HP-UX&lt;br /&gt;    perlhurd  Perl notes for Hurd&lt;br /&gt;    perlirix  Perl notes for Irix&lt;br /&gt;    perllinux  Perl notes for Linux&lt;br /&gt;    perlmachten  Perl notes for Power MachTen&lt;br /&gt;    perlmacos  Perl notes for Mac OS (Classic)&lt;br /&gt;    perlmacosx  Perl notes for Mac OS X&lt;br /&gt;    perlmint  Perl notes for MiNT&lt;br /&gt;    perlmpeix  Perl notes for MPE/iX&lt;br /&gt;    perlnetware  Perl notes for NetWare&lt;br /&gt;    perlopenbsd  Perl notes for OpenBSD&lt;br /&gt;    perlos2  Perl notes for OS/2&lt;br /&gt;    perlos390  Perl notes for OS/390&lt;br /&gt;    perlos400  Perl notes for OS/400&lt;br /&gt;    perlplan9  Perl notes for Plan 9&lt;br /&gt;    perlqnx  Perl notes for QNX&lt;br /&gt;    perlriscos  Perl notes for RISC OS&lt;br /&gt;    perlsolaris  Perl notes for Solaris&lt;br /&gt;    perlsymbian  Perl notes for Symbian&lt;br /&gt;    perltru64  Perl notes for Tru64&lt;br /&gt;    perluts  Perl notes for UTS&lt;br /&gt;    perlvmesa  Perl notes for VM/ESA&lt;br /&gt;    perlvms  Perl notes for VMS&lt;br /&gt;    perlvos  Perl notes for Stratus VOS&lt;br /&gt;    perlwin32  Perl notes for WindowsBy default, the manpages listed above are installed in the /usr/local/man/ directory.&lt;br /&gt;&lt;br /&gt;Extensive additional documentation for Perl modules is available. The default configuration for perl will place this additional documentation in the /usr/local/lib/perl5/man directory (or else in the man subdirectory of the Perl library directory). Some of this additional documentation is distributed standard with Perl, but you'll also find documentation for third-party modules there.&lt;br /&gt;&lt;br /&gt;You should be able to view Perl's documentation with your man(1) program by including the proper directories in the appropriate start-up files, or in the MANPATH environment variable. To find out where the configuration has installed the manpages, type:&lt;br /&gt;&lt;br /&gt;    perl -V:man.dirIf the directories have a common stem, such as /usr/local/man/man1 and /usr/local/man/man3, you need only to add that stem (/usr/local/man) to your man(1) configuration files or your MANPATH environment variable. If they do not share a stem, you'll have to add both stems.&lt;br /&gt;&lt;br /&gt;If that doesn't work for some reason, you can still use the supplied perldoc script to view module information. You might also look into getting a replacement man program.&lt;br /&gt;&lt;br /&gt;If something strange has gone wrong with your program and you're not sure where you should look for help, try the -w switch first. It will often point out exactly where the trouble is.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;BUGS&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Perl is at the mercy of your machine's definitions of various operations such as type casting, atof(), and floating-point output with sprintf().&lt;br /&gt;&lt;br /&gt;If your stdio requires a seek or eof between reads and writes on a particular stream, so does Perl. (This doesn't apply to sysread() and syswrite().)&lt;br /&gt;&lt;br /&gt;While none of the built-in data types have any arbitrary size limits (apart from memory size), there are still a few arbitrary limits: a given variable name may not be longer than 251 characters. Line numbers displayed by diagnostics are internally stored as short integers, so they are limited to a maximum of 65535 (higher numbers usually being affected by wraparound).&lt;br /&gt;&lt;br /&gt;You may mail your bug reports (be sure to include full configuration information as output by the myconfig program in the perl source tree, or by perl -V ) to perlbug@perl.org . If you've succeeded in compiling perl, the perlbug script in the utils/ subdirectory can be used to help mail in a bug report&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-6875749438215996985?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/6875749438215996985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=6875749438215996985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6875749438215996985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6875749438215996985'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/perl-practical-extraction-and-report.html' title='perl - Practical Extraction and Report Language'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3024699258456318242</id><published>2008-03-30T21:41:00.000+05:30</published><updated>2008-03-30T21:44:46.660+05:30</updated><title type='text'>Installation of PHP on Unix systems</title><content type='html'>There are several ways to install PHP for the Unix platform, either with a compile and configure process, or through various pre-packaged methods. This documentation is mainly focused around the process of compiling and configuring PHP. Many Unix like systems have some sort of package installation system. This can assist in setting up a standard configuration, but if you need to have a different set of features (such as a secure server, or a different database driver), you may need to build PHP and/or your web server. If you are unfamiliar with building and compiling your own software, it is worth checking to see whether somebody has already built a packaged version of PHP with the features you need. &lt;br /&gt;&lt;br /&gt;Prerequisite knowledge and software for compiling: &lt;br /&gt;&lt;br /&gt;Basic Unix skills (being able to operate "make" and a C compiler) &lt;br /&gt;An ANSI C compiler &lt;br /&gt;flex: Version 2.5.4 &lt;br /&gt;bison: Version 1.28 (preferred), 1.35, or 1.75 &lt;br /&gt;A web server &lt;br /&gt;Any module specific components (such as gd, pdf libs, etc.) &lt;br /&gt;&lt;br /&gt;The initial PHP setup and configuration process is controlled by the use of the command line options of the configure script. You could get a list of all available options along with short explanations running ./configure --help. Our manual documents the different options separately. You will find the core options in the appendix, while the different extension specific options are descibed on the reference pages. &lt;br /&gt;&lt;br /&gt;When PHP is configured, you are ready to build the module and/or executables. The command make should take care of this. If it fails and you can't figure out why, see the Problems section. &lt;br /&gt;&lt;br /&gt;Apache 1.3.x on Unix systems&lt;br /&gt;This section contains notes and hints specific to Apache installs of PHP on Unix platforms. We also have instructions and notes for Apache 2 on a separate page. &lt;br /&gt;&lt;br /&gt;You can select arguments to add to the configure on line 10 below from the list of core configure options and from extension specific options described at the respective places in the manual. The version numbers have been omitted here, to ensure the instructions are not incorrect. You will need to replace the 'xxx' here with the correct values from your files. &lt;br /&gt;&lt;br /&gt;Example#1 Installation Instructions (Apache Shared Module Version) for PHP &lt;br /&gt;&lt;br /&gt;1.  gunzip apache_xxx.tar.gz&lt;br /&gt;2.  tar -xvf apache_xxx.tar&lt;br /&gt;3.  gunzip php-xxx.tar.gz&lt;br /&gt;4.  tar -xvf php-xxx.tar&lt;br /&gt;5.  cd apache_xxx&lt;br /&gt;6.  ./configure --prefix=/www --enable-module=so&lt;br /&gt;7.  make&lt;br /&gt;8.  make install&lt;br /&gt;9.  cd ../php-xxx&lt;br /&gt;&lt;br /&gt;10. Now, configure your PHP.  This is where you customize your PHP&lt;br /&gt;    with various options, like which extensions will be enabled.  Do a&lt;br /&gt;    ./configure --help for a list of available options.  In our example&lt;br /&gt;    we'll do a simple configure with Apache 1 and MySQL support.  Your&lt;br /&gt;    path to apxs may differ from our example.&lt;br /&gt;&lt;br /&gt;      ./configure --with-mysql --with-apxs=/www/bin/apxs&lt;br /&gt;&lt;br /&gt;11. make&lt;br /&gt;12. make install&lt;br /&gt;&lt;br /&gt;    If you decide to change your configure options after installation,&lt;br /&gt;    you only need to repeat the last three steps. You only need to &lt;br /&gt;    restart apache for the new module to take effect. A recompile of&lt;br /&gt;    Apache is not needed.&lt;br /&gt;  &lt;br /&gt;    Note that unless told otherwise, 'make install' will also install PEAR,&lt;br /&gt;    various PHP tools such as phpize, install the PHP CLI, and more.&lt;br /&gt;&lt;br /&gt;13. Setup your php.ini file:&lt;br /&gt;&lt;br /&gt;      cp php.ini-dist /usr/local/lib/php.ini&lt;br /&gt;&lt;br /&gt;    You may edit your .ini file to set PHP options.  If you prefer your&lt;br /&gt;    php.ini in another location, use --with-config-file-path=/some/path in&lt;br /&gt;    step 10. &lt;br /&gt;    &lt;br /&gt;    If you instead choose php.ini-recommended, be certain to read the list&lt;br /&gt;    of changes within, as they affect how PHP behaves.&lt;br /&gt;&lt;br /&gt;14. Edit your httpd.conf to load the PHP module.  The path on the right hand&lt;br /&gt;    side of the LoadModule statement must point to the path of the PHP&lt;br /&gt;    module on your system.  The make install from above may have already&lt;br /&gt;    added this for you, but be sure to check.&lt;br /&gt;        &lt;br /&gt;    For PHP 4:&lt;br /&gt;            &lt;br /&gt;      LoadModule php4_module libexec/libphp4.so&lt;br /&gt;&lt;br /&gt;    For PHP 5:&lt;br /&gt;                      &lt;br /&gt;      LoadModule php5_module libexec/libphp5.so&lt;br /&gt;      &lt;br /&gt;15. And in the AddModule section of httpd.conf, somewhere under the&lt;br /&gt;    ClearModuleList, add this:&lt;br /&gt;    &lt;br /&gt;    For PHP 4:&lt;br /&gt;    &lt;br /&gt;      AddModule mod_php4.c&lt;br /&gt;      &lt;br /&gt;    For PHP 5:&lt;br /&gt;    &lt;br /&gt;      AddModule mod_php5.c&lt;br /&gt;&lt;br /&gt;16. Tell Apache to parse certain extensions as PHP.  For example,&lt;br /&gt;    let's have Apache parse the .php extension as PHP.  You could&lt;br /&gt;    have any extension(s) parse as PHP by simply adding more, with&lt;br /&gt;    each separated by a space.  We'll add .phtml to demonstrate.&lt;br /&gt;&lt;br /&gt;      AddType application/x-httpd-php .php .phtml&lt;br /&gt;&lt;br /&gt;    It's also common to setup the .phps extension to show highlighted PHP&lt;br /&gt;    source, this can be done with:&lt;br /&gt;    &lt;br /&gt;      AddType application/x-httpd-php-source .phps&lt;br /&gt;&lt;br /&gt;17. Use your normal procedure for starting the Apache server. (You must&lt;br /&gt;    stop and restart the server, not just cause the server to reload by&lt;br /&gt;    using a HUP or USR1 signal.)&lt;br /&gt;&lt;br /&gt;     Alternatively, to install PHP as a static object: &lt;br /&gt;&lt;br /&gt;Example#2 Installation Instructions (Static Module Installation for Apache) for PHP &lt;br /&gt;&lt;br /&gt;1.  gunzip -c apache_1.3.x.tar.gz | tar xf -&lt;br /&gt;2.  cd apache_1.3.x&lt;br /&gt;3.  ./configure&lt;br /&gt;4.  cd ..&lt;br /&gt;&lt;br /&gt;5.  gunzip -c php-5.x.y.tar.gz | tar xf -&lt;br /&gt;6.  cd php-5.x.y&lt;br /&gt;7.  ./configure --with-mysql --with-apache=../apache_1.3.x&lt;br /&gt;8.  make&lt;br /&gt;9.  make install&lt;br /&gt;&lt;br /&gt;10. cd ../apache_1.3.x&lt;br /&gt;&lt;br /&gt;11. ./configure --prefix=/www --activate-module=src/modules/php5/libphp5.a&lt;br /&gt;    (The above line is correct! Yes, we know libphp5.a does not exist at this&lt;br /&gt;    stage. It isn't supposed to. It will be created.)&lt;br /&gt;&lt;br /&gt;12. make&lt;br /&gt;    (you should now have an httpd binary which you can copy to your Apache bin dir if&lt;br /&gt;    it is your first install then you need to "make install" as well)&lt;br /&gt;&lt;br /&gt;13. cd ../php-5.x.y&lt;br /&gt;14. cp php.ini-dist /usr/local/lib/php.ini&lt;br /&gt;&lt;br /&gt;15. You can edit /usr/local/lib/php.ini file to set PHP options.&lt;br /&gt;    Edit your httpd.conf or srm.conf file and add:&lt;br /&gt;    AddType application/x-httpd-php .php&lt;br /&gt;&lt;br /&gt;      Note: Replace php-5 by php-4 and php5 by php4 in PHP 4. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Depending on your Apache install and Unix variant, there are many possible ways to stop and restart the server. Below are some typical lines used in restarting the server, for different apache/unix installations. You should replace /path/to/ with the path to these applications on your systems. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example#3 Example commands for restarting Apache&lt;br /&gt;&lt;br /&gt;1. Several Linux and SysV variants:&lt;br /&gt;/etc/rc.d/init.d/httpd restart&lt;br /&gt;&lt;br /&gt;2. Using apachectl scripts:&lt;br /&gt;/path/to/apachectl stop&lt;br /&gt;/path/to/apachectl start&lt;br /&gt;&lt;br /&gt;3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:&lt;br /&gt;/path/to/httpsdctl stop&lt;br /&gt;/path/to/httpsdctl start&lt;br /&gt;&lt;br /&gt;4. Using mod_ssl, or another SSL server, you may want to manually&lt;br /&gt;stop and start:&lt;br /&gt;/path/to/apachectl stop&lt;br /&gt;/path/to/apachectl startssl&lt;br /&gt;&lt;br /&gt;The locations of the apachectl and http(s)dctl binaries often vary. If your system has locate or whereis or which commands, these can assist you in finding your server control programs. &lt;br /&gt;&lt;br /&gt;Different examples of compiling PHP for apache are as follows: &lt;br /&gt;&lt;br /&gt;./configure --with-apxs --with-pgsql&lt;br /&gt;&lt;br /&gt;This will create a libphp5.so (or libphp4.so in PHP 4) shared library that is loaded into Apache using a LoadModule line in Apache's httpd.conf file. The PostgreSQL support is embedded into this library. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;./configure --with-apxs --with-pgsql=shared&lt;br /&gt;&lt;br /&gt;This will create a libphp4.so shared library for Apache, but it will also create a pgsql.so shared library that is loaded into PHP either by using the extension directive in php.ini file or by loading it explicitly in a script using the dl() function. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;./configure --with-apache=/path/to/apache_source --with-pgsql&lt;br /&gt;&lt;br /&gt;This will create a libmodphp5.a library, a mod_php5.c and some accompanying files and copy this into the src/modules/php5 directory in the Apache source tree. Then you compile Apache using --activate-module=src/modules/php5/libphp5.a and the Apache build system will create libphp5.a and link it statically into the httpd binary (replace php5 by php4 in PHP 4). The PostgreSQL support is included directly into this httpd binary, so the final result here is a single httpd binary that includes all of Apache and all of PHP. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;./configure --with-apache=/path/to/apache_source --with-pgsql=shared&lt;br /&gt;&lt;br /&gt;Same as before, except instead of including PostgreSQL support directly into the final httpd you will get a pgsql.so shared library that you can load into PHP from either the php.ini file or directly using dl(). &lt;br /&gt;&lt;br /&gt;When choosing to build PHP in different ways, you should consider the advantages and drawbacks of each method. Building as a shared object will mean that you can compile apache separately, and don't have to recompile everything as you add to, or change, PHP. Building PHP into apache (static method) means that PHP will load and run faster.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3024699258456318242?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3024699258456318242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3024699258456318242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3024699258456318242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3024699258456318242'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/installation-of-php-on-unix-systems.html' title='Installation of PHP on Unix systems'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3404388363818591123</id><published>2008-03-30T21:38:00.000+05:30</published><updated>2008-03-30T21:41:51.358+05:30</updated><title type='text'>PHP</title><content type='html'>What is PHP?&lt;br /&gt;&lt;br /&gt;PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Simple answer, but what does that mean? An example: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example#1 An introductory example&lt;br /&gt;&lt;br /&gt;&lt;html&gt;&lt;br /&gt;    &lt;head&gt;&lt;br /&gt;        &lt;title&gt;Example&lt;/title&gt;&lt;br /&gt;    &lt;/head&gt;&lt;br /&gt;    &lt;body&gt;&lt;br /&gt;&lt;br /&gt;        &lt;?php &lt;br /&gt;        echo "Hi, I'm a PHP script!"; &lt;br /&gt;        ?&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/body&gt;&lt;br /&gt;&lt;/html&gt; &lt;br /&gt;&lt;br /&gt;Notice how this is different from a script written in other languages like Perl or C -- instead of writing a program with lots of commands to output HTML, you write an HTML script with some embedded code to do something (in this case, output some text). The PHP code is enclosed in special start and end tags that allow you to jump into and out of "PHP mode". &lt;br /&gt;&lt;br /&gt;What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server. If you were to have a script similar to the above on your server, the client would receive the results of running that script, with no way of determining what the underlying code may be. You can even configure your web server to process all your HTML files with PHP, and then there's really no way that users can tell what you have up your sleeve. &lt;br /&gt;&lt;br /&gt;The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer. Don't be afraid reading the long list of PHP's features. You can jump in, in a short time, and start writing simple scripts in a few hours.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3404388363818591123?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3404388363818591123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3404388363818591123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3404388363818591123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3404388363818591123'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/php.html' title='PHP'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-6821037333537119661</id><published>2008-03-30T21:32:00.000+05:30</published><updated>2008-03-30T21:37:52.484+05:30</updated><title type='text'>Installing SquirrelMail on Unix and Linux systems</title><content type='html'>This chapter covers installation of SquirrelMail on generic Unix or Linux system. It does not cover installation of operating system or tools required to install web server or PHP.&lt;br /&gt;&lt;br /&gt;Any version numbers used in examples are specific to the time when this documentation is written. If current version numbers differ, make sure that you are not using old, obsolete or vulnerable software.&lt;br /&gt;&lt;br /&gt;Guide uses UW IMAP server as example. This IMAP server can be used in generic email setup when incoming mail is stored in /var/spool/mail directory. If you are planning to use webmail with big number of users or with bigger mailboxes, consider using different IMAP server and redesign entire email system.&lt;br /&gt;&lt;br /&gt;Download required software&lt;br /&gt;You will need: &lt;br /&gt;&lt;br /&gt;Apache - http://httpd.apache.org/download.cgi &lt;br /&gt;PHP - http://php.net/downloads.php &lt;br /&gt;UW IMAP - http://www.washington.edu/imap/ &lt;br /&gt;SquirrelMail - http://squirrelmail.org/download.php &lt;br /&gt;&lt;br /&gt;# install -d /usr/local/src/downloads&lt;br /&gt;# cd /usr/local/src/downloads&lt;br /&gt;# wget http://some-apache-mirror-server/apache/httpd/httpd-2.0.54.tar.gz&lt;br /&gt;# wget http://some-php-mirror-server/get/php-4.3.11.tar.bz2/from/this/mirror&lt;br /&gt;# wget ftp://ftp.cac.washington.edu/mail/imap.tar.Z&lt;br /&gt;# wget http://some-sourceforge-mirror/some-path/squirrelmail-1.4.5.tar.bz2&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Unpack and install apache&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;# cd /usr/local/src&lt;br /&gt;# tar -xzvf /usr/local/src/downloads/httpd-2.0.54.tar.gz&lt;br /&gt;# cd httpd-2.0.54&lt;br /&gt;# ./configure --prefix=/usr/local/apache --enable-module=so&lt;br /&gt;# make&lt;br /&gt;# make install&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Unpack and install php&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;# cd /usr/local/src&lt;br /&gt;# tar --bzip2 -xvf /usr/local/src/downloads/php-4.3.11.tar.bz2&lt;br /&gt;# cd php-4.3.11&lt;br /&gt;# ./configure --prefix=/usr/local/php \&lt;br /&gt;&gt; --with-apxs2=/usr/local/apache/bin/apxs&lt;br /&gt;# &lt;strong&gt;make&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;# make install&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you configure PHP compilation with --disable-all option, you must add --enable-session and --with-pcre-regex options.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Add PHP support to apache&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;IfModule mod_php4.c&gt;&lt;br /&gt;  AddType application/x-httpd-php .php&lt;br /&gt;&lt;/IfModule&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Restart apache and check if php is working&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;/usr/local/apache/bin/apachectl graceful&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php phpinfo(); ?&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Unpack and install imap server&lt;/strong&gt;&lt;br /&gt;Unpack UW IMAP archive&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;# cd /usr/local/src&lt;br /&gt;# tar -xzvf /usr/local/src/downloads/imap.tar.Z&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Compile UW IMAP&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;cd /usr/local/src/imap-&lt;someversion&gt;&lt;br /&gt;make port-name EXTRADRIVERS='' SSLTYPE=unix&lt;br /&gt;&lt;br /&gt;Replace port-name with name that matches your system. Check Makefile for possible values. If you haven't installed OpenSSL libraries and headers, use SSLTYPE=none instead of SSLTYPE=unix.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Install IMAP server binary &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;strip imapd/imapd&lt;br /&gt;install -d /usr/local/libexec/&lt;br /&gt;cp imapd/imapd /usr/local/libexec/&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Enable IMAP server in inetd.conf &lt;/strong&gt;&lt;br /&gt;imap2 stream tcp nowait root /usr/sbin/tcpd /usr/local/libexec/imapd&lt;br /&gt;&lt;br /&gt;Restart inetd&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Prepare SquirrelMail directories&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;# mkdir /usr/local/squirrelmail&lt;br /&gt;# cd /usr/local/squirrelmail&lt;br /&gt;# mkdir data temp&lt;br /&gt;# chgrp nogroup data temp&lt;br /&gt;# chmod 0730 data temp&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Unpack SquirrelMail&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;# cd /usr/local/squirrelmail&lt;br /&gt;# tar --bzip2 -xvf /usr/local/src/downloads/squirrelmail-1.4.5.tar.bz2&lt;br /&gt;# mv squirrelmail-1.4.5 www&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configure SquirrelMail&lt;/strong&gt;&lt;br /&gt;Start SquirrelMail configuration utility. Configure SquirrelMail with UW preset. Set data and attachment directories.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configure access to SquirrelMail in Apache&lt;/strong&gt;&lt;br /&gt;Modify httpd.conf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Alias /squirrelmail /usr/local/squirrelmail/www&lt;br /&gt;&lt;Directory /usr/local/squirrelmail/www&gt;&lt;br /&gt;  Options Indexes&lt;br /&gt;  AllowOverride none&lt;br /&gt;  DirectoryIndex index.php&lt;br /&gt;  Order allow,deny&lt;br /&gt;  allow from all&lt;br /&gt;&lt;/Directory&gt;&lt;br /&gt;&lt;br /&gt;Log into SquirrelMail&lt;br /&gt;After you add alias to SquirrelMail in apache configuration and restart apache, you should be able to access SquirrelMail by going to &lt;strong&gt;http://your-server/squirrelmail&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-6821037333537119661?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/6821037333537119661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=6821037333537119661' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6821037333537119661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6821037333537119661'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/installing-squirrelmail-on-unix-and.html' title='Installing SquirrelMail on Unix and Linux systems'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-7639686639100978955</id><published>2008-03-30T21:28:00.000+05:30</published><updated>2008-03-30T21:32:08.439+05:30</updated><title type='text'>SquirrelMail</title><content type='html'>SquirrelMail is a standards-based webmail package written in PHP. It includes built-in pure PHP support for the IMAP and SMTP protocols, and all pages render in pure HTML 4.0 (with no JavaScript required) for maximum compatibility across browsers. It has few requirements and is easy to configure and install. SquirrelMail has all the functionality you would want from an email client, including strong MIME support, address books, and folder manipulation.&lt;br /&gt;&lt;br /&gt;This manual supports SquirrelMail 1.4.0 and up. The 1.2.x series has been obsoleted, and is only referenced in the upgrading notes of this manual.&lt;br /&gt;&lt;br /&gt;There are only two requirements for SquirrelMail: &lt;br /&gt;&lt;br /&gt;A web server with PHP installed. PHP needs to be at least 4.1.0. &lt;br /&gt;Access to an IMAP server which supports IMAP 4 rev 1. &lt;br /&gt;&lt;br /&gt;It doesn't really matter what OS or web server you use, as long as the combination thereof supports PHP in a stable way. Read the instructions and suggestions in the PHP documentation to see what they recommend.&lt;br /&gt;&lt;br /&gt;If you're building your mail system from scratch, it might be a good idea to install and test all components one by one. If you install everything at once and things don't work, the troubleshoting will be more complex. If the web server doesn't work there's not much point in trying to install PHP, for instance. Make sure that everything is working before trying to install SquirrelMail.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Choosing an IMAP server&lt;/strong&gt;&lt;br /&gt;You don't actually have to run an IMAP server yourself, but you need to be able to connect to one for SquirrelMail to work. Since IMAP is an open standard, all IMAP products should be able to communicate with each other. SquirrelMail requires that the server supports IMAP 4 rev 1, but that's the only requirement there is.&lt;br /&gt;&lt;br /&gt;Some IMAP servers support various extensions, which are developed as a complement to IMAP. Those extensions aren't required by SquirrelMail, but many of them are supported. It's recommended to have an IMAP server that supports SORT and THREAD if possible. The SORT extension allows for server side sorting, which is a lot more efficient than having to rely on PHP for sorting. This will improve SquirrelMail's performance. If the server doesn't support the THREAD extension, SquirrelMail can't show mail conversation as threads.&lt;br /&gt;&lt;br /&gt;If possible, the IMAP server should support Unicode. Without it some translations might be unable to use sorting and threading. Courier IMAP must be compiled with the --enable-unicode option to have Unicode support.&lt;br /&gt;&lt;br /&gt;SquirrelMail doesn't care about how the server stores the mails, but it's generally a good idea not to have an IMAP server that store mails in the mailbox (mbox) format. Mailbox performance is low when there are many mails in the same folder and it doesn't allow both mails and subfolders at the same time in the same folder.&lt;br /&gt;&lt;br /&gt;Another good idea is to have an IMAP server that allows the use of virtual accounts. Virtual users don't have to be system users, which usually is a good thing. Again, this is not a SquirrelMail requirement, but something that you might want to consider when choosing an IMAP server.&lt;br /&gt;&lt;br /&gt;Some systems are delivered with an IMAP server, but if it doesn't measure up to the suggestions above, you might want to replace it. There are plenty of IMAP servers at the market, so it might be difficult to decide which one to choose. It is also difficult to recommend something, since every organization has unique demands. The IMAP Connection has a searchable database of IMAP servers, as well as more information about IMAP, but that list may not cover the entire market. There are also several sites offering advice and opinions on this matter. Read them, but make your own decision since the information at some of those sites might be outdated or biased. Remember that some of the open source alternatives are well matured products that can compete, and even surpass, the commercial servers.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configuring PHP&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Without the PHP gettext extension you lose in performance. &lt;br /&gt;The PHP mbstring extension is required for translations that use multibyte or character sets but ISO-8859-1. Without the PHP mbstring extension the interface will remain usable, but some internationalization features and fixes won't be enabled. It's a must if you want to read and write Japanese emails, and users who whish to do that must also set their language option to Japanese. &lt;br /&gt;The PHP XML extension is required if the DIGEST-MD5 authentication is used. &lt;br /&gt;&lt;br /&gt;1.2 Optional server programs &lt;br /&gt;&lt;br /&gt;Perl. SquirrelMail is shipped with some Perl scripts. One of the most useful is config/conf.pl, which will help you configure your SquirrelMail installation. &lt;br /&gt;An SQL database supported by the PEAR DB library, and the PEAR DB library itself. See Using database backends for more information. &lt;br /&gt;Aspell or Ispell to be able to use the SquirrelSpell plugin. &lt;br /&gt;&lt;br /&gt;These are not a must have, since SquirrelMail will function without them, but they are adding to the experience so you might want to consider them.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Directory layout in squirrelMail&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;SquirrelMail files are split into subdirectories according to file type and provided functions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;squirrelmail/&lt;br /&gt;  class/&lt;br /&gt;  config/&lt;br /&gt;  contrib/&lt;br /&gt;  data/&lt;br /&gt;  doc/&lt;br /&gt;  functions/&lt;br /&gt;    decode/&lt;br /&gt;    encode/&lt;br /&gt;  help/&lt;br /&gt;  images/&lt;br /&gt;  locale/&lt;br /&gt;  plugins/&lt;br /&gt;  po/&lt;br /&gt;  src/&lt;br /&gt;  templates/&lt;br /&gt;  themes/&lt;br /&gt;    css/&lt;br /&gt;&lt;br /&gt;class directory stores various classes used with mime messages, email delivery, localizations and other interface functions.&lt;br /&gt;&lt;br /&gt;config directory stores SquirrelMail configuration files and configuration utility. conf.pl script is a perl based utility used to manage SquirrelMail configuration. The config_default.php file stores default configuration values. The config.php file stores current configuration. The file config_local.php can store local site configuration overrides and configuration options that are not supported by configuration utility. default_pref stores default user preferences that are used when a new user logs in for the first time. default_pref file was stored in the data directory before SquirrelMail 1.5.1.&lt;br /&gt;&lt;br /&gt;The contrib directory stores files that provide extra features to SquirrelMail package, but are not used directly in the webmail interface.&lt;br /&gt;&lt;br /&gt;The data directory is default location for SquirrelMail users' preference files. You should move that directory outside of web tree or make sure that it can't be accessed by external users. This directory is not packaged anymore since SquirrelMail 1.5.1.&lt;br /&gt;&lt;br /&gt;The doc directory stores some documentation about SquirrelMail.&lt;br /&gt;&lt;br /&gt;functions directory stores SquirrelMail function files. The decode subdirectory stores charset decoding functions that are used to read emails encoded in different charsets. The encode directory stores charset encoding functions that are used to convert emails to charset used in interface when user replies or forwards email written in different charset.&lt;br /&gt;&lt;br /&gt;Under help are SquirrelMail help files. Information from these files is displayed when a user clicks on Help link in SquirrelMail menu line. Help files use XML formating. They can be translated into different languages.&lt;br /&gt;&lt;br /&gt;The images directory stores various image files that can be used in interface.&lt;br /&gt;&lt;br /&gt;The locale directory stores SquirrelMail translations. A user can select their preferred translation in SquirrelMail Display Options.&lt;br /&gt;&lt;br /&gt;The plugins directory stores plugins that can be used to extend SquirrelMail functionality. Activation of plugins is controlled through the SquirrelMail configuration utility. Some plugins might also use their own configuration files or functions provided by other plugins. See README and INSTALL files in each plugin's directory.&lt;br /&gt;&lt;br /&gt;The po directory stores scripts that are used to work with SquirrelMail translation files. xgetpo script extracts translatable strings from SquirrelMail script. mergepo script combines default strings with selected translation. compilepo script compiles selected translation. These scripts are usually used only by SquirrelMail translators.&lt;br /&gt;&lt;br /&gt;The src directory stores scripts that are used when user accesses the webmail interface.&lt;br /&gt;&lt;br /&gt;The templates directory stores template files that can be used in SquirrelMail 1.5.1 and later versions.&lt;br /&gt;&lt;br /&gt;The themes directory stores SquirrelMail colour themes, and the css subdirectory stores style sheet files available to end user.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;User data storage &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SquirrelMail stores users' preferences and address books in simple text files. The location of these files is set with the data directory setting in the SquirrelMail configuration. SquirrelMail can also use a database or some other storage facility (if the required backend is provided by a plugin) for managing user preferences.&lt;br /&gt;&lt;br /&gt;Users' preferences are stored in .pref files. Address books are stored in .abook files. .sig and .si&lt;somenumber&gt; files store users' signatures. Some plugins might use other files to store users' data.&lt;br /&gt;&lt;br /&gt;When the number of files in the data directory becomes somewhat large, directory access time can be affected. In such cases, the administrator can split preference files into subdirectories by enabling directory hashing in the SquirrelMail configuration.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configuration utility &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SquirrelMail can be configured with conf.pl, a Perl script that is stored in the config/ directory. You can start it by running the configure script in the SquirrelMail base directory or by running the conf.pl script in the config directory.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# cd /path/to/squirrelmail&lt;br /&gt;# cd config&lt;br /&gt;# ./conf.pl&lt;br /&gt;&lt;br /&gt;This configuration utility provides menu based configuration options: &lt;br /&gt;&lt;br /&gt;SquirrelMail Configuration : Read: config_default.php (1.4.0)&lt;br /&gt;---------------------------------------------------------&lt;br /&gt;Main Menu --&lt;br /&gt;1.  Organization Preferences&lt;br /&gt;2.  Server Settings&lt;br /&gt;3.  Folder Defaults&lt;br /&gt;4.  General Options&lt;br /&gt;5.  Themes&lt;br /&gt;6.  Address Books&lt;br /&gt;7.  Message of the Day (MOTD)&lt;br /&gt;8.  Plugins&lt;br /&gt;9.  Database&lt;br /&gt;10. Languages&lt;br /&gt;&lt;br /&gt;D.  Set pre-defined settings for specific IMAP servers&lt;br /&gt;&lt;br /&gt;C   Turn color on&lt;br /&gt;S   Save data&lt;br /&gt;Q   Quit&lt;br /&gt;&lt;br /&gt;Command &gt;&gt;&lt;br /&gt;&lt;br /&gt;Menu is controlled by entering numbers or letters that are listed on the left side.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The address book format &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;By default SquirrelMail stores address books in files, one per address book, named [user account name].abook. These address book files are kept in the data directory. Address books can also be stored in a database or, if the required functions are provided by a plugin, another storage facility. SquirrelMail can also be configured to lookup addresses in LDAP directories, if the PHP installation contains LDAP support.&lt;br /&gt;&lt;br /&gt;An address book file contains five fields, which are delimited by the vertical line (|): the first field stores nicknames, short names that are used to identify address book entries; the second field stores names; the third field stores surnames; the forth field stores mail addresses; and the fifth field stores additional information.&lt;br /&gt;&lt;br /&gt;Additional address book fields and functions can be provided by the experimental vcard address book format and some address book plugins. You can find list of address book plugins at the SquirrelMail site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-7639686639100978955?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/7639686639100978955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=7639686639100978955' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7639686639100978955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7639686639100978955'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/squirrelmail.html' title='SquirrelMail'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-2960020294662161580</id><published>2008-03-30T21:10:00.000+05:30</published><updated>2008-03-30T21:13:20.053+05:30</updated><title type='text'>squint</title><content type='html'>squint is a Squid proxy log analyzer that generates a detailed report of who is spending the most time and resources browsing the Internet. The top offenders in terms of data transfer, number of files transferred, and on-line time are reported&lt;br /&gt;&lt;br /&gt;squint is useful for discovering problems with internet usage patterns. To determine on-line time, it is guesstimated that after a "hit" the person is reading the page for the following two minutes. So the measurement of on-line time is unreliable, but the system does provide a warning that investigation may be warranted&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-2960020294662161580?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/2960020294662161580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=2960020294662161580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/2960020294662161580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/2960020294662161580'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/squint.html' title='squint'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-7891806993003439594</id><published>2008-03-30T21:07:00.001+05:30</published><updated>2008-03-30T21:07:31.406+05:30</updated><title type='text'>What is 'Content Filtering'?</title><content type='html'>Your normal web filter such as Cyber Patrol, squidGuard, Net Nanny, etc, has a very large list of bad sites. If you try to go to these sites you will get blocked. I.e. your web access is filtered by web address. &lt;br /&gt;&lt;br /&gt;The web is a fast changing place and even large web search engines such as Google or Altavista or Yahoo don't even know of half of it. This makes filtering by web address (URL) difficult as sites change and new ones come up all the time. It is impossible to have comprehensive filtering using just URLs. What is needed is something to check every page you (or your children) ever access for 'bad' subjects such as drugs, profanities, hate, pornography, etc, and disallow it if it's not suitable. This is called 'Content Filtering'. &lt;br /&gt;&lt;br /&gt;This is why you need DansGuardian as it makes the web a cleaner, safer, place for you and your children. &lt;br /&gt;&lt;br /&gt;As a side effect, DansGuardian also helps maintain freedom of speech by moving the censoring to the choice of the individual rather than imposing a specific ideal on the whole world.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-7891806993003439594?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/7891806993003439594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=7891806993003439594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7891806993003439594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7891806993003439594'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/what-is-content-filtering.html' title='What is &apos;Content Filtering&apos;?'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-389973947331148684</id><published>2008-03-30T21:01:00.000+05:30</published><updated>2008-03-30T21:05:49.987+05:30</updated><title type='text'>DansGuardian</title><content type='html'>DansGuardian is an award winning web content filtering proxy(1) for Linux, FreeBSD, OpenBSD, NetBSD, Mac OS X, HP-UX, and Solaris that uses Squid(2) to do all the fetching. It filters using multiple methods. These methods include URL and domain filtering, content phrase filtering, PICS filtering, MIME filtering, file extension filtering, POST limiting.&lt;br /&gt;The content phrase filtering will check for pages that contain profanities and phrases often associated with pornography and other undesirable content. The POST filtering allows you to block or limit web upload. The URL and domain filtering is able to handle huge lists and is significantly faster than squidGuard.&lt;br /&gt;The filtering has configurable domain, user and source ip exception lists. SSL Tunneling is supported. &lt;br /&gt;The configurable logging produces a log in an easy to read format which has the option to only log the text-based pages, thus significantly reducing redundant information such as every image on a page. &lt;br /&gt;Pretty much all parts of DansGuardian are configurable thus giving the end administrator user total control over what is filtered and not some third-party company. &lt;br /&gt;(1) Technically DansGuardian is more of a filtering pass-through than a true proxy - but don't let that worry you! &lt;br /&gt;&lt;br /&gt;(2) DansGuardian should work with any proxy, not just Squid. For example, it is known to work with Oops&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The main features of DansGuardian are as follows&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*Significantly cheaper than IGear (one of the best commercial filters). &lt;br /&gt;*Can block adverts by the use of an advert URL block list. &lt;br /&gt;*Can filter text and HTML pages for obscene (sexual, racial, violent, etc) content. &lt;br /&gt;*Uses an advanced phrase weighting system to reduce over or under blocking. &lt;br /&gt;*Can filter sites using the PICS labeling system. &lt;br /&gt;*Can filter according to MIME type and file extension. &lt;br /&gt;*Can filter according to URLs including Regular Expression URLs. &lt;br /&gt;*URL filtering is compatible with squidGuard black lists. &lt;br /&gt;*The URL filtering is able to filter https requests. &lt;br /&gt;*Can work in a 'whitelist' mode where all sites except those listed are blocked. &lt;br /&gt;*Can block all IP based URLs. &lt;br /&gt;*Is able to block sites when users try using the IP address of the site instead. &lt;br /&gt;*Produces a log in a very human readable format. &lt;br /&gt;*Optionally produces a log in CSV format for easy import into databases etc. &lt;br /&gt;*Is able to log the username using either Ident or basic proxy authentication. &lt;br /&gt;*It has the ability to switch off filtering for specified sites, parts of sites, browser IPs and usernames. &lt;br /&gt;*Can block specified source IPs and usernames. &lt;br /&gt;*Can block or limit web uploading (e.g. attachments in Hotmail). &lt;br /&gt;*Has the ability to work in a stealth mode where it logs sites that would have been blocked, but does not block them. This allows you to monitor your users without them knowing. &lt;br /&gt;*Uses a very intelligent algorithm to match phrases in web pages mixed in with HTML code and white space. &lt;br /&gt;*Big5, Unicode and top-bit set characters can be used in search phrases. &lt;br /&gt;*URL filtering is significantly faster than squidGuard. &lt;br /&gt;*The configuration lists use the same incredibly fast code that allows them all to be hundreds of thousands of entries long. &lt;br /&gt;*100% C++ and can compile on GCC 3. &lt;br /&gt;*Can be made to re-read config files with a HUP signal. &lt;br /&gt;*Works perfectly in conjunction with Squid and Oops. Also see this important information. &lt;br /&gt;*Has no 3rd party library requirements (no nb++ as was used in version 1) so can be installed much easier and so is also provided as an RPM. &lt;br /&gt;*Supports (adds) the squid X-Forwarded-For header line. &lt;br /&gt;*Supports compressed (Content-Encoding gzip and deflate) HTML. &lt;br /&gt;*Can be made to only listen on 1 IP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-389973947331148684?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/389973947331148684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=389973947331148684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/389973947331148684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/389973947331148684'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/dansguardian.html' title='DansGuardian'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-5322464681032922003</id><published>2008-03-29T22:06:00.000+05:30</published><updated>2008-03-29T22:11:35.055+05:30</updated><title type='text'>Linux Commands</title><content type='html'>&lt;strong&gt;UNIX Commands&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Login and Exit&lt;/strong&gt;&lt;br /&gt;yppasswd          Change password&lt;br /&gt;rlogin machine    Log into a remote machine&lt;br /&gt;telnet machine    Log into a remote machine&lt;br /&gt;exit              End a shell session&lt;br /&gt;Ctrl-D            End shell session&lt;br /&gt;logout            Log out of remote session&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Help&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;man command Describes the command&lt;br /&gt;&lt;strong&gt;man -k keyword&lt;/strong&gt; Search for keyword&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Display directory listing&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ls Display directory listing&lt;br /&gt;ls -l Display access permissions&lt;br /&gt;ls -a Display hidden files&lt;br /&gt;ls -d Display directory&lt;br /&gt;ls -t Display files sorted by time&lt;br /&gt;ls dir Display contents of directory&lt;br /&gt;ls file Display file&lt;br /&gt;ls ???* Display all files with more than 3 characters in name&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Change, Create, Remove Directories&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;pwd Display current directory&lt;br /&gt;cd Change to your home directory&lt;br /&gt;cd .. Change to parent directory&lt;br /&gt;cd dir Change to another directory&lt;br /&gt;mkdir dir Create a new directory&lt;br /&gt;rmdir dir Remove a directory (must be empty)&lt;br /&gt;rm -r dir Remove a directory and everything within it&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Create, Copy, Move, Delete Files&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;touch file Create an empty file&lt;br /&gt;cp src-file dst-file Copy a file to another file&lt;br /&gt;cp src-file dst-dir Copy a file to a directory&lt;br /&gt;cp -r * dst-dir Copy all files and sub-directories to another directory&lt;br /&gt;mv src-file dst-file Move a file to another file (renames file)&lt;br /&gt;mv src-file dst-dir Move a file to another directory&lt;br /&gt;mv src-dir dst-dir Move a directory to another directory&lt;br /&gt;Note: filenames can be up to 255 characters long but should not contain special&lt;br /&gt;characters, e.g., $ * [ ] &amp; &lt; &gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Change file permissions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;chmod o+r file Change file to allow read access to anyone&lt;br /&gt;chown username file Change onwer of file to username&lt;br /&gt;chgrp new-grp file Change group owner of file to new-grp&lt;br /&gt;Note: -rwxr-x--- shows permissions on a regular file to be:&lt;br /&gt;owner=read,write,execute; group=read,execute; others=nothing&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Display Contents of a File&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;cat file Display contents of file&lt;br /&gt;cat -v file Display non-printing characters&lt;br /&gt;head file Display first 10 lines&lt;br /&gt;tail file Display last 10 lines&lt;br /&gt;more file Display file one screen at a time&lt;br /&gt;wc file Count number of words in file&lt;br /&gt;Sort, Compare, Convert, Compress Files&lt;br /&gt;sort file1 &gt; file2 Sort lines in file1 and output to file2&lt;br /&gt;sort -1 -n file1 &gt; file2 Sort by column 1 numerically and output to file2&lt;br /&gt;uniq input-file Remove or report adjacent duplicate lines&lt;br /&gt;unix2dos unx-file dos-file Convert from UNIX to DOS format&lt;br /&gt;dos2unix dos-file unx-file Convert from DOS to UNIX format&lt;br /&gt;cmp file1 file2 Compare byte-by-byte 2 files&lt;br /&gt;diff file1 file2 Compare line by line 2 files&lt;br /&gt;sdiff file1 file2 Compare 2 files by displaying them side by side&lt;br /&gt;compress file Compress a file&lt;br /&gt;gunzip file Uncompress a file&lt;br /&gt;tar cf file.tar . Create a tar archive of current directory&lt;br /&gt;tar xf file.tar Restore tar archive to current directory&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Search for Strings within Files&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;grep string file(s) Display lines containing &lt;em&gt;string&lt;/em&gt; in &lt;em&gt;file(s)&lt;/em&gt;&lt;br /&gt;grep -v string file(s) Display lines that do not contain &lt;em&gt;string&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Printing&lt;/strong&gt;&lt;br /&gt;lp file Print file to default printer&lt;br /&gt;lpr file Print file to default printer&lt;br /&gt;lpstat Check status of printer queue&lt;br /&gt;lpstat -p Check status of all printer queues&lt;br /&gt;lpq Check contents printer queue&lt;br /&gt;lprm job# Remove job from printer queue&lt;br /&gt;lprm - Remove all your jobs from printer queue&lt;br /&gt;lp -Pprinter file Print to a specific printer queue&lt;br /&gt;ls -l | lp Print directory listing&lt;br /&gt;head file | lp Print first 10 lines of file&lt;br /&gt;Redirect Output&lt;br /&gt;cmd | lp Direct cmd output to printer&lt;br /&gt;cmd &gt; file Direct cmd output to file&lt;br /&gt;cmd | tee file Direct output to screen and file&lt;br /&gt;cmd &gt;&gt; file Direct cmd output to end of file&lt;br /&gt;cmd1 | cmd2 Direct cmd1 output to input of cmd2&lt;br /&gt;Conditional Execution&lt;br /&gt;cmd1 &amp;&amp; cmd2 Execute cmd2 only if cmd1 is successful&lt;br /&gt;cmd1 || cmd2 Execute cmd2 only if cmd1 fails&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;BACKGROUND PROCESSES&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Command Effect&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;cmd&amp;  Run job in background&lt;br /&gt;jobs List jobs running in background in current shell session&lt;br /&gt;fg Bring most recent background job into foreground&lt;br /&gt;fg job# Bring job# into foreground&lt;br /&gt;bg Put job into background&lt;br /&gt;bg job# Put job# into background&lt;br /&gt;Ctrl-z Suspend current job and put it in background (resume with fg or bg)&lt;br /&gt;at timespec cmd&lt;br /&gt;Ctrl-d Execute commands at a specified time&lt;br /&gt;batch cmd Ctrl-d Execute commands in the batch queue&lt;br /&gt;atq Display jobs running in at and batch queues&lt;br /&gt;atrm job# Remove job from at or batch queue&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Checking Processes&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ps Display current shell processes&lt;br /&gt;ps -ef Display all processes&lt;br /&gt;ps -ef | grep username Display all processes for a user&lt;br /&gt;kill -9 PID Stop a process&lt;br /&gt;Disk Space, User and Environment Information&lt;br /&gt;du -sk Display disk space of current directory in 1024k blocks&lt;br /&gt;du -sk dir Display disk space of dir in 1024k blocks&lt;br /&gt;df -k Display data for mounted file systems&lt;br /&gt;env Display environment variable settings&lt;br /&gt;setenv ENV-VAR XXX Set an environment variable&lt;br /&gt;alias Display all defined aliases&lt;br /&gt;umask Display current default file protection mask&lt;br /&gt;whoami Display your username&lt;br /&gt;id Display your user and group ids&lt;br /&gt;users Display users logged in&lt;br /&gt;groups Display which groups you belong to&lt;br /&gt;w Display who is logged in and what they are doing&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-5322464681032922003?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/5322464681032922003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=5322464681032922003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5322464681032922003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5322464681032922003'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/linux-commands.html' title='Linux Commands'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-8013869630508954044</id><published>2008-03-29T21:58:00.000+05:30</published><updated>2008-03-29T22:01:28.345+05:30</updated><title type='text'>RAID</title><content type='html'>&lt;strong&gt;1. What is RAID &lt;/strong&gt;&lt;br /&gt;                  &lt;br /&gt;   &lt;br /&gt;* The basic idea behind RAID is to combine multiple small, inexpensive &lt;br /&gt;  disk drives into an array to accomplish performance or redundancy goals not &lt;br /&gt;  attainable with one large and expensive drive. &lt;br /&gt;&lt;br /&gt;* This array of drives will appear to the computer as a single logical storage &lt;br /&gt;  unit or drive. &lt;br /&gt;&lt;br /&gt;* RAID is a method in which information is spread across several disks, using &lt;br /&gt;  techniques such as :&lt;br /&gt;&lt;br /&gt;        * Disk Striping (RAID Level 0)  [no redundancy,no FT]&lt;br /&gt;        * Disk Mirroring (RAID level 1) [redundancy,with FT]&lt;br /&gt; * disk striping with parity on single disk (RAID Level 4) Not Supported&lt;br /&gt; * disk striping with parity across disks (RAID Level 5) &lt;br /&gt; * Linear RAID&lt;br /&gt;&lt;br /&gt;  to achieve redundancy, lower latency and/or increase bandwidth for reading or &lt;br /&gt;  writing to disks, and maximize the ability to recover from hard disk crashes. &lt;br /&gt;&lt;br /&gt;* The underlying concept of RAID is that data may be distributed across each &lt;br /&gt;  drive in the array in a consistent manner. &lt;br /&gt;&lt;br /&gt;* To do this, the data must first be broken into consistently-sized chunks &lt;br /&gt;  or strips (often 32K or 64K in size, although different sizes can be used). &lt;br /&gt;&lt;br /&gt;* Each chunk is then written to a hard drive in RAID according to the RAID level&lt;br /&gt;  used. &lt;br /&gt;&lt;br /&gt;* When the data is to be read, the process is reversed, giving the illusion&lt;br /&gt;  that multiple drives are actually one large drive. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Who Should Use RAID &lt;/strong&gt;&lt;br /&gt;                           &lt;br /&gt;&lt;br /&gt;* Anyone who needs to keep large quantities of data on hand &lt;br /&gt;  (such as a sysadmin) would benefit by using RAID technology. &lt;br /&gt;&lt;br /&gt;* The Primary reasons to use RAID include: &lt;br /&gt;&lt;br /&gt;          * Enhanced speed&lt;br /&gt;&lt;br /&gt;          * Increased storage capacity using a single virtual disk&lt;br /&gt;&lt;br /&gt;          * Lessened impact of a disk failure&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Hardware RAID versus Software RAID&lt;/strong&gt; &lt;br /&gt;                   &lt;br /&gt;&lt;br /&gt;* There are two possible RAID approaches: Hardware RAID and Software RAID. &lt;br /&gt;&lt;br /&gt;                               Hardware RAID&lt;br /&gt;&lt;br /&gt;* H/W systems manages the RAID subsystem independently from &lt;br /&gt;  the host and presents to the host only a single disk per RAID array. &lt;br /&gt;&lt;br /&gt;* An example of a Hardware RAID device would be one that connects to a SCSI &lt;br /&gt;  controller and presents the RAID arrays as a single SCSI drive. &lt;br /&gt;&lt;br /&gt;* An external RAID system moves all RAID handling "intelligence" into a &lt;br /&gt;  controller located in the external disk subsystem. &lt;br /&gt;&lt;br /&gt;* The whole subsystem is connected to the host via a normal SCSI controller and &lt;br /&gt;  appears to the host as a single disk. &lt;br /&gt;&lt;br /&gt;* RAID controllers also come in the form of cards that act like a SCSI &lt;br /&gt;  controller to the operating system but handle all of the actual drive &lt;br /&gt;  communications themselves. &lt;br /&gt;&lt;br /&gt;* In these cases, you plug the drives into the RAID controller just like you &lt;br /&gt;  would a SCSI controller, but then you add them to the RAID controller's &lt;br /&gt;  configuration, and the operating system never knows the difference. &lt;br /&gt;&lt;br /&gt;* Many controllers have their own BIOS and can be configured independantly&lt;br /&gt;  of the host computer to which they are attached, just like you use the CMOS&lt;br /&gt;  to configure your system.&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Software RAID&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;* Software RAID implements the various RAID levels in the kernel disk &lt;br /&gt;  (block device) code. It offers the cheapest possible solution, as expensive &lt;br /&gt;  disk controller cards or hot-swap chassis are not required. &lt;br /&gt;&lt;br /&gt;* Software RAID also works with cheaper IDE disks as well as SCSI disks. &lt;br /&gt;  With today's fast CPUs, Software RAID performance can excel against Hardware &lt;br /&gt;  RAID. &lt;br /&gt;&lt;br /&gt;* The MD driver in the Linux kernel is an example of a RAID solution that is &lt;br /&gt;  completely hardware independent. The performance of a software-based array is &lt;br /&gt;  dependent on the server CPU performance and load. &lt;br /&gt;&lt;br /&gt;Software RAID has to offer some  important features: &lt;br /&gt;&lt;br /&gt;        * Threaded rebuild process&lt;br /&gt;        * Kernel-based configuration&lt;br /&gt;        * Portability of arrays between Linux machines without reconstruction&lt;br /&gt;        * Backgrounded array reconstruction using idle system resources&lt;br /&gt;        * Hot-swappable drive support&lt;br /&gt;        * Automatic CPU detection to take advantage of certain CPU &lt;br /&gt;    optimizations &lt;br /&gt;    &lt;br /&gt;Note:  A hot-swap chassis allows you to remove a hard drive without having to &lt;br /&gt;       power-down your system. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. RAID Level 0 [Striping]&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* RAID-0 is also called Striping. In this level two or more Hard Disks are &lt;br /&gt;  combined to appear as one large one to the OS&lt;br /&gt;  &lt;br /&gt;  Example :&lt;br /&gt;  =======&lt;br /&gt;  I have two HDD of 8GB and 20GB. In RAID-0, both are combined and you get a &lt;br /&gt;  combined disk space of 28GB. There is no Data Redudancy and Fault Tolerance.&lt;br /&gt;  If one of the HDD fails, you lose all your data.&lt;br /&gt;&lt;br /&gt;ADVANTAGES &lt;br /&gt;==========&lt;br /&gt;&lt;br /&gt;* One advantage of this is speed since a file is spread [strips] across the &lt;br /&gt;  two disks and can be read twice as fast &lt;br /&gt;  &lt;br /&gt;* Can accomodate very large files &lt;br /&gt;&lt;br /&gt;* Can accomodate disks of unequal sizes. When RAID runs out of space on the&lt;br /&gt;  smaller [8GB] disk, it then continues the striping using the available space &lt;br /&gt;  on the remaining drives. When this occurs, the data access speed is lower for&lt;br /&gt;  this portion of data, because the total number of RAID drives available is &lt;br /&gt;  reduced. For this reason, RAID 0 is best used with drives of equal size.&lt;br /&gt;  &lt;br /&gt;DISADVANTAGES &lt;br /&gt;=============&lt;br /&gt;&lt;br /&gt;* There is no Data Redundancy and Fault Tolerance.  &lt;br /&gt;  If one of the HDD fails, you lose all your data.&lt;br /&gt;&lt;br /&gt;* You could, however, use one HDD too, if you are stupid enough to do that&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;  | Block 1 |                                            | Block 1 |&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;  +---------+                            Physical        +---------+&lt;br /&gt;  | Block 2 |                            Disk 1          | Block 3 |&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;  | Block 3 |            RAID-0                          | Block 5 |&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;                  ==========&gt;            &lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;  | Block 4 |                                            | Block 2 |&lt;br /&gt;  +---------+                            Physical        +---------+&lt;br /&gt;                                         Disk 2&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;  | Block 5 |                                            | Block 4 |&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;  | Block 6 |                                            | Block 6 |&lt;br /&gt;  +---------+                                            +---------+&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;    &lt;br /&gt;5. RAID Level 1 [Mirroring]&lt;/strong&gt;&lt;br /&gt;   &lt;br /&gt;        &lt;br /&gt;* RAID 1, or "mirroring," has been used longer than any other form of RAID.&lt;br /&gt;&lt;br /&gt;* Level 1 provides redundancy by writing identical data to each member disk of &lt;br /&gt;  the array, leaving a "mirrored" copy on each disk. &lt;br /&gt;&lt;br /&gt;* Here you use two hard disks such that both of them contain exactly the same &lt;br /&gt;  information. &lt;br /&gt;  &lt;br /&gt;* In case of failure of one disk, the server will boot through the second disk. &lt;br /&gt;  When the failed disk is replaced, the data is automatically cloned to the new&lt;br /&gt;  disk from the surviving disk. &lt;br /&gt;  &lt;br /&gt;* Level 1 operates with two or more disks that may use parallel access for high&lt;br /&gt;  data-transfer rates when reading but more commonly operate independently to &lt;br /&gt;  provide high I/O transaction rates.&lt;br /&gt;&lt;br /&gt;* RAID 1 also offers the possibility of using a hot standby spare disk that will&lt;br /&gt;  be automatically cloned in the event of a disk failure on any of the primary &lt;br /&gt;  RAID devices.&lt;br /&gt;    &lt;br /&gt;* Mirroring remains popular due to its simplicity and high level of data &lt;br /&gt;  availability. &lt;br /&gt;&lt;br /&gt;ADVANTAGES &lt;br /&gt;==========&lt;br /&gt;&lt;br /&gt;* Offers redundancy and more Fault Tolerance.&lt;br /&gt;&lt;br /&gt;* Provides very good data reliability and improves performance for &lt;br /&gt;  read-intensive applications &lt;br /&gt;     &lt;br /&gt;DISADVANTAGES &lt;br /&gt;=============&lt;br /&gt;&lt;br /&gt;* Total RAID size in GB is equal to that of the smallest disk in the RAID set.&lt;br /&gt;  Unlike RAID 0, the extra space on the larger device isn't used.&lt;br /&gt;  &lt;br /&gt;* RAID 1 offers data redundancy, without the speed advantages of RAID 0. &lt;br /&gt;  The server has to send data twice to be written to each of the mirrored disks.&lt;br /&gt;  This can saturate data busses and CPU use. &lt;br /&gt;  &lt;br /&gt;  With a hardware-based solution, the server CPU sends the data to the RAID &lt;br /&gt;  disk controller once, and the disk controller then duplicates the data to &lt;br /&gt;  the mirrored disks. &lt;br /&gt;  &lt;br /&gt;  This makes RAID-capable disk controllers the preferred solution when &lt;br /&gt;  implementing RAID 1.&lt;br /&gt;&lt;br /&gt;* The storage capacity of the level 1 array is equal to the capacity of one&lt;br /&gt;  of the mirrored hard disks in a Hardware RAID or one of the mirrored &lt;br /&gt;  partitions in a Software RAID. &lt;br /&gt;    &lt;br /&gt;  +---------+                   +---------+                 +---------+&lt;br /&gt;  | Block 1 |                   | Block 1 |                 | Block 1 |&lt;br /&gt;  +---------+    RAID-1         +---------+                 +---------+&lt;br /&gt;  | Block 2 |                   | Block 2 |                 | Block 2 |&lt;br /&gt;  +---------+                   +---------+                 +---------+&lt;br /&gt;  | Block 3 |                   | Block 3 |                 | Block 3 |&lt;br /&gt;  +---------+    ========&gt;      +---------+  ========&gt;      +---------+ &lt;br /&gt;  | Block 4 |                   | Block 4 |                 | Block 4 |&lt;br /&gt;  +---------+                   +---------+                 +---------+&lt;br /&gt;  | Block 5 |                   | Block 5 |                 | Block 5 |&lt;br /&gt;  +---------+                   +---------+                 +---------+&lt;br /&gt;  | Block 6 |                   | Block 6 |                 | Block 6 |&lt;br /&gt;  +---------+                   +---------+                 +---------+&lt;br /&gt;&lt;br /&gt;                               Physical Disk 1             Physical Disk 2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;&lt;strong&gt;6. RAID Level 4 = 0 + 1 w/o parity &lt;/strong&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;* Linux RAID 4 requires a minimum of three disks or partitions and can &lt;br /&gt;  survive the loss of one disk only&lt;br /&gt;&lt;br /&gt;* RAID 4 combines the high speed provided of RAID 0 with the redundancy of &lt;br /&gt;  RAID 1. &lt;br /&gt;  &lt;br /&gt;* Level 4 uses parity concentrated on a single disk drive to protect data.&lt;br /&gt;  RAID 4 operates likes RAID 0 but inserts a special error-correcting or parity&lt;br /&gt;  chunk on an additional disk dedicated to this purpose.&lt;br /&gt;&lt;br /&gt;* Its major disadvantage is that the data is striped, but the parity info is&lt;br /&gt;  not. In other words, any data written to any section of the data portion &lt;br /&gt;  of the RAID set must be followed by an update of the parity disk. The parity&lt;br /&gt;  disk can therefore act as a bottleneck. For this reason, RAID 4 isn't used &lt;br /&gt;  very frequently.&lt;br /&gt;  Because the dedicated parity disk represents an inherent bottleneck, &lt;br /&gt;  level 4 is seldom used without accompanying technologies such as &lt;br /&gt;  write-back caching. &lt;br /&gt;&lt;br /&gt;* RAID 4 requires at least three disks in the RAID set and can survive the loss&lt;br /&gt;  of a single drive only. When this occurs, the data in it can be recreated on&lt;br /&gt;  the fly with the aid of the information on the RAID set's parity disk. When&lt;br /&gt;  the failed disk is replaced, it is re-populated with the lost data with the&lt;br /&gt;  help of the parity disk's information.&lt;br /&gt;&lt;br /&gt;* It is better suited to transaction I/O rather than large file transfers. &lt;br /&gt;&lt;br /&gt;* Although RAID level 4 is an option in some RAID partitioning schemes, it is &lt;br /&gt;  not an option allowed in Red Hat Linux RAID installations. &lt;br /&gt;  &lt;br /&gt;* The storage capacity of Hardware RAID level 4 is equal to the capacity of &lt;br /&gt;  member disks, minus the capacity of one member disk. &lt;br /&gt;  &lt;br /&gt;* The storage capacity of Software RAID level 4 is equal to the capacity of &lt;br /&gt;  the member partitions, minus the size of one of the partitions if they &lt;br /&gt;  are of equal size. &lt;br /&gt;&lt;br /&gt;* RAID 4 is not supported by Fedora Linux.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;strong&gt;7. RAID 5 = 4 with parity &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;          &lt;br /&gt;* Linux RAID 5 requires a minimum of three disks or partitions and can &lt;br /&gt;  survive the loss of one disk only&lt;br /&gt;&lt;br /&gt;* This is the most common type of RAID. By distributing parity across some &lt;br /&gt;  or all of an array's member disk drives, RAID level 5 eliminates the &lt;br /&gt;  write bottleneck inherent in level 4. &lt;br /&gt;  &lt;br /&gt;* The only performance bottleneck is the parity calculation process. With&lt;br /&gt;  modern CPUs and Software RAID, that usually is not a very big problem. &lt;br /&gt;  &lt;br /&gt;* As with level 4, the result is asymmetrical performance, with reads &lt;br /&gt;  substantially outperforming writes. &lt;br /&gt;&lt;br /&gt;* Level 5 is often used with write-back caching to reduce the asymmetry.&lt;br /&gt;&lt;br /&gt;* The storage capacity of Hardware RAID level 5 is equal to the capacity of &lt;br /&gt;  member disks, minus the capacity of one member disk. &lt;br /&gt;  &lt;br /&gt;* The storage capacity of Software RAID level 5 is equal to the capacity &lt;br /&gt;  of the member partitions, minus the size of one of the partitions if they&lt;br /&gt;  are of equal size. &lt;br /&gt;&lt;br /&gt;* RAID 5 improves on RAID 4 by striping the parity data between all the &lt;br /&gt;  disks in the RAID set. This avoids the parity disk bottleneck, whilst&lt;br /&gt;  maintaining many of the speed features of RAID 0 and the redundancy of &lt;br /&gt;  RAID 1. Like RAID 4, RAID 5 can survive the loss of a single disk only.&lt;br /&gt;&lt;br /&gt;* RAID 5 is supported by Fedora Linux. Figure below illustrates the data&lt;br /&gt;  allocation process in RAID 5.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  +---------+    &lt;br /&gt;  | Block 1 |     &lt;br /&gt;  +---------+   &lt;br /&gt;  +---------+        +----------+ +---------+ +-----------------+&lt;br /&gt;  | Block 2 |        | Block 1 | | Block 2 | |ErrChk Blocks 1+2|&lt;br /&gt;  +---------+        +---------+ +---------+ +-----------------+&lt;br /&gt;  +---------+        +----------+-----------+ +---------+ +---------+&lt;br /&gt;  | Block 3 | RAID-5 | ErrChk Blocks 3+4  | | Block 1 | | Block 3 |  &lt;br /&gt;  +---------+        +-Block 3+4----------+ +---------+ +---------+&lt;br /&gt;  +---------+        +---------+ +-------------------+ +---------+&lt;br /&gt;  | Block 4 |        | Block 6 | | ErrChk Blocks 6+5 | | Block 5 |&lt;br /&gt;  +---------+        +---------+ +-------------------+ +---------+&lt;br /&gt;  +---------+        +---------+ +---------+ +------------------+&lt;br /&gt;  | Block 5 |        | Block 7 | | Block 8 | |ErrChk Blocks 7+8 |&lt;br /&gt;  +---------+        +---------+ +---------+ +------------------+&lt;br /&gt;  +---------+           &lt;br /&gt;  | Block 6 |          &lt;br /&gt;  +---------+            &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Linear RAID &lt;/strong&gt;&lt;br /&gt;        &lt;br /&gt;Linear RAID is a simple grouping of drives to create a larger virtual drive. &lt;br /&gt;In linear RAID, the chunks are allocated sequentially from one member drive, &lt;br /&gt;going to the next drive only when the first is completely filled. &lt;br /&gt;          &lt;br /&gt;   This grouping provides no performance benefit, as it is unlikely &lt;br /&gt;that any I/O operations will be split between member drives. Linear RAID also &lt;br /&gt;offers no redundancy and, in fact, decreases reliability if any one member &lt;br /&gt;drive fails, the entire array cannot be used. The capacity is the total of all&lt;br /&gt;member disks. &lt;br /&gt;&lt;br /&gt;Note : RAID level 1 comes at a high cost because you write the same info to &lt;br /&gt;       all of the disks in the array, which wastes drive space. &lt;br /&gt;       For example, if you have RAID level 1 set up so that your &lt;br /&gt;        root (/) partition exists on two 40G drives, you have 80G total but &lt;br /&gt; are only able to access 40G of that 80G. The other 40G acts like a &lt;br /&gt; mirror of the first 40G. &lt;br /&gt; &lt;br /&gt;Note :  Parity information is calculated based on the contents of the rest of &lt;br /&gt;        the member disks in the array. This information can then be used to &lt;br /&gt; reconstruct data when one disk in the array fails. The reconstructed &lt;br /&gt; data can then be used to satisfy I/O requests to the failed disk before&lt;br /&gt; it is replaced and to repopulate the failed disk after it has been &lt;br /&gt; replaced. &lt;br /&gt; &lt;br /&gt;Note :  RAID level 4 takes up the same amount of space as RAID level 5, but &lt;br /&gt;        level 5 has more advantages. For this reason, level 4 is not supported.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-8013869630508954044?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/8013869630508954044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=8013869630508954044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8013869630508954044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8013869630508954044'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/raid.html' title='RAID'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-7534366439119346338</id><published>2008-03-29T21:54:00.000+05:30</published><updated>2008-03-29T21:57:14.687+05:30</updated><title type='text'>Advanced Squid</title><content type='html'>Squid is a free caching proxy server that runs on Linux and many other operating systems. Many Linux users who have used Squid have taken advantage of its simple setup, and ignore or overlook its advanced features. Here's an introduction to some of those features and how to use them. &lt;br /&gt;I'll assume that you have already set up a basic Squid system. If you need help on this, see the "Transparent Proxy with Linux and Squid mini-HOWTO" and the Squid quick start guide. Once you know the basics, you can move on to advanced topics such as access control lists (ACL), proxy authentication schemes, delay pools, and blocking pornography.&lt;br /&gt;&lt;br /&gt;Squid has one primary configuration file, squid.conf. This file is generally located in /etc/squid/, or if you compiled Squid from source, the default location is /usr/local/squid/etc/. You'll be editing this file, so it's wise to make a backup copy of it before you make any changes. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Access control lists &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The primary use of ACLs is to control access, but they can also be used to route requests through a hierarchy, control request rewriting, and manage quality of service.&lt;br /&gt;&lt;br /&gt;Access controls are divided into two parts: elements and rules. ACL elements are things such as IP addresses, port numbers, hostnames, and URL patterns. Each ACL element has a name, which you refer to when writing the access list rules. The basic syntax of an ACL element is:&lt;br /&gt;&lt;br /&gt;ACLname type value1 value2 &lt;br /&gt;&lt;br /&gt;Squid has more than 20 ACL types, including types for source and destination IP addresses, time, URLs, port numbers, and transfer protocols. See the Squid Configuration Manual for a full list of types.&lt;br /&gt;&lt;br /&gt;After defining the ACL elements, the next step is to combine them with Access list rules. Rules combine elements to allow or deny certain actions. The syntax for an access control rule is:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;access_list allow|deny [!]ACLname &lt;br /&gt;For example, the rule: &lt;br /&gt;http_access allow MyClients &lt;br /&gt;&lt;br /&gt;tells Squid to allow access from the host or hosts defined under the name MyClients. The optional exclamation point is a standard negation operator, used to reverse the logic of the ACL. If this seems confusing, the following examples should help.&lt;br /&gt;&lt;br /&gt;Restricting access to local network users &lt;br /&gt;&lt;br /&gt;You should always limit access to your proxy server to local IP addresses, unless you have a specific need to allow external users. This can save you large bandwidth bills, from outsiders using your machine as a proxy. A simple way to do this is to write an ACL that contains your IP address space and then allow HTTP requests for that ACL and deny all others:&lt;br /&gt;&lt;br /&gt;acl All src 0/0 &lt;br /&gt;acl PrivateNet src 192.168.0.0/24 192.168.1.0/24 &lt;br /&gt;http_access allow PrivateNet &lt;br /&gt;http_access deny All &lt;br /&gt;&lt;br /&gt;Squid makes one pass through the configuration file, reading the ACLs and rules in order. This means that you must define an ACL before you make a rule applying it, and the order of the http_access rules is important. Incoming requests are checked in the order in which the rules are written. If the first rule allows the request, the remaining requests are not read. If the first rule blocks the request, Squid passes on to the next one, and so on. Your last http_access line should always be a deny All, so that a request which is not permitted by any of the previous rules is blocked by default. If you change this to allow All, all your rules become meaningless, since Squid will allow the request at the end. The default squid.conf configuration file contains some important access controls. Try not to change these before you understand what they do. When you edit squid.conf for the first time, look for this comment:&lt;br /&gt;&lt;br /&gt;# &lt;br /&gt;# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS &lt;br /&gt;# &lt;br /&gt;&lt;br /&gt;Insert your new rules below this comment, and before the http_access deny All line.&lt;br /&gt;&lt;br /&gt;Blocking specific computers &lt;br /&gt;&lt;br /&gt;It is often necessary to block a particular IP address. At our university, for example, if a student uses excessive bandwidth, we block his computer for a few days. Until you can solve the problem at the source, you can block requests coming to Squid with this configuration:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;acl All src 0/0 &lt;br /&gt;acl PrivateNet src 192.168.0.0/24 192.168.1.0/24 &lt;br /&gt;acl ProblemHost src 192.168.0.15 &lt;br /&gt;http_access deny ProblemHost &lt;br /&gt;http_access allow PrivateNet &lt;br /&gt;http_access deny All &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This will block requests from the IP address 192.168.0.15. You can also block an IP range, such as 192.168.0.0/24.&lt;br /&gt;&lt;br /&gt;Restricting usage to specified Web sites during working hours &lt;br /&gt;&lt;br /&gt;You can set up a simple ACL to restrict Internet usage to work-related sites during working hours. To do this, you need to make a list of allowed sites and save it as a file with the domain names on each line. For example:&lt;br /&gt;&lt;br /&gt;#Allowed Sites &lt;br /&gt;www.cnn.com &lt;br /&gt;www.news.google.com &lt;br /&gt;www.bbc.co.uk &lt;br /&gt;www.newsforge.com &lt;br /&gt;and other allowed sites... &lt;br /&gt;&lt;br /&gt;Once you have your allow list ready, use the following ACL to restrict usage:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;acl All src 0/0 &lt;br /&gt;acl PrivateNet src 192.168.0.0/24 192.168.1.0/24 &lt;br /&gt;acl AllowedSites dstdomain "/usr/local/squid/etc/allowed-sites" &lt;br /&gt;acl WorkingHours time D 08:00-17:30 &lt;br /&gt;http_access allow WorkingHours AllowedSites &lt;br /&gt;http_access deny All &lt;/strong&gt;&lt;br /&gt;Blocking pornography &lt;br /&gt;&lt;br /&gt;Pornographic sites are quite a headache for many organizations. While many specialized free and commercial packages exist for filtering content, you can use Squid to block pornography as well.&lt;br /&gt;&lt;br /&gt;The hardest part about using Squid to deny access to pornography is coming up with the list of sites that should be blocked. If you want a ready-made list, the Access Controls section of the Squid FAQ has links to freely available lists.&lt;br /&gt;&lt;br /&gt;The ACL you have to write for such a list depends on the content of the list. If the list contains regular expressions, you'll need to use the following ACL:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;acl PornSites url_regex "/usr/local/squid/etc/pornlist" &lt;br /&gt;http_access deny PornSites &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If the list contains hostnames, the url_regex will have to be changed to dstdomain, which tells Squid to match the entire hostname instead of the words in the hostname:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;acl PornSites dstdomain "/usr/local/squid/etc/pornlist" &lt;br /&gt;http_access deny PornSites &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;These methods are fine for casual use. If you are really serious about blocking such sites, you might want to look at specialized software, such as SquidGuard or Dansguardian.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Proxy authentication &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Proxy authentication is a complex subject, due to the various types of proxy authentication schemes available. I describe a simple user authentication scheme below, but there are many more schemes available, and the best one will vary according to your specific needs.&lt;br /&gt;&lt;br /&gt;Squid currently supports three techniques for receiving user credentials: HTTP Basic and Digest and NTLM. Basic authentication has been around for a long time. Though this is what I use in this example, you should know that it is a very insecure protocol, since the usernames and passwords are sent over the network in clear text. Anyone who runs a packet analyzer on your network can get the passwords. Still, it's a good place to start, and for smaller networks, where security is not a major problem, it works well.&lt;br /&gt;&lt;br /&gt;To use proxy authentication, Squid needs to be configured to spawn a number of external helper processes. The Squid source code includes some programs that authenticate against a number of standard databases. The auth_param directive controls the configuration of all helper programs.&lt;br /&gt;&lt;br /&gt;The order of the auth_param directive and proxy_auth ACL is extremely important. Remember that Squid reads the config file in one pass, and in order. If you don't put the proxy authentication ACLs in the proper order, you could end up allowing (or denying) all access. To use proxy authentication, you must define at least one authentication helper before any proxy_auth ACLs. If you don't, Squid will print an error message to the logs and start up anyway, and all user requests may be denied. If you try to set up proxy authentication and find that it's not working, look at the logs to make sure that the problem does not lie in the order of the ACLs.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HTTP Basic authentication supports the following auth_param parameters:&lt;br /&gt;&lt;br /&gt;l auth_param basic program command &lt;br /&gt;l auth_param basic children number &lt;br /&gt;l auth_param basic realm string &lt;br /&gt;l auth_param basic credentialsttl time-specification &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The program parameter specifies the command, including arguments, for the helper program. This is generally the pathname to one of the authentication helper programs. By default, the path is /usr/local/squid/libexec.&lt;br /&gt;&lt;br /&gt;The children parameter tells Squid how many helper processes to use. The default value is 5, which is a good starting point if you don't know how many helpers Squid needs to handle the load. For a 400-user network, I use a value of 25. You should check your cache.log to make sure that there are no warning messages about too few helper processes, and increase the number of helper processes if there are warnings.&lt;br /&gt;&lt;br /&gt;The realm parameter is the authentication realm string that the proxy server should present to the user when prompting for a username and password. Use something simple, such as "Orgname Proxy Server."&lt;br /&gt;&lt;br /&gt;The credentialsttl parameter specifies the amount of time that Squid internally caches authentication results. A larger "time to live" value reduces the load on the external authenticator processes, but increases the amount of time until Squid detects changes to the authentication database. If you have a relatively fixed user base, set this high, but if the user base is transient, as in a public library, use a lower value. The default TTL value is two hours.&lt;br /&gt;&lt;br /&gt;A complete setup would look like this:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/passwd &lt;br /&gt;auth_param basic children 10 &lt;br /&gt;auth_param basic realm NLU Proxy Server &lt;br /&gt;auth_param basic credentialsttl 3 hour &lt;br /&gt;acl Students proxy_auth REQUIRED &lt;br /&gt;http_access allow Students &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;For this example I have used the NCSA authentication helper, which is a simple authentication method that stores usernames and passwords in a single text file, similar to the /etc/passwd file. You pass the path to the password file as the program's single command-line argument in Squid.conf:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/passwd &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To create and update the file, you can use the htpasswd program. If you have the Apache Web server installed, htpasswd should also be installed; if not, download it from the Squid Web site. To create a file, the command is htpasswd -c passwdfile user. &lt;br /&gt;&lt;br /&gt;To add users and change their passwords, the command is htpasswd passwdfile username. &lt;br /&gt;&lt;br /&gt;htpasswd will prompt you for a password. If you want to allow users to change their own passwords, you can use the chpasswd CGI script, which is also available on the Squid Web site.&lt;br /&gt;&lt;br /&gt;There are several other authentication helpers you can use with Basic authentication. For example, you can authenticate against a LDAP server, Windows Domain, or Samba domain.&lt;br /&gt;&lt;br /&gt;Conclusion &lt;br /&gt;&lt;br /&gt;If you want to learn more about Squid, I recommend a book called Squid: The Definitive Guide , written by Duane Wessels and published by O'Reilly and Associates. Squid is a versatile and robust proxy server, and it can be used in very complex configurations. I hope that this introduction will help you in using some of Squid's more advanced features.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-7534366439119346338?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/7534366439119346338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=7534366439119346338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7534366439119346338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7534366439119346338'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/advanced-squid.html' title='Advanced Squid'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3527317317281989846</id><published>2008-03-29T21:36:00.000+05:30</published><updated>2008-03-29T21:51:28.125+05:30</updated><title type='text'>Postfix</title><content type='html'>&lt;strong&gt;Postfix Basic Configuration&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Introduction &lt;br /&gt;Postfix has several hundred configuration parameters that are controlled via the main.cf file. Fortunately, all parameters have sensible default values. In many cases, you need to configure only two or three parameters before you can start to play with the mail system&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Postfix configuration files&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Postfix configuration files&lt;br /&gt;By default, Postfix configuration files are in /etc/postfix. The two most important files are main.cf and master.cf; these files must be owned by root. Giving someone else write permission to main.cf or master.cf (or to their parent directories) means giving root privileges to that person. &lt;br /&gt;&lt;br /&gt;In /etc/postfix/main.cf you will have to set up a minimal number of configuration parameters. Postfix configuration parameters resemble shell variables, with two important differences: the first one is that Postfix does not know about quotes like the UNIX shell does.&lt;br /&gt;&lt;br /&gt;You specify a configuration parameter as: &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    parameter = value&lt;br /&gt;and you use it by putting a "$" character in front of its name: &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    other_parameter = $parameter&lt;br /&gt;You can use $parameter before it is given a value (that is the second main difference with UNIX shell variables). The Postfix configuration language uses lazy evaluation, and does not look at a parameter value until it is needed at runtime. &lt;br /&gt;&lt;br /&gt;Postfix uses database files for access control, address rewriting and other purposes. The DATABASE_README file gives an introduction to how Postfix works with Berkeley DB, LDAP or SQL and other types. Here is a common example of how Postfix invokes a database: &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    virtual_alias_maps = hash:/etc/postfix/virtual&lt;br /&gt;Whenever you make a change to the main.cf or master.cf file, execute the following command as root in order to refresh a running mail system: &lt;br /&gt;&lt;br /&gt;# postfix reload&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What domain name to use in outbound mail &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The myorigin parameter specifies the domain that appears in mail that is posted on this machine. The default is to use the local machine name, $myhostname, which defaults to the name of the machine. Unless you are running a really small site, you probably want to change that into $mydomain, which defaults to the parent domain of the machine name. &lt;br /&gt;&lt;br /&gt;For the sake of consistency between sender and recipient addresses, myorigin also specifies the domain name that is appended to an unqualified recipient address. &lt;br /&gt;&lt;br /&gt;Examples (specify only one of the following): &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    myorigin = $myhostname (default: send mail as "user@$myhostname")&lt;br /&gt;    myorigin = $mydomain   (probably desirable: "user@$mydomain")&lt;br /&gt;What domains to receive mail for &lt;br /&gt;The mydestination parameter specifies what domains this machine will deliver locally, instead of forwarding to another machine. The default is to receive mail for the machine itself. See the VIRTUAL_README file for how to configure Postfix for hosted domains. &lt;br /&gt;&lt;br /&gt;You can specify zero or more domain names, "/file/name" patterns and/or "type:table" lookup tables (such as hash:, btree:, nis:, ldap:, or mysql:), separated by whitespace and/or commas. A "/file/name" pattern is replaced by its contents; "type:table" requests that a table lookup is done and merely tests for existence: the lookup result is ignored. &lt;br /&gt;&lt;br /&gt;IMPORTANT: If your machine is a mail server for its entire domain, you must list $mydomain as well. &lt;br /&gt;&lt;br /&gt;Example 1: default setting. &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    mydestination = $myhostname localhost.$mydomain localhost&lt;br /&gt;Example 2: domain-wide mail server. &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    mydestination = $myhostname localhost.$mydomain localhost $mydomain&lt;br /&gt;Example 3: host with multiple DNS A records. &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    mydestination = $myhostname localhost.$mydomain localhost &lt;br /&gt;        www.$mydomain ftp.$mydomain&lt;br /&gt;Caution: in order to avoid mail delivery loops, you must list all hostnames of the machine, including $myhostname, and localhost.$mydomain. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What clients to relay mail from &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;By default, Postfix will forward mail from clients in authorized network blocks to any destination. Authorized networks are defined with the mynetworks configuration parameter. The default is to authorize all clients in the IP subnetworks that the local machine is attached to. &lt;br /&gt;&lt;br /&gt;IMPORTANT: If your machine is connected to a wide area network then your default mynetworks setting may be too friendly. &lt;br /&gt;&lt;br /&gt;Examples (specify only one of the following): &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    mynetworks_style = subnet  (default: authorize subnetworks)&lt;br /&gt;    mynetworks_style = host    (safe: authorize local machine only)&lt;br /&gt;    mynetworks = 127.0.0.0/8   (safe: authorize local machine only)&lt;br /&gt;    mynetworks = 127.0.0.0/8 168.100.189.2/32 (authorize local machine) &lt;br /&gt;You can specify the trusted networks in the main.cf file, or you can let Postfix do the work for you. The default is to let Postfix do the work. The result depends on the mynetworks_style parameter value. &lt;br /&gt;&lt;br /&gt;Specify "mynetworks_style = host" when Postfix should forward mail from only the local machine. &lt;br /&gt;&lt;br /&gt;Specify "mynetworks_style = subnet" (the default) when Postfix should forward mail from SMTP clients in the same IP subnetworks as the local machine. On Linux, this works correctly only with interfaces specified with the "ifconfig" command. &lt;br /&gt;&lt;br /&gt;Specify "mynetworks_style = class" when Postfix should forward mail from SMTP clients in the same IP class A/B/C networks as the local machine. Don't do this with a dialup site - it would cause Postfix to "trust" your entire provider's network. Instead, specify an explicit mynetworks list by hand, as described below. &lt;br /&gt;&lt;br /&gt;Alternatively, you can specify the mynetworks list by hand, in which case Postfix ignores the mynetworks_style setting. To specify the list of trusted networks by hand, specify network blocks in CIDR (network/mask) notation, for example: &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    mynetworks = 168.100.189.0/28, 127.0.0.0/8&lt;br /&gt;You can also specify the absolute pathname of a pattern file instead of listing the patterns in the main.cf file. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What destinations to relay mail to &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;By default, Postfix will forward mail from strangers (clients outside authorized networks) to authorized remote destinations only. Authorized remote destinations are defined with the relay_domains configuration parameter. The default is to authorize all domains (and subdomains) of the domains listed with the mydestination parameter. &lt;br /&gt;&lt;br /&gt;Examples (specify only one of the following): &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    relay_domains = $mydestination (default)&lt;br /&gt;    relay_domains =           (safe: never forward mail from strangers)&lt;br /&gt;    relay_domains = $mydomain (forward mail to my domain and subdomains)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What delivery method: direct or indirect&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;By default, Postfix tries to deliver mail directly to the Internet. Depending on your local conditions this may not be possible or desirable. For example, your system may be turned off outside office hours, it may be behind a firewall, or it may be connected via a provider who does not allow direct mail to the Internet. In those cases you need to configure Postfix to deliver mail indirectly via a relay host. &lt;br /&gt;&lt;br /&gt;Examples (specify only one of the following): &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    relayhost =                   (default: direct delivery to Internet)&lt;br /&gt;    relayhost = $mydomain         (deliver via local mailhub)&lt;br /&gt;    relayhost = [mail.$mydomain]  (deliver via local mailhub)&lt;br /&gt;    relayhost = [mail.isp.tld]    (deliver via provider mailhub)&lt;br /&gt;The form enclosed with [] eliminates DNS MX lookups. Don't worry if you don't know what that means. Just be sure to specify the [] around the mailhub hostname that your ISP gave to you, otherwise mail may be mis-delivered. &lt;br /&gt;&lt;br /&gt;The STANDARD_CONFIGURATION_README file has more hints and tips for firewalled and/or dial-up networks. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What trouble to report to the postmaster &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You should set up a postmaster alias in the aliases(5) table that directs mail to a human person. The postmaster address is required to exist, so that people can report mail delivery problems. While you're updating the aliases(5) table, be sure to direct mail for the super-user to a human person too. &lt;br /&gt;&lt;br /&gt;/etc/aliases:&lt;br /&gt;    postmaster: you&lt;br /&gt;    root: you&lt;br /&gt;Execute the command "newaliases" after changing the aliases file. Instead of /etc/aliases, your alias file may be located elsewhere. Use the command "postconf alias_maps" to find out.&lt;br /&gt;&lt;br /&gt;The Postfix system reports problems to the postmaster alias. You may not be interested in all types of trouble reports, so this reporting mechanism is configurable. The default is to report only serious problems (resource, software) to postmaster: &lt;br /&gt;&lt;br /&gt;Default setting: &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    notify_classes = resource, software&lt;br /&gt;The meaning of the classes is as follows: &lt;br /&gt;&lt;br /&gt;bounce &lt;br /&gt;Inform the postmaster of undeliverable mail. Either send the postmaster a copy of undeliverable mail that is returned to the sender, or send a transcript of the SMTP session when Postfix rejected mail. For privacy reasons, the postmaster copy of undeliverable mail is truncated after the original message headers. This implies "2bounce" (see below). See also the luser_relay feature. The notification is sent to the address specified with the bounce_notice_recipient configuration parameter (default: postmaster). &lt;br /&gt;2bounce &lt;br /&gt;When Postfix is unable to return undeliverable mail to the sender, send it to the postmaster instead (without truncating the message after the primary headers). The notification is sent to the address specified with the 2bounce_notice_recipient configuration parameter (default: postmaster). &lt;br /&gt;delay &lt;br /&gt;Inform the postmaster of delayed mail. In this case, the postmaster receives message headers only. The notification is sent to the address specified with the delay_notice_recipient configuration parameter (default: postmaster). &lt;br /&gt;policy &lt;br /&gt;Inform the postmaster of client requests that were rejected because of (UCE) policy restrictions. The postmaster receives a transcript of the SMTP session. The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster). &lt;br /&gt;protocol &lt;br /&gt;Inform the postmaster of protocol errors (client or server side) or attempts by a client to execute unimplemented commands. The postmaster receives a transcript of the SMTP session. The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster). &lt;br /&gt;resource &lt;br /&gt;Inform the postmaster of mail not delivered due to resource problems (for example, queue file write errors). The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster). &lt;br /&gt;software &lt;br /&gt;Inform the postmaster of mail not delivered due to software problems. The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster). &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Proxy/NAT external network addresses &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Some mail servers are connected to the Internet via a network address translator (NAT) or proxy. This means that systems on the Internet connect to the address of the NAT or proxy, instead of connecting to the network address of the mail server. The NAT or proxy forwards the connection to the network address of the mail server, but Postfix does not know this. &lt;br /&gt;&lt;br /&gt;If you run a Postfix server behind a proxy or NAT, you need to configure the proxy_interfaces parameter and specify all the external proxy or NAT addresses that Postfix receives mail on. You may specify symbolic hostnames instead of network addresses. &lt;br /&gt;&lt;br /&gt;IMPORTANT: You must specify your proxy/NAT external addresses when your system is a backup MX host for other domains, otherwise mail delivery loops will happen when the primary MX host is down. &lt;br /&gt;&lt;br /&gt;Example: host behind NAT box running a backup MX host. &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    proxy_interfaces = 1.2.3.4 (the proxy/NAT external network address)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;What you need to know about Postfix logging &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Postfix daemon processes run in the background, and log problems and normal activity to the syslog daemon. The syslogd process sorts events by class and severity, and appends them to logfiles. The logging classes, levels and logfile names are usually specified in /etc/syslog.conf. At the very least you need something like: &lt;br /&gt;&lt;br /&gt;/etc/syslog.conf:&lt;br /&gt;    mail.err                                    /dev/console&lt;br /&gt;    mail.debug                                  /var/log/maillog&lt;br /&gt;After changing the syslog.conf file, send a "HUP" signal to the syslogd process. &lt;br /&gt;&lt;br /&gt;IMPORTANT: many syslogd implementations will not create files. You must create files before (re)starting syslogd. &lt;br /&gt;&lt;br /&gt;IMPORTANT: on Linux you need to put a "-" character before the pathname, e.g., -/var/log/maillog, otherwise the syslogd process will use more system resources than Postfix. &lt;br /&gt;&lt;br /&gt;Hopefully, the number of problems will be small, but it is a good idea to run every night before the syslog files are rotated: &lt;br /&gt;&lt;br /&gt;# postfix check&lt;br /&gt;# egrep '(reject|warning|error|fatal|panic):' /some/log/file&lt;br /&gt;The first line (postfix check) causes Postfix to report file permission/ownership discrepancies. &lt;br /&gt;&lt;br /&gt;The second line looks for problem reports from the mail software, and reports how effective the relay and junk mail access blocks are. This may produce a lot of output. You will want to apply some postprocessing to eliminate uninteresting information. &lt;br /&gt;&lt;br /&gt;The DEBUG_README document describes the meaning of the "warning" etc. labels in Postfix logging. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Running Postfix daemon processes chrooted &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Postfix daemon processes can be configured (via the master.cf file) to run in a chroot jail. The processes run at a fixed low privilege and with file system access limited to the Postfix queue directories (/var/spool/postfix). This provides a significant barrier against intrusion. The barrier is not impenetrable (chroot limits file system access only), but every little bit helps.&lt;br /&gt;&lt;br /&gt;With the exception of Postfix daemons that deliver mail locally and/or that execute non-Postfix commands, every Postfix daemon can run chrooted.&lt;br /&gt;&lt;br /&gt;Sites with high security requirements should consider to chroot all daemons that talk to the network: the smtp(8) and smtpd(8) processes, and perhaps also the lmtp(8) client. The author's own porcupine.org mail server runs all daemons chrooted that can be chrooted. &lt;br /&gt;&lt;br /&gt;The default /etc/postfix/master.cf file specifies that no Postfix daemon runs chrooted. In order to enable chroot operation, edit the file /etc/postfix/master.cf, and follow instructions in the file. When you're finished, execute "postfix reload" to make the change effective. &lt;br /&gt;&lt;br /&gt;Note that a chrooted daemon resolves all filenames relative to the Postfix queue directory (/var/spool/postfix). For successful use of a chroot jail, most UNIX systems require you to bring in some files or device nodes. The examples/chroot-setup directory in the source code distribution has a collection of scripts that help you set up Postfix chroot environments on different operating systems.&lt;br /&gt;&lt;br /&gt;Additionally, you almost certainly need to configure syslogd so that it listens on a socket inside the Postfix queue directory. Examples of syslogd command line options that achieve this for specific systems: &lt;br /&gt;&lt;br /&gt;FreeBSD: syslogd -l /var/spool/postfix/var/run/log &lt;br /&gt;&lt;br /&gt;Linux, OpenBSD: syslogd -a /var/spool/postfix/dev/log &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;If you run Postfix on a virtual network interface, or if your machine runs other mailers on virtual interfaces, you'll have to look at the other parameters listed here as well&lt;/strong&gt;: &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;My own hostname&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;The myhostname parameter specifies the fully-qualified domain name of the machine running the Postfix system. $myhostname appears as the default value in many other Postfix configuration parameters. &lt;br /&gt;&lt;br /&gt;By default, myhostname is set to the local machine name. If your local machine name is not in fully-qualified domain name form, or if you run Postfix on a virtual interface, you will have to specify the fully-qualified domain name that the mail system should use. &lt;br /&gt;&lt;br /&gt;Alternatively, if you specify mydomain in main.cf, then Postfix will use its value to generate a fully-qualified default value for the myhostname parameter. &lt;br /&gt;&lt;br /&gt;Examples (specify only one of the following): &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    myhostname = host.local.domain (machine name is not FQDN)&lt;br /&gt;    myhostname = host.virtual.domain (virtual interface)&lt;br /&gt;    myhostname = virtual.domain (virtual interface)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;My own domain name&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;The mydomain parameter specifies the parent domain of $myhostname. By default, it is derived from $myhostname by stripping off the first part (unless the result would be a top-level domain). &lt;br /&gt;&lt;br /&gt;Conversely, if you specify mydomain in main.cf, then Postfix will use its value to generate a fully-qualified default value for the myhostname parameter. &lt;br /&gt;&lt;br /&gt;Examples (specify only one of the following): &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    mydomain = local.domain&lt;br /&gt;    mydomain = virtual.domain (virtual interface)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;My own network addresses &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The inet_interfaces parameter specifies all network interface addresses that the Postfix system should listen on; mail addressed to "user@[network address]" will be delivered locally, as if it is addressed to a domain listed in $mydestination.&lt;br /&gt;&lt;br /&gt;You can override the inet_interfaces setting in the Postfix master.cf file by prepending an IP address to a server name. &lt;br /&gt;&lt;br /&gt;The default is to listen on all active interfaces. If you run mailers on virtual interfaces, you will have to specify what interfaces to listen on. &lt;br /&gt;&lt;br /&gt;IMPORTANT: If you run MTAs on virtual interfaces you must specify explicit inet_interfaces values for the MTA that receives mail for the machine itself: this MTA should never listen on the virtual interfaces or you would have a mailer loop when a virtual MTA is down. &lt;br /&gt;&lt;br /&gt;Example: default setting. &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    inet_interfaces = all&lt;br /&gt;Example: host running one or more virtual mailers. For each Postfix instance, specify only one of the following. &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    inet_interfaces = virtual.host.tld         (virtual Postfix)&lt;br /&gt;    inet_interfaces = $myhostname localhost... (non-virtual Postfix)&lt;br /&gt;Note: you need to stop and start Postfix after changing this parameter. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Postfix SMTP relay and access control&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;Introduction &lt;br /&gt;The Postfix SMTP server receives mail from the network and is exposed to the big bad world of junk email and viruses. This document introduces the built-in and external methods that control what SMTP mail Postfix will accept, what mistakes to avoid, and how to test your configuration&lt;br /&gt;&lt;br /&gt;Relay control, junk mail control, and per-user policies &lt;br /&gt;In a distant past, the Internet was a friendly environment. Mail servers happily forwarded mail on behalf of anyone towards any destination. On today's Internet, spammers abuse servers that forward mail from arbitrary systems, and abused systems end up on anti-spammer blacklists. See, for example, the information on http://www.mail-abuse.org/ and other websites. &lt;br /&gt;&lt;br /&gt;By default, Postfix has a moderately restrictive approach to mail relaying. Postfix forwards mail only from clients in trusted networks, or to domains that are configured as authorized relay destinations. For a description of the default policy, see the smtpd_recipient_restrictions parameter in the postconf(5) manual page, and the information that is referenced from there. &lt;br /&gt;&lt;br /&gt;Most of the Postfix SMTP server access controls are targeted at stopping junk email. &lt;br /&gt;&lt;br /&gt;Protocol oriented: some SMTP server access controls block mail by being very strict with respect to the SMTP protocol; these catch poorly implemented and/or poorly configured junk email software, as well as email worms that come with their own non-standard SMTP client implementations. Protocol-oriented access controls become less useful over time as spammers and worm writers learn to read RFC documents. &lt;br /&gt;&lt;br /&gt;Blacklist oriented: some SMTP server access controls query blacklists with known to be bad sites such as open mail relays, open web proxies, and home computers that have been compromised and that are under remote control by criminals. The effectiveness of these blacklists depends on how complete and how up to date they are. &lt;br /&gt;&lt;br /&gt;Threshold oriented: some SMTP server access controls attempt to raise the bar by either making the client do more work (greylisting) or by asking for a second opinion (SPF and sender/recipient address verification). The greylisting and SPF policies are implemented externally, and are the subject of the SMTPD_POLICY_README document. Sender/recipient address verification is the subject of the ADDRESS_VERIFICATION_README document. &lt;br /&gt;&lt;br /&gt;Unfortunately, all junk mail controls have the possibility of falsely rejecting legitimate mail. This can be a problem for sites with many different types of users. For some users it is unacceptable when any junk email slips through, while for other users the world comes to an end when a single legitimate email message is blocked. Because there is no single policy that is "right" for all users, Postfix supports different SMTP access restrictions for different users. This is described in the RESTRICTION_CLASS_README document. &lt;br /&gt;&lt;br /&gt;Restrictions that apply to all SMTP mail &lt;br /&gt;Besides the restrictions that can be made configurable per client or per user as described in the next section, Postfix implements a few restrictions that apply to all SMTP mail. &lt;br /&gt;&lt;br /&gt;The built-in header_checks and body_checks content restrictions, as described in the BUILTIN_FILTER_README document. This happens while Postfix receives mail, before it is stored in the incoming queue. &lt;br /&gt;&lt;br /&gt;The external before-queue content restrictions, as described in the SMTPD_PROXY_README document. This happens while Postfix receives mail, before it is stored in the incoming queue. &lt;br /&gt;&lt;br /&gt;Requiring that the client sends the HELO or EHLO command before sending the MAIL FROM or ETRN command. This may cause problems with home-grown applications that send mail. For this reason, the requirement is disabled by default ("smtpd_helo_required = no"). &lt;br /&gt;&lt;br /&gt;Disallowing illegal syntax in MAIL FROM or RCPT TO commands. This may cause problems with home-grown applications that send mail, and with ancient PC mail clients. For this reason, the requirement is disabled by default ("strict_rfc821_envelopes = no"). &lt;br /&gt;&lt;br /&gt;Disallowing RFC 822 address syntax (example: "MAIL FROM: the dude &lt;dude@example.com&gt;"). &lt;br /&gt;&lt;br /&gt;Disallowing addresses that are not enclosed with &lt;&gt; (example: "MAIL FROM: dude@example.com"). &lt;br /&gt;&lt;br /&gt;Rejecting mail from a non-existent sender address. This form of egress filtering helps to slow down worms and other malware, but may cause problems with home-grown software that sends out mail software with an unreplyable address. For this reason the requirement is disabled by default ("smtpd_reject_unlisted_sender = no"). &lt;br /&gt;&lt;br /&gt;Rejecting mail for a non-existent recipient address. This form of ingress filtering helps to keep the mail queue free of undeliverable MAILER-DAEMON messages. This requirement is enabled by default ("smtpd_reject_unlisted_recipient = yes"). &lt;br /&gt;&lt;br /&gt;Getting selective with SMTP access restriction lists &lt;br /&gt;Postfix allows you to specify lists of access restrictions for each stage of the SMTP conversation. Individual restrictions are described in the postconf(5) manual page. &lt;br /&gt;&lt;br /&gt;Examples of simple restriction lists are: &lt;br /&gt;&lt;br /&gt;/etc/postfix/main.cf:&lt;br /&gt;    # Allow connections from trusted networks only.&lt;br /&gt;    smtpd_client_restrictions = permit_mynetworks, reject&lt;br /&gt;&lt;br /&gt;    # Don't talk to mail systems that don't know their own hostname.&lt;br /&gt;    # With Postfix &lt; 2.3, specify reject_unknown_hostname.&lt;br /&gt;    smtpd_helo_restrictions = reject_unknown_helo_hostname&lt;br /&gt;&lt;br /&gt;    # Don't accept mail from domains that don't exist.&lt;br /&gt;    smtpd_sender_restrictions = reject_unknown_sender_domain&lt;br /&gt;&lt;br /&gt;    # Whitelisting: local clients may specify any destination. Others may not.&lt;br /&gt;    smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination&lt;br /&gt;&lt;br /&gt;    # Block clients that speak too early.&lt;br /&gt;    smtpd_data_restrictions = reject_unauth_pipelining&lt;br /&gt;&lt;br /&gt;    # Enforce mail volume quota via policy service callouts.&lt;br /&gt;    smtpd_end_of_data_restrictions = check_policy_service unix:private/policy&lt;br /&gt;Each restriction list is evaluated from left to right until some restriction produces a result of PERMIT, REJECT or DEFER (try again later). The end of the list is equivalent to a PERMIT result. By placing a PERMIT restriction before a REJECT restriction you can make exceptions for specific clients or users. This is called whitelisting; the last example above allows mail from local networks but otherwise rejects mail to arbitrary destinations. &lt;br /&gt;&lt;br /&gt;The table below summarizes the purpose of each SMTP access restriction list. All lists use the exact same syntax; they differ only in the time of evaluation and in the effect of a REJECT or DEFER result. &lt;br /&gt;&lt;br /&gt;Restriction list name  Status  Effect of REJECT or DEFER result  &lt;br /&gt;smtpd_client_restrictions  Optional  Reject all client commands  &lt;br /&gt;smtpd_helo_restrictions  Optional  Reject HELO/EHLO information  &lt;br /&gt;smtpd_sender_restrictions  Optional  Reject MAIL FROM information  &lt;br /&gt;smtpd_recipient_restrictions  Required  Reject RCPT TO information  &lt;br /&gt;smtpd_data_restrictions  Optional  Reject DATA command  &lt;br /&gt;smtpd_end_of_data_restrictions  Optional  Reject END-OF-DATA command  &lt;br /&gt;smtpd_etrn_restrictions  Optional  Reject ETRN command  &lt;br /&gt;&lt;br /&gt;Delayed evaluation of SMTP access restriction lists &lt;br /&gt;Early Postfix versions evaluated SMTP access restrictions lists as early as possible. The client restriction list was evaluated before Postfix sent the "220 $myhostname..." greeting banner to the SMTP client, the helo restriction list was evaluated before Postfix replied to the HELO (EHLO) command, the sender restriction list was evaluated before Postfix replied to the MAIL FROM command, and so on. This approach turned out to be difficult to use. &lt;br /&gt;&lt;br /&gt;Current Postfix versions postpone the evaluation of client, helo and sender restriction lists until the RCPT TO or ETRN command. This behavior is controlled by the smtpd_delay_reject parameter. Restriction lists are still evaluated in the proper order of (client, helo, etrn) or (client, helo, sender, recipient, data, or end-of-data) restrictions. When a restriction list (example: client) evaluates to REJECT or DEFER the other restriction lists (example: helo, sender, etc.) are skipped. &lt;br /&gt;&lt;br /&gt;Around the time that smtpd_delay_reject was introduced, Postfix was also changed to support mixed restriction lists that combine information about the client, helo, sender and recipient or etrn command. &lt;br /&gt;&lt;br /&gt;Benefits of delayed restriction evaluation, and of restriction mixing: &lt;br /&gt;&lt;br /&gt;Some SMTP clients do not expect a negative reply early in the SMTP session. When the bad news is postponed until the RCPT TO reply, the client goes away as it is supposed to, instead of hanging around until a timeout happens, or worse, going into an endless connect-reject-connect loop. &lt;br /&gt;&lt;br /&gt;Postfix can log more useful information. For example, when Postfix rejects a client name or address and delays the action until the RCPT TO command, it can log the sender and the recipient address. This is more useful than logging only the client hostname and IP address and not knowing whose mail was being blocked. &lt;br /&gt;&lt;br /&gt;Mixing is needed for complex whitelisting policies. For example, in order to reject local sender addresses in mail from non-local clients, you need to be able to mix restrictions on client information with restrictions on sender information in the same restriction list. Without this ability, many per-user access restrictions would be impossible to express. &lt;br /&gt;&lt;br /&gt;Dangerous use of smtpd_recipient_restrictions &lt;br /&gt;By now the reader may wonder why we need smtpd client, helo or sender restrictions, when their evaluation is postponed until the RCPT TO or ETRN command. Some people recommend placing ALL the access restrictions in the smtpd_recipient_restrictions list. Unfortunately, this can result in too permissive access. How is this possible? &lt;br /&gt;&lt;br /&gt;The purpose of the smtpd_recipient_restrictions feature is to control how Postfix replies to the RCPT TO command. If the restriction list evaluates to REJECT or DEFER, the recipient address is rejected; no surprises here. If the result is PERMIT, then the recipient address is accepted. And this is where surprises can happen. &lt;br /&gt;&lt;br /&gt;Here is an example that shows when a PERMIT result can result in too much access permission: &lt;br /&gt;&lt;br /&gt;1 /etc/postfix/main.cf:&lt;br /&gt;2 smtpd_recipient_restrictions = &lt;br /&gt;3 permit_mynetworks&lt;br /&gt;4 check_helo_access hash:/etc/postfix/helo_access&lt;br /&gt;5 reject_unknown_helo_hostname&lt;br /&gt;6  reject_unauth_destination&lt;br /&gt;7 /etc/postfix/helo_access:&lt;br /&gt;8  localhost.localdomain PERMIT&lt;br /&gt;Line 5 rejects mail from hosts that don't specify a proper hostname in the HELO command (with Postfix &lt; 2.3, specify reject_unknown_hostname). Lines 4 and 9 make an exception to allow mail from some machine that announces itself with "HELO localhost.localdomain". &lt;br /&gt;&lt;br /&gt;The problem with this configuration is that smtpd_recipient_restrictions evaluates to PERMIT for EVERY host that announces itself as "localhost.localdomain", making Postfix an open relay for all such hosts. &lt;br /&gt;&lt;br /&gt;In order to avoid surprises like these with smtpd_recipient_restrictions, you should place non-recipient restrictions AFTER the reject_unauth_destination restriction, not before. In the above example, the HELO based restrictions should be placed AFTER reject_unauth_destination, or better, the HELO based restrictions should be placed under smtpd_helo_restrictions where they can do no harm. &lt;br /&gt;&lt;br /&gt;SMTP access rule testing &lt;br /&gt;Postfix has several features that aid in SMTP access rule testing: &lt;br /&gt;&lt;br /&gt;soft_bounce &lt;br /&gt;This is a safety net that changes SMTP server REJECT actions into DEFER (try again later) actions. This keeps mail queued that would otherwise be returned to the sender. Specify "soft_bounce = yes" in the main.cf file to prevent the Postfix SMTP server from rejecting mail permanently, by changing all 5xx SMTP reply codes into 4xx. &lt;br /&gt;&lt;br /&gt;warn_if_reject &lt;br /&gt;This is a different safety net that changes SMTP server REJECT actions into warnings. Instead of rejecting a command, Postfix logs what it would reject. Specify "warn_if_reject" in an SMTP access restriction list, before the restriction that you want to test without actually rejecting mail. &lt;br /&gt;&lt;br /&gt;XCLIENT &lt;br /&gt;With this Postfix 2.1 feature, authorized SMTP clients can impersonate other systems, so that you can do realistic SMTP access rule tests. Examples of how to impersonate other systems for access rule testing are given at the end of the XCLIENT_README document&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3527317317281989846?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3527317317281989846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3527317317281989846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3527317317281989846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3527317317281989846'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/postfix.html' title='Postfix'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-1110586171500439549</id><published>2008-03-29T21:31:00.000+05:30</published><updated>2008-03-29T21:32:17.545+05:30</updated><title type='text'>Active/Active with different services on both nodes</title><content type='html'>You might rightly think that the active/passive scenario is rather inefficient, because assuming your systems are generally reliable, you have a perfectly good server sitting doing nothing. Therefore, you might prefer to balance the load somewhat using an active/active configuration, where one node "normally" runs some services, and the other node "normally" runs some other (different) services. (See also A Two IP address Active/Active Configuration) &lt;br /&gt;&lt;br /&gt;There are a couple of things you need to bear in mind before doing this: &lt;br /&gt;&lt;br /&gt;If one node can comfortably cope with the load of running all the services, there isn't necessarily much point in trying to split them. However: &lt;br /&gt;If one node can't cope with the load, then consider what's going to happen when you need to failover all services to one node &lt;br /&gt;&lt;br /&gt;(these considerations are general to HA, not DRBD-specific) &lt;br /&gt;&lt;br /&gt;However, assuming this is what you want to do, and that the services running on each node each require a shared filesystem (i.e. DRBD), then you need to take the following steps: &lt;br /&gt;&lt;br /&gt;Make sure you have separate DRBD resources (drbd0, drbd1...) set up. Since it's not currently possible with DRBD to have a shared filesystem mounted on both primary and secondary nodes (unless you simulate it using cross-mounting with NFS or similar, which is way beyond the scope of this document), we need to separate the filesystem into groups according to which applications are going to be "grouped" together on the nodes when both nodes are up. For maximum flexibility in assigning nodes to applications, you might well want to have a DRBD share per application, assuming of course that no two applications need to access the same share. &lt;br /&gt;&lt;br /&gt;If the DRBD devices are on the same disk spindle, use sync groups to ensure that DRBD sync happens at a reasonable speed &lt;br /&gt;Configure Heartbeat appropriately &lt;br /&gt;Let's run through these steps. We'll assume by way of example that you want to run MySQL and Apache. You need one DRBD share for the MySQL data, and one for the Apache data. The nodes will be called 'node1' and 'node2'. We decide to configure it as follows: &lt;br /&gt;&lt;br /&gt;share&lt;br /&gt; DRBD resource&lt;br /&gt; DRBD device&lt;br /&gt; Physical device&lt;br /&gt; mountpoint&lt;br /&gt; &lt;br /&gt;Apache&lt;br /&gt; r0&lt;br /&gt; /dev/drbd0&lt;br /&gt; /dev/sda1&lt;br /&gt; /ha/web&lt;br /&gt; &lt;br /&gt;MySQL&lt;br /&gt; r1&lt;br /&gt; /dev/drbd1&lt;br /&gt; /dev/sda2&lt;br /&gt; /ha/mysql&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; /dev/drbdX have been /dev/nbX in drbd-0.6.x and older, see also DRBD/QuickStart07 &lt;br /&gt;&lt;br /&gt;Let's assume, to complicate things, that you have a limited number of physical disks and therefore are forced to have drbd0 and drbd1 on the same spindle (i.e. same hard disk) as shown in the table above (both resources are on /dev/sda in this case). This isn't ideal, but is OK thanks to the 'sync-groups' option. This governs the order in which DRBD resources synchronise (normally, they would sync in parallel, which is going to kill performance if you have got two resources on one disk as the drive would be constantly seeking backwards and forwards reading/writing from/to the two resources). So we use sync-groups to make one resource sync first. It doesn't really matter which goes first. Here's a snippet of a possible drbd.conf. NOTE Only the relevant options are shown here for clarity; you need all your usual options such as disk-size, sync-max etc. in there too: &lt;br /&gt;&lt;br /&gt; Syntax was different with drbd-0.6&lt;br /&gt;Just adopting the well commented example drbd.conf to your needs should be easy, though. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# Our web share&lt;br /&gt;resource web {&lt;br /&gt;  protocol C;&lt;br /&gt;  incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";&lt;br /&gt;  startup { wfc-timeout 0; degr-wfc-timeout     120; }&lt;br /&gt;  disk { on-io-error detach; } # or panic, ...&lt;br /&gt;  syncer {&lt;br /&gt;     group 0;&lt;br /&gt;     rate 6M;&lt;br /&gt;  }&lt;br /&gt;  on node1 {&lt;br /&gt;    device /dev/drbd0;&lt;br /&gt;    disk /dev/sda1;&lt;br /&gt;    address 192.168.99.1:7788;&lt;br /&gt;    meta-disk /dev/sdb1[0];&lt;br /&gt;  }&lt;br /&gt;  on node2 {&lt;br /&gt;    device /dev/drbd0;&lt;br /&gt;    disk /dev/sda1;&lt;br /&gt;    address 192.168.99.2:7788;&lt;br /&gt;    meta-disk /dev/sdb1[0];&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Our MySQL share&lt;br /&gt;resource db {&lt;br /&gt;  protocol C;&lt;br /&gt;  incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";&lt;br /&gt;  startup { wfc-timeout 0; degr-wfc-timeout     120; }&lt;br /&gt;  disk { on-io-error detach; } # or panic, ...&lt;br /&gt;  syncer {&lt;br /&gt;     group 1;&lt;br /&gt;     rate 6M;&lt;br /&gt;  }&lt;br /&gt;  on node1 {&lt;br /&gt;    device /dev/drbd1;&lt;br /&gt;    disk /dev/sda2;&lt;br /&gt;    address 192.168.99.1:7789;&lt;br /&gt;    meta-disk /dev/sdb1[1];&lt;br /&gt;  }&lt;br /&gt;  on node2 {&lt;br /&gt;    device /dev/drbd1;&lt;br /&gt;    disk /dev/sda2;&lt;br /&gt;    address 192.168.99.2:7789;&lt;br /&gt;    meta-disk /dev/sdb1[1];&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In the above example, drbd0 will sync first and drbd1 second. &lt;br /&gt;&lt;br /&gt;Now, for the heartbeat config. The resources section in haresources is going to look something like this: (you're probably going to need other resources too, like for example IP addresses; this is a simple example) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;node1 drbddisk::web Filesystem::/dev/drbd0::/ha/web::ext3 httpd&lt;br /&gt;node2 drbddisk::db Filesystem::/dev/drbd1::/ha/mysql::ext3 mysqld&lt;br /&gt;&lt;br /&gt;Note how node1 will "normally" run Apache using the drbd0 resource, and node2 will "normally" run MySQL with the drbd1 resource. If failover occurs, obviously one node will run both, and become DRBD primary for both resources (and have both shares mounted). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Keeping config files in syncAn obvious question you might ask is "how do I keep config files in sync, e.g. for Apache". The simple answer is that you should probably look at using rsync, scp or some other similar method to keep your configs in sync. &lt;br /&gt;&lt;br /&gt; If you have many config files (or "cluster files") to keep in sync over arbitrary many hosts, have a look at csync2 by LinBit&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-1110586171500439549?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/1110586171500439549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=1110586171500439549' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1110586171500439549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1110586171500439549'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/activeactive-with-different-services-on.html' title='Active/Active with different services on both nodes'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3212984759177126452</id><published>2008-03-29T21:29:00.000+05:30</published><updated>2008-03-29T21:31:11.532+05:30</updated><title type='text'>Active/Passive (hot standby)</title><content type='html'>This is usually the simplest configuration. Here, you have all your active services (e.g. Apache, MySQL, whatever...) all running on one node. The other node sits doing nothing. (See also A Basic Single IP Address Configuration) &lt;br /&gt;&lt;br /&gt;In this case, you can possibly get away with just one DRBD share (resource) for multiple applications. The basic idea is that you have a DRBD share on which you put all your data (not normally binaries or other system files). Let's assume Apache, for example. You might opt for a 'high availability' mountpoint /ha/web. This will be shared across both nodes with DRBD but remember that only the primary node can mount it; you can't have it mounted on both nodes at the same time. &lt;br /&gt;&lt;br /&gt;A typical, simple DRBD config for this would look like: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TODO: typical active/passive DRBD config&lt;br /&gt;&lt;br /&gt;You would configure Apache with all the websites having document roots under this share, e.g. you might have: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;|-/ha&lt;br /&gt;|--- web&lt;br /&gt;|----- client1&lt;br /&gt;|----- client2&lt;br /&gt;&lt;br /&gt;snippet from Apache config: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;VirtualHost 192.168.0.1&gt;&lt;br /&gt;   ServerName client1.example.com&lt;br /&gt;   DocumentRoot /ha/web/client1&lt;br /&gt;   ...&lt;br /&gt;&lt;/VirtualHost&gt;&lt;br /&gt;&lt;br /&gt;&lt;VirtualHost 192.168.0.1&gt;&lt;br /&gt;   ServerName client2.example.com&lt;br /&gt;   DocumentRoot /ha/web/client2&lt;br /&gt;   ...&lt;br /&gt;&lt;/VirtualHost&gt;&lt;br /&gt;&lt;br /&gt;Setting up heartbeat isn't difficult but there are two steps you need to be aware of: &lt;br /&gt;&lt;br /&gt;running the 'drbddisk' script, which triggers DRBD to make the current node primary for the given resource &lt;br /&gt;&lt;br /&gt;actually mounting the filesystem &lt;br /&gt;Here's a typical, simple, snippet from haresources showing an active/passive configuration. In this case, node1 is the default primary, and there is a "floating" IP address 192.168.0.1: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;node1 drbddisk::web Filesystem::/dev/drbd0::/mnt/ha::ext3 192.168.0.1 httpd&lt;br /&gt;&lt;br /&gt;Note the order in which the resources are started. drbddisk needs to go first, since it configures DRBD to be primary. Mounting the filesystem is next, and actually running Apache is last. Setting up the network IP obviously needs to happen at some point before Apache starts. &lt;br /&gt;&lt;br /&gt; drbddisk was datadisk in drbd-0.6.x. &lt;br /&gt;&lt;br /&gt; web above (the parameter to datadisk or drbddisk) is the resource name you chose for the resource section in drbd.conf, not the device (unless you chose to give your resources device names...) &lt;br /&gt;&lt;br /&gt;With several resources, it has to be written like &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;castor 10.0.0.30 drbddisk::r0 drbddisk::r1  \&lt;br /&gt;        Filesystem::/dev/drbd0::/crypt::xfs \&lt;br /&gt;        Filesystem::/dev/drbd1::/data::xfs  \&lt;br /&gt;        samba nfs-kernel-server&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3212984759177126452?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3212984759177126452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3212984759177126452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3212984759177126452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3212984759177126452'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/activepassive-hot-standby.html' title='Active/Passive (hot standby)'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-7612953149701694124</id><published>2008-03-29T21:26:00.000+05:30</published><updated>2008-03-29T21:27:15.876+05:30</updated><title type='text'>Shared Disk in HA evironment</title><content type='html'>Shared disk is simply disk which is accessible from more than one computer at the same time. &lt;br /&gt;&lt;br /&gt;Commonly these arrangements are fiber channel, and can include redundant FC interconnect cards, and fiber channel switches, so that they can be made with no single point of failure. &lt;br /&gt;&lt;br /&gt;Examples include IBM's FAStT(DS4300) and ESS (Shark) lines of fiber channel disks. &lt;br /&gt;&lt;br /&gt;Many other manufacturers also make similar products. &lt;br /&gt;&lt;br /&gt;The only constraint for this kind of "simple" configuration is that they be accessible from either side without any kind of special command having to be issued other than a mount command&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-7612953149701694124?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/7612953149701694124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=7612953149701694124' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7612953149701694124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7612953149701694124'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/shared-disk-in-ha-evironment.html' title='Shared Disk in HA evironment'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-1501612110636760179</id><published>2008-03-29T21:25:00.000+05:30</published><updated>2008-03-29T21:26:27.907+05:30</updated><title type='text'>Two Apache Web Servers in an Active/Active Configuration</title><content type='html'>Two Apache Web Servers in an Active/Active ConfigurationThis configuration is for a high-availability server which provides two IP addresses (1.2.3.4, and 1.2.3.5) to be failed over between the nodes of our cluster, and an Apache server for each IP address. We will set this up as an active/active configuration. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/ha.cf file&lt;br /&gt;logfacility daemon         # Log to syslog as facility "daemon"&lt;br /&gt;node paul silas            # List our cluster members&lt;br /&gt;keepalive 1                # Send one heartbeat each second&lt;br /&gt;warntime  3                # Warn when heartbeats are late&lt;br /&gt;deadtime 10                # Declare nodes dead after 10 seconds&lt;br /&gt;bcast eth0 eth1            # Broadcast heartbeats on eth0 and eth1 interfaces&lt;br /&gt;ping 1.2.3.254             # Ping our router to monitor ethernet connectivity&lt;br /&gt;auto_failback yes          # Keep resources on their "preferred" hosts - needed for active/active&lt;br /&gt;respawn hacluster /usr/lib/heartbeat/ipfail  # Failover on network failures&lt;br /&gt;&lt;br /&gt;See the ipfail page for more information on ipfail. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/haresources file&lt;br /&gt;paul    1.2.3.4  apache::/apache1dir/httpd.cf&lt;br /&gt;silas   1.2.3.5  apache::/apache2dir/httpd.cf&lt;br /&gt;&lt;br /&gt;The first word (paul or silas) on the line represents the "preferred" host for the service. The remainder of the line is the list of resources (services) which are part of this ResourceGroup. In this case, each ResourceGroup consists of only two resources -- an IP address, and the apache web server. 1.2.3.4 is a shorthand notation for IPaddr::1.2.3.4, and 1.2.3.5 is a similar shorthand for IPaddr::1.2.3.5. &lt;br /&gt;&lt;br /&gt;Because auto_failback was enabled, when paul joins the cluster it will regain the 1.2.3.4 address. Similarly, when silas joins the cluster, it will regain its (1.2.3.5) service address. If an active/passive configuration is desired, then simply change auto_failback to no. &lt;br /&gt;&lt;br /&gt;The apache resource agent which comes with Heartbeat supports starting multiple instances of Apache by command-line parameters. The parameter which we've given it tells it where to find its configuration file. So, for our example, we've put the files for the 1.2.3.4 server (normally paul) under /apache1dir, and those for the 1.2.3.5 server (normally silas) under /apache2dir. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/authkeys file/etc/ha.d/authkeys must be mode 600. See the section on GeneratingAuthkeysAutomatically for information how to generate good keys automatically. &lt;br /&gt;&lt;br /&gt;auth 1&lt;br /&gt;1 sha1 PutYourSuperSecretKeyHere&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Apache DirectivesTo get the different Apache instances to bind to the correct IP addresses, you have to tell them which IP addresses they should bind to. &lt;br /&gt;&lt;br /&gt;This is done by the Apache Listen directive. In /apache1dir/httpd.cf, this directive should be included &lt;br /&gt;&lt;br /&gt;Listen 1.2.3.4:port-number&lt;br /&gt;&lt;br /&gt;In /apache2dir/httpd.cf, this directive should be included &lt;br /&gt;&lt;br /&gt;Listen 1.2.3.5:port-number&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Init DirectivesIt is important that you not let Apache be started by init at boot time. If you do that, then both init and Heartbeat will "fight" for control of Apache, and it won't work. You have to let Heartbeat control all resources that you include in haresources. To disable Apache from starting at boot time, issue the following command on both paul and silas: &lt;br /&gt;&lt;br /&gt;/sbin/chkconfig apache off&lt;br /&gt;&lt;br /&gt;or if you're using the httpd service script instead of the apache script: &lt;br /&gt;&lt;br /&gt;/sbin/chkconfig httpd off&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-1501612110636760179?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/1501612110636760179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=1501612110636760179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1501612110636760179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1501612110636760179'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/two-apache-web-servers-in-activeactive.html' title='Two Apache Web Servers in an Active/Active Configuration'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-2794756347345473207</id><published>2008-03-29T21:24:00.000+05:30</published><updated>2008-03-29T21:25:07.129+05:30</updated><title type='text'>Apache Web Server HA Configuration</title><content type='html'>A Simple Apache Web Server HA ConfigurationA common configuration for an HA server is simply to provide an IP address and a single service to be failed over. This example will be an active/passive configuration for the Apache web server. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/ha.cf file&lt;br /&gt;logfacility daemon         # Log to syslog as facility "daemon"&lt;br /&gt;node paul silas            # List our cluster members&lt;br /&gt;keepalive 1                # Send one heartbeat each second&lt;br /&gt;deadtime 10                # Declare nodes dead after 10 seconds&lt;br /&gt;bcast eth0 eth1            # Broadcast heartbeats on eth0 and eth1 interfaces&lt;br /&gt;ping 1.2.3.254             # Ping our router to monitor ethernet connectivity&lt;br /&gt;auto_failback no           # Don't fail back to paul automatically&lt;br /&gt;respawn hacluster /usr/lib/heartbeat/ipfail  # Failover on network failures&lt;br /&gt;&lt;br /&gt;See the ipfail page for more information on the respawn directive above. &lt;br /&gt;&lt;br /&gt;In most cases, this file can be identical between the two machines. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/haresources file&lt;br /&gt;paul    1.2.3.4 apache&lt;br /&gt;&lt;br /&gt;The first word (paul) on the line represents the "preferred" host for the service. The remainder of the line is the list of resources (services) which are part of this ResourceGroup. In this example, the sole resource group consists of two resources: an IP address (IPaddr::1.2.3.4) and the Apache web server. Although Heartbeat can use resources which are simply init scripts from /etc/init.d, both of these ResourceAgents are located in /etc/ha.d/resource.d. In every case, this file must be identical on both machines. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/authkeys file/etc/ha.d/authkeys must be mode 600. See the section on GeneratingAuthkeysAutomatically for information how to generate good keys automatically. &lt;br /&gt;&lt;br /&gt;auth 1&lt;br /&gt;1 sha1 PutYourSuperSecretKeyHere&lt;br /&gt;&lt;br /&gt;Except when changing keys, this file must be identical on the two machines. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Apache DirectivesTo get Apache to bind to the correct IP addresses, you have to tell it which IP address it should bind to. &lt;br /&gt;&lt;br /&gt;This is done by the Apache Listen directive. In httpd.cf, include this directive: &lt;br /&gt;&lt;br /&gt;Listen 1.2.3.4:port-number&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Init DirectivesIt is important that you not let Apache be started by init at boot time. If you do that, then both init and Heartbeat will "fight" for control of Apache, and it won't work. You have to let Heartbeat control all resources that you include in haresources. To disable Apache from starting at boot time, issue the following command on both paul and silas: &lt;br /&gt;&lt;br /&gt;/sbin/chkconfig apache off&lt;br /&gt;&lt;br /&gt;or if you're using the httpd service script instead of the apache script: &lt;br /&gt;&lt;br /&gt;/sbin/chkconfig httpd off&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Special ConsiderationsFor the purposes of this example, we assume that somehow the Apache configuration files, and the web site content is being "magically" maintained on both machines and are sufficiently similar that no one will complain when failovers occur between nodes. You can use rsync for this if that meets your needs. Alternatively, one can use shared disk or DRBD when they need to be truly identical to the millisecond.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-2794756347345473207?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/2794756347345473207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=2794756347345473207' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/2794756347345473207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/2794756347345473207'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/apache-web-server-ha-configuration.html' title='Apache Web Server HA Configuration'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-5134078904742259036</id><published>2008-03-29T21:14:00.000+05:30</published><updated>2008-03-29T21:23:10.457+05:30</updated><title type='text'>Clusters</title><content type='html'>&lt;strong&gt;&lt;strong&gt;The High Availability Linux Project&lt;/strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The basic goal of the High Availability Linux project is to: &lt;br /&gt;&lt;br /&gt;Provide a high availability (clustering) solution for Linux which promotes reliability, availability, and serviceability (RAS) through a community development effort. &lt;br /&gt;&lt;br /&gt;The Linux-HA project is a widely used and important component in many interesting High Availability solutions, and ranks as among the best HA software packages for any platform. We estimate that we currently have more than thirty thousand installations up in mission-critical uses in the real world since 1999. Interest in this project continues to grow. These web pages are average nearly 20000 hits per day, and we see more than 100 downloads of Heartbeat per day. &lt;br /&gt;&lt;br /&gt;Heartbeat now ships as part of SUSE Linux, Mandriva Linux, Debian GNU/Linux, Ubuntu Linux, Red Flag Linux, and Gentoo Linux. Ultra Monkey, and several company's embedded systems are also based on it. Although this is called the Linux-HA project, the software is highly portable and runs on FreeBSD, Solaris, and OpenBSD, even on !MacOS/X from time to time. &lt;br /&gt;&lt;br /&gt;There have been many articles and several chapters in books written on this project and software. See the PressRoom for more details. &lt;br /&gt;&lt;br /&gt;We are now competitive with commercial systems similar to those described in D. H. Brown's 1998 or March 2000 analysis of RAS cluster features and functions. This release 2 series brings technologies and basic capabilities which match or exceed the capabilities of many commercial HA systems. We think you'll be surprised. An R2 getting started guide is available. &lt;br /&gt;&lt;br /&gt;We include advanced integration with the DRBD real-time disk replication software, and also work well with the LVS (Linux Virtual Server) project. We expect to continue to collaborate with them in the future, since our goals are complementary. &lt;br /&gt;&lt;br /&gt;We have a page of reference sites to provide a few real-life examples of how organizations both small and large use Heartbeat in production. Submissions for this page are actively encouraged. &lt;br /&gt;&lt;br /&gt;Heartbeat is a leading implementor of the Open Cluster Framework (OCF) standard. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What Linux-HA can do nowHeartbeat currently supports a very sophisticated dependency model for n-node clusters. It is both extremely useful and quite stable at this point in time. The following types of applications are typical: &lt;br /&gt;&lt;br /&gt;Database servers &lt;br /&gt;ERP applications &lt;br /&gt;Web servers &lt;br /&gt;LVS director (load balancer) servers &lt;br /&gt;&lt;br /&gt;Mail servers &lt;br /&gt;Firewalls &lt;br /&gt;File servers &lt;br /&gt;DNS servers &lt;br /&gt;DHCP servers &lt;br /&gt;Proxy Caching servers &lt;br /&gt;Custom applications &lt;br /&gt;etc. &lt;br /&gt;Heartbeat is used in virtually every market segment, industry, and organization size. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Heartbeat&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The Heartbeat program is one of the core components of the Linux-HA (High-Availability Linux) project. Heartbeat is highly portable, and runs on every known Linux platform, and also on FreeBSD and Solaris. Ports to other OSes are also in progress. &lt;br /&gt;&lt;br /&gt;Heartbeat is the first piece of software which was written for the Linux-HA project. It performs death-of-node detection, communications and cluster management in one process. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Sample Cluster Configuration&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In these examples, the server names for our cluster will be paul and silas. The cluster is assumed to send heartbeats on both the eth0 and eth1 ethernet interfaces. The IP addresses which will be used as ServiceAddresses to run services on will be 1.2.3.4 and 1.2.3.5, which are on the 1.2.3.0/24 subnet with the default route pointing to 1.2.3.254. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;a)A Basic Single IP address Configuration&lt;br /&gt;&lt;br /&gt;The most common, basic configuration is that of a high-availability server which simply provides a single IP address (1.2.3.4) to be failed over between the nodes of our cluster. This is an ActivePassive configuration - the most basic configuration. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/ha.cf fileThis is for Heartbeat 1.2.x &lt;br /&gt;&lt;br /&gt;logfacility daemon         # Log to syslog as facility "daemon"&lt;br /&gt;node paul silas            # List our cluster members&lt;br /&gt;keepalive 1                # Send one heartbeat each second&lt;br /&gt;deadtime 10                # Declare nodes dead after 10 seconds&lt;br /&gt;bcast eth0 eth1            # Broadcast heartbeats on eth0 and eth1 interfaces&lt;br /&gt;ping 1.2.3.254             # Ping our router to monitor ethernet connectivity&lt;br /&gt;auto_failback no           # Don't fail back to paul automatically&lt;br /&gt;respawn hacluster /usr/lib/heartbeat/ipfail  # Failover on network failures&lt;br /&gt;&lt;br /&gt;This is for Heartbeat 2.0.x without CRM &lt;br /&gt;&lt;br /&gt;logfacility     daemon&lt;br /&gt;keepalive 1&lt;br /&gt;deadtime 10&lt;br /&gt;warntime 5&lt;br /&gt;initdead 120 # depend on your hardware&lt;br /&gt;udpport 694&lt;br /&gt;ping 1.2.3.254&lt;br /&gt;bcast eth0&lt;br /&gt;auto_failback off&lt;br /&gt;node    paul&lt;br /&gt;node    silas&lt;br /&gt;respawn hacluster /usr/lib/heartbeat/ipfail&lt;br /&gt;use_logd yes&lt;br /&gt;&lt;br /&gt;This is for Heartbeat 2.0.x with CRM &lt;br /&gt;&lt;br /&gt;logfacility     daemon&lt;br /&gt;keepalive 1&lt;br /&gt;deadtime 10&lt;br /&gt;warntime 5&lt;br /&gt;initdead 120 # depend on your hardware&lt;br /&gt;udpport 694&lt;br /&gt;ping 1.2.3.254&lt;br /&gt;bcast eth0&lt;br /&gt;auto_failback off&lt;br /&gt;node    paul&lt;br /&gt;node    silas&lt;br /&gt;use_logd yes&lt;br /&gt;compression     bz2&lt;br /&gt;compression_threshold 2&lt;br /&gt;crm yes&lt;br /&gt;&lt;br /&gt;See the ipfail page for more information on ipfail. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bcast / mcast / ucastIf you want less broadcast traffic, use ucast, which is strictly peer-to-peer. bcast is limited to the logical segment and not routed, while ucast/mcast are potentially routed. ucast duplicates the packets, as it has to be sent to each node and not just broad/multicasted to all of them at the same time. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/haresources fileFor Heartbeat version 2 with CRM, you'll need to modify cib.xml instead of this file. Please see the Basic Single IP address Configuration for version 2 page for details. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;paul    1.2.3.4&lt;br /&gt;&lt;br /&gt;The first word (paul) on the line represents the "preferred" host for the service. The remainder of the line is the list of resources (services) which are part of this ResourceGroup. In this case, there is only one resource -- an IP address. This is a shorthand notation for IPaddr::1.2.3.4. There are many possible variants of how to specify the IP address, to learn about them, see the page on the IPaddr resource agent. &lt;br /&gt;&lt;br /&gt;Note that this address cannot be used for anything else on these machines. In particular, it has to be controlled only by Heartbeat, and cannot be brought up by your operating system at boot time. We call this address a ServiceAddress - which is distinct from an AdministrativeAddress, like those brought up by your operating system. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/authkeys file/etc/ha.d/authkeys must be mode 600. See the section on GeneratingAuthkeysAutomatically for information how to generate good keys automatically. &lt;br /&gt;&lt;br /&gt;auth 1&lt;br /&gt;1 sha1 PutYourSuperSecretKeyHere&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b) An Active/Active Two IP address Configuration&lt;br /&gt;&lt;br /&gt;A common configuration is that of a high-availability server which simply provides two IP addresses (1.2.3.4, and 1.2.3.5) to be failed over between the nodes of our cluster. We will set this up as an active/active configuration. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/ha.cf file&lt;br /&gt;logfacility daemon         # Log to syslog as facility "daemon"&lt;br /&gt;node paul silas            # List our cluster members&lt;br /&gt;keepalive 1                # Send one heartbeat each second&lt;br /&gt;deadtime 10                # Declare nodes dead after 10 seconds&lt;br /&gt;bcast eth0 eth1            # Broadcast heartbeats on eth0 and eth1 interfaces&lt;br /&gt;ping 1.2.3.254             # Ping our router to monitor ethernet connectivity&lt;br /&gt;auto_failback yes          # Try and keep resources on their "preferred" hosts&lt;br /&gt;respawn hacluster /usr/lib/heartbeat/ipfail  # Failover on network failures&lt;br /&gt;&lt;br /&gt;See the ipfail page for more information on ipfail. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/haresources file&lt;br /&gt;paul    1.2.3.4&lt;br /&gt;silas   1.2.3.5&lt;br /&gt;&lt;br /&gt;The first word (paul or silas) on the line represents the "preferred" host for the service. The remainder of the line is the list of resources (services) which are part of this ResourceGroup. In this case, each ResourceGroup consists of only one resource -- an IP address. 1.2.3.4 is a shorthand notation for IPaddr::1.2.3.4, and 1.2.3.5 is a similar shorthand for IPaddr::1.2.3.5. &lt;br /&gt;&lt;br /&gt;Because auto_failback was enabled, when paul joins the cluster it will regain the 1.2.3.4 address. Similarly, when silas joins the cluster, it will regain its (1.2.3.5) service address. If an active/passive configuration is desired, then simply change auto_failback to no. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/ha.d/authkeys file/etc/ha.d/authkeys must be mode 600. See the section on GeneratingAuthkeysAutomatically for information how to generate good keys automatically. &lt;br /&gt;&lt;br /&gt;auth 1&lt;br /&gt;1 sha1 PutYourSuperSecretKeyHere&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-5134078904742259036?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/5134078904742259036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=5134078904742259036' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5134078904742259036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/5134078904742259036'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/clusters.html' title='Clusters'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-6361915377473134215</id><published>2008-03-29T05:41:00.000+05:30</published><updated>2008-03-29T05:42:15.774+05:30</updated><title type='text'>DNS Architecture</title><content type='html'>====================&lt;br /&gt;                          DNS Architecture&lt;br /&gt;     Domain Name Service&lt;br /&gt;    ====================   &lt;br /&gt;     &lt;br /&gt;[i] /etc/hosts [HOSTS.TXT]&lt;br /&gt;    ----------------------&lt;br /&gt;Users like names , NWs like numbers&lt;br /&gt;&lt;br /&gt;Also called Local resolver or local DNS file &lt;br /&gt;&lt;br /&gt;Use of Aliases - historic, generic [www,mail], alternate names [spellings etc]&lt;br /&gt;&lt;br /&gt;[ii] Uses of /etc/hosts &lt;br /&gt;-----------------------&lt;br /&gt;&lt;br /&gt;   * Primary names are used by system to do reverse lookups [ IP - names ]&lt;br /&gt;   * Reverse lookups are reqd to create more readable displays&lt;br /&gt;&lt;br /&gt;             # netstat --inet [-net]&lt;br /&gt;&lt;br /&gt;Active Internet connections (w/o servers)&lt;br /&gt;Proto Recv-Q Send-Q Local Address           Foreign Address         State      &lt;br /&gt;tcp        0      0 ganesh.bom.labs.n:32822 ganesh.bom.labs.net:ftp ESTABLISHED &lt;br /&gt;tcp        0      0 ganesh.bom.labs.net:ftp ganesh.bom.labs.n:32822 ESTABLISHED &lt;br /&gt;tcp        0      0 localhost.localdom:smtp localhost.localdo:32823 TIME_WAIT   &lt;br /&gt;tcp        0      0 localhost.localdom:smtp localhost.localdo:32824 TIME_WAIT   &lt;br /&gt;&lt;br /&gt;Displays open TCP/IP connections and hosts/Ports involved in the connection&lt;br /&gt;&lt;br /&gt;Why use /etc/hosts when we have DNS ?&lt;br /&gt;&lt;br /&gt;A: DNS may not be available at boot time, immediately&lt;br /&gt;&lt;br /&gt;[iii] Limitations of /etc/hosts&lt;br /&gt;-------------------------------&lt;br /&gt;&lt;br /&gt; * Flat file, easy to read/edit, hard to search&lt;br /&gt; * not indexed or encrypted&lt;br /&gt; * Central maint. reqd for new entries [NIC - HOSTS.TXT]&lt;br /&gt;    * Govt agency&lt;br /&gt;    * Enter a whale of new m/c entries everyday&lt;br /&gt;    * Download daily for latest version from NIC so traffic-problems&lt;br /&gt;                      &lt;br /&gt;                         ================&lt;br /&gt;                         B. DNS Hierarchy&lt;br /&gt;                         ================&lt;br /&gt;[i] Structure of DNS &lt;br /&gt;--------------------&lt;br /&gt;&lt;br /&gt;         A  Unix FS v/s DNS Database Comparision study &lt;br /&gt;         =============================================&lt;br /&gt;&lt;br /&gt;    * Distributed, hierarchical DB&lt;br /&gt;    * Localized, not centralized maint. reqd&lt;br /&gt;&lt;br /&gt;    eg     / etc / httpd / conf / httpd.conf  &lt;--------- filename&lt;br /&gt;           /etc  / httpd / remote / httpd.conf &lt;br /&gt;          |&lt;br /&gt;          root of FS       &lt;br /&gt;          -----------------------&gt;&lt;br /&gt;      &lt;--- generic [/] to  specific [file] ---&gt;&lt;br /&gt;&lt;br /&gt;    A hostname on the Internet is exactly the opposite&lt;br /&gt;    &lt;br /&gt;    eg     willy.dolphin.mammals.org. &lt;-------- dot denotes root of DNS tree&lt;br /&gt;            |      |       |      |&lt;br /&gt;      hostname sub-domain domain TLD     &lt;br /&gt;          &lt;-----------------------&lt;br /&gt;      &lt;--- specific [host] to      generic [.] ---&gt;&lt;br /&gt;&lt;br /&gt;willy    -  Name of the computer [hostname -s]&lt;br /&gt;dolphin  -  sub-domain under 'mammals'&lt;br /&gt;mammals  -  Domain we have purchased under 'org'&lt;br /&gt;org      - A TLD&lt;br /&gt;.        - Root node&lt;br /&gt;&lt;br /&gt;    . or root node is like /, the root of the FS&lt;br /&gt;&lt;br /&gt;    Dirs are like domains or more precisely sub-domains&lt;br /&gt;    &lt;br /&gt;    Files are like hosts - or computers with IPs and hostnames &lt;br /&gt;    &lt;br /&gt;    Each domain can be further divided or partitioned in to subdomains, just&lt;br /&gt;    like a dir can be further subdivided into subdirs.&lt;br /&gt;&lt;br /&gt;    Directores use '/' as the seperator. Domains are seperated by '.'.&lt;br /&gt; &lt;br /&gt;Note:&lt;br /&gt;    Subdomains are like dirs unders a parent dir but this dir is not any&lt;br /&gt;    normal dir but appears as a dir bcos it is like a NFS mounted share.&lt;br /&gt;    A dir which is a FS system on some other host. Can be detached but once&lt;br /&gt;    mounted on a particular FS, becomes part of that.&lt;br /&gt;&lt;br /&gt;    Like every dir, a domain name has a unique name and identifies its&lt;br /&gt;    position in the db; Much as a dir's Abs-PN  identifies its place in the&lt;br /&gt;    FS.&lt;br /&gt;    ---------------------------------------------------------------------&lt;br /&gt;    A domain is a sequence of labels from the node at the root of the domain&lt;br /&gt;    to the root of the whole tree, with the labels separated by dots.&lt;br /&gt;&lt;br /&gt;    In Unix, a dir's abs PN is a list of relative names read from root '/' to&lt;br /&gt;    leaf [opp dir to DNS], using a slash to seperate the names.&lt;br /&gt;&lt;br /&gt;    Just as one can have two files with the same name in seperate dirs, &lt;br /&gt;    so can one have two similar hosts but in different domains [nodes].&lt;br /&gt;&lt;br /&gt;    ---------------------------------------------------------------------&lt;br /&gt;    DNS requires that sibling nodes - nodes that are children of the same&lt;br /&gt;    parent - have different labels - This is to ensure uniqueness.&lt;br /&gt;    &lt;br /&gt;      eg  willy.dolphin.mammals.org&lt;br /&gt;          willy.whale.mammals.org&lt;br /&gt;     &lt;br /&gt;       Here the parent is 'mammals' and has 2 siblings - 'dolphin' and&lt;br /&gt;    'whale'. These have to have different labels.&lt;br /&gt;    &lt;br /&gt;          The above 2 are names of 2 machines i.e. they are 2 completely &lt;br /&gt;    different hosts.&lt;br /&gt;&lt;br /&gt;Now examine the similarity with the Unix FS :&lt;br /&gt;&lt;br /&gt;    Similarly, the Unix FS, requires that sibling dirs or files in the same &lt;br /&gt;    dir have different names. This is to ensure uniqueness.&lt;br /&gt; &lt;br /&gt;           Like /usr/local/funny and /usr/bin/funny&lt;br /&gt;&lt;br /&gt;       Here the parent is '/usr' and has 2 siblings - 'local' and&lt;br /&gt;    'bin'. These have to have different labels.&lt;br /&gt;    &lt;br /&gt;          The above 2 are names of 2 subdirs i.e. they are 2 completely &lt;br /&gt;    different directories and subsequently 2 different files although&lt;br /&gt;    they have the same name.&lt;br /&gt;&lt;br /&gt;    ---------------------------------------------------------------------&lt;br /&gt;    &lt;br /&gt;                    Domains and Domain names &lt;br /&gt;                    ------------------------&lt;br /&gt;&lt;br /&gt;    Domains : A subtree of the domain name space&lt;br /&gt;              The domain name of a domain is the same as the domain name of&lt;br /&gt;              the node at the very top of the domain.&lt;br /&gt;&lt;br /&gt;                             "." [root node]   &lt;br /&gt;                              |&lt;br /&gt;                 -----------------------------&lt;br /&gt;                 |            |         |   &lt;br /&gt;                edu          org       com&lt;br /&gt;                |&lt;br /&gt;                |&lt;br /&gt;          ------*&lt;---------- mumbai.edu. node  &lt;br /&gt;          |   mumbai    |    or the domain name of the mumbai.edu domain&lt;br /&gt;          |             |&lt;br /&gt;          |       &lt;------------------- mumbai.edu  domain [name space]&lt;br /&gt;          |             |&lt;br /&gt;          |             |&lt;br /&gt;           -----*-------&lt;br /&gt;&lt;br /&gt;Check out the comparision with the Unix FS :&lt;br /&gt;&lt;br /&gt;                             "/" [root node]   &lt;br /&gt;                              |&lt;br /&gt;                 -----------------------------&lt;br /&gt;                 |            |         |   &lt;br /&gt;                usr          bin       usr&lt;br /&gt;                |&lt;br /&gt;                |&lt;br /&gt;          ------*&lt;---------- /usr/bin/ node  &lt;br /&gt;          |    bin      |    or the dir name of the /usr/bin dir&lt;br /&gt;          |             |&lt;br /&gt;          |       &lt;------------------- /usr/bin/ dir space&lt;br /&gt;          |             |&lt;br /&gt;          |             |&lt;br /&gt;           -----*-------&lt;br /&gt;&lt;br /&gt;      -------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;      A domain name can also be in many domains.&lt;br /&gt;&lt;br /&gt;      Eg the domain name  "maths.mumbai.edu" is a part of the "mumbai.edu"&lt;br /&gt;         domain as well as of the "edu." domain which is once again a part of&lt;br /&gt;  the . domain. &lt;br /&gt;&lt;br /&gt;  All DNS servers are in the . domain &lt;br /&gt;&lt;br /&gt;                             "." [root node]   &lt;br /&gt;                              |&lt;br /&gt;                 -----------------------------&lt;br /&gt;      +-------------------+    |         |   &lt;br /&gt;      |         edu       |  org       com&lt;br /&gt;      |         |         |&lt;br /&gt;      |         |         |&lt;----------- edu domain &lt;br /&gt;      |  ---------------  |                &lt;br /&gt;      |  |   mumbai    |&lt;--------------- mumbai.edu domain&lt;br /&gt;      |  |  ---------  |  |&lt;br /&gt;      |  |  | maths &lt;-----|------------- maths.mumbai.edu domain&lt;br /&gt;      |  |  | bio   &lt;-----|------------- bio.mumbai.edu   domain&lt;br /&gt;      |  |  ---------  |  |&lt;br /&gt;      |  |-----*-------|  |&lt;br /&gt;      |                   |&lt;br /&gt;       -------------------&lt;br /&gt;&lt;br /&gt;                        SubDomain Delegation &lt;br /&gt;                        --------------------&lt;br /&gt;&lt;br /&gt;  One of the main goals of the DNS was to decentralize administration.&lt;br /&gt;  How is this done ?&lt;br /&gt;&lt;br /&gt;  Consider the CEO of a large Corp. How does she delegate responsibility?&lt;br /&gt;&lt;br /&gt;                               CEO  [BOSS]     [ "." root node or / ]&lt;br /&gt;                                |&lt;br /&gt;                ----------------------------------&lt;br /&gt;               |           |            |         |     &lt;br /&gt;              MKTG       SALES         HRD      ACCTS [Depts or gTLDs or TLDirs]&lt;br /&gt;               |&lt;br /&gt;               | Mr M&lt;br /&gt;         -----------------------&lt;br /&gt;        |           |          |&lt;br /&gt;        LOCAL     INTL      PLANNING &lt;br /&gt;        |                                  [sub-Depts or sub-domains delegated &lt;br /&gt;        |                                   by Mr M to Mr L, Mr I, Mr P]&lt;br /&gt;        Mr L      Mr I       Mr P   &lt;br /&gt;         |&lt;br /&gt;   -----------------------       &lt;br /&gt;   |           |         |&lt;br /&gt;   RJ         TN         WB&lt;br /&gt;   Mr R       Mr T      Mr W&lt;br /&gt;                      ---------&lt;br /&gt;        |       |&lt;br /&gt;        KOL     DARJEELING&lt;br /&gt;                       |&lt;br /&gt;                   Mr WW [WW.KOL.WB.LOCAL.MKTG.CEO]&lt;br /&gt;&lt;br /&gt;   She breaks up the org into Depts. Each with its own head.&lt;br /&gt;   &lt;br /&gt;   The Head has total responsibility for his Dept.&lt;br /&gt;   &lt;br /&gt;   The Dept is created by the CEO and hence cannot be made without the CEO &lt;br /&gt;   knowing about it.&lt;br /&gt;   &lt;br /&gt;   That is, its made by the CEO and total responsibility is delegated to the &lt;br /&gt;   Dept Head to handle his Dept.&lt;br /&gt;   &lt;br /&gt;   The Dept Head CAN create more sub-Depts under his Dept, without consulting&lt;br /&gt;   the CEO. He has total authority over his Dept [domain]&lt;br /&gt;   He is said to be authorative over his Dept [domain]&lt;br /&gt;&lt;br /&gt;   CEO only knows about Depts but nothing about the sub-Depts [sub-domains].&lt;br /&gt;   &lt;br /&gt;   Why ?&lt;br /&gt;   &lt;br /&gt;   She does not have to.&lt;br /&gt;   &lt;br /&gt;   That would mean redundancy of information [extra work]. &lt;br /&gt;   All she has to know is the Dept Head and she can procure whatever info she &lt;br /&gt;   needs about sub-Depts etc from the respective Dept Head concerned.&lt;br /&gt;   &lt;br /&gt;   After all, what is he being paid for if she has to keep all his sub-Dept&lt;br /&gt;   information !! And all other sub-Depts too.&lt;br /&gt;&lt;br /&gt;   This is called "Department Delegation". &lt;br /&gt;&lt;br /&gt;   The parent Dept [domain] retains only pointers to sources of the&lt;br /&gt;   sub-Depts [sub-domains] data, so that it can refer queries there.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   Now what would happen if I asked the CEO his Question ?&lt;br /&gt;&lt;br /&gt;   Where is Mr W or  WB.LOCAL.MKTG.CEO ?&lt;br /&gt;&lt;br /&gt;   The CEO would not directly answer this query. &lt;br /&gt;   &lt;br /&gt;   It would refer me to MKTG.CEO. i.e. to Mr M &lt;br /&gt;   &lt;br /&gt;   I would then have to ask [Mr M] MKTG.CEO which would refer me to &lt;br /&gt;   LOCAL.MKTG.CEO. [Mr L] &lt;br /&gt;   &lt;br /&gt;   I would then have to ask Mr L who would finally direct me to Mr W at &lt;br /&gt;   WB.LOCAL.MKTG.CEO&lt;br /&gt;&lt;br /&gt;   I have found my man !&lt;br /&gt;&lt;br /&gt;   This referral business is called 'recursive querying' and most DNS&lt;br /&gt;   servers are non-recursive , in that, they just put you on the path to&lt;br /&gt;   another server.&lt;br /&gt;&lt;br /&gt;   ---------------------------------------------------------------------- &lt;br /&gt;&lt;br /&gt;   NOW LET'S SEE HOW DNS DOES DOMAIN DELEGATION  &lt;br /&gt;&lt;br /&gt;                             "." [root node]   &lt;br /&gt;                              |&lt;br /&gt;                 -----------------------------&lt;br /&gt;                 |            |         |   &lt;br /&gt;                edu          org       com&lt;br /&gt;                |&lt;br /&gt;   -------------------------------&lt;br /&gt;  |           |           -------|---------      &lt;br /&gt;  kolkatta chennai        |    mumbai     |&lt;br /&gt;                          |      |        |&lt;br /&gt;                          | ------------  |    &lt;br /&gt;                          | |          |  |&lt;br /&gt;                          | kalina    fort|&lt;br /&gt;                          |               |&lt;br /&gt;                          -----------------&lt;br /&gt;&lt;br /&gt;  The "." is controlled by ICANN.  [Int'l Corp for Assigned Names/Nos]&lt;br /&gt;  "edu" domain is controlled by Network Solutions.&lt;br /&gt;  Network Solutions has sub-domains kolkatta, chennai and mumbai.&lt;br /&gt;&lt;br /&gt;  Network Solutions can handle all the data there, but why should it ? &lt;br /&gt;&lt;br /&gt;  It therefore delegates the subdomain "mumbai.edu' to the folks at Mumbai&lt;br /&gt;  to manage. &lt;br /&gt;&lt;br /&gt;  The folks at mumbai have total authority over this domain now and can&lt;br /&gt;  create more domains [subdomains et al] and they do.&lt;br /&gt;&lt;br /&gt;  They create "kalina.mumbai.edu" and "fort.mumbai.edu" and let the folks&lt;br /&gt;  at Kalina and Fort handle those domains.&lt;br /&gt;&lt;br /&gt;  At Kalina Office : shiva.kalina.mumbai.edu&lt;br /&gt;                     ganesh.kalina.mumbai.edu&lt;br /&gt;&lt;br /&gt;                     Some two hosts at the Kalina office.&lt;br /&gt;&lt;br /&gt;  At Fort Office :   shiva.fort.mumbai.edu&lt;br /&gt;                     ganesh.fort.mumbai.edu&lt;br /&gt;&lt;br /&gt;                     Some two hosts at the Fort office.&lt;br /&gt;&lt;br /&gt;   Now I do "ping shiva.fort.mumbai.edu". &lt;br /&gt;&lt;br /&gt;   The query would go to "." which would direct me to a server which handles&lt;br /&gt;   the "edu" domain. The "edu" domain knows about the "mumbai" subdomain, so&lt;br /&gt;   it directs me another DNS server which knows all about the "mumbai.edu"&lt;br /&gt;   domain. Once there, this server again directs me to another DNS server&lt;br /&gt;   which know all about "fort.mumbai.edu" domains.&lt;br /&gt;&lt;br /&gt;   At the DNS server which handles the "fort.mumbai.edu" domain, I finally&lt;br /&gt;   find a RR [Resource Record] which is something like this :&lt;br /&gt;&lt;br /&gt;   shiva.fort.mumbai.edu.    IN    A    192.168.0.10&lt;br /&gt;&lt;br /&gt;   And at last, I have the DNS-resolved IP of my shiva.fort.mumbai.edu !&lt;br /&gt;&lt;br /&gt;   The programs which store info about the domain name space are called&lt;br /&gt;   "name servers" and, yes, one of these prgs was running on this last&lt;br /&gt;   machine which solved by problem.&lt;br /&gt;&lt;br /&gt;   Let's do some light stuff now !&lt;br /&gt;&lt;br /&gt;[ii] gTLDS : Global Top-Level Domains&lt;br /&gt;---------------------------------------&lt;br /&gt;&lt;br /&gt;    *  com, .edu, .gov, .int, .mil, .net, .org  [in US]&lt;br /&gt;&lt;br /&gt;DNS Database  :&lt;br /&gt;-------------                ICANN -   [Int'l Corp for Assigned Names/Nos]&lt;br /&gt;                                       Responsible for managing domain name&lt;br /&gt;                                       space&lt;br /&gt;&lt;br /&gt;                                "." [root node]   Managed by ICANN&lt;br /&gt;                                 |&lt;br /&gt;     -------------------------------------------------------------------&lt;br /&gt;     |           |            |         |           |          |       |&lt;br /&gt;    org         int          gov       edu         mil        net     com&lt;br /&gt;---------    [Int' orgs]                      &lt;br /&gt;|       |&lt;br /&gt;fish   mammals&lt;br /&gt;|  |     |&lt;br /&gt;        ---------------&lt;br /&gt;        |       |     |&lt;br /&gt;      dolphin whale  bat&lt;br /&gt;        |       |     |&lt;br /&gt;      willy  hector  blindy       &lt;br /&gt;&lt;br /&gt;      Hence, willy.dolphin.mammals.org is a host on the DNS DB system&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Consider the similarity to the Unix FS :&lt;br /&gt;&lt;br /&gt;                                 / &lt;br /&gt;                                 |&lt;br /&gt;     -------------------------------------------------------------------&lt;br /&gt;     |           |            |         |           |          |       |&lt;br /&gt;    etc         usr          lib       int         mil        net     org&lt;br /&gt; --------   &lt;br /&gt;|       |&lt;br /&gt;       httpd&lt;br /&gt;        |&lt;br /&gt;        conf&lt;br /&gt;        |&lt;br /&gt;      --------&lt;br /&gt;     |       | &lt;br /&gt;httpd.conf  src.conf&lt;br /&gt;&lt;br /&gt;    Geopolitical domains : ccTLDs or ISO country codes - eg .uk, .de, .in&lt;br /&gt;&lt;br /&gt;    2nd Level registration under ccTLDS : eg amazon.de, amazon.co.uk&lt;br /&gt;&lt;br /&gt;    3nd level domains as states of the US : .ca.us, .ny.us&lt;br /&gt;&lt;br /&gt;    Eg: 'mammals' is the 2nd level domain purchased and is registered under&lt;br /&gt;         the gTLD - 'net'&lt;br /&gt;&lt;br /&gt;[iii] Reverse Domains : &lt;br /&gt;-----------------------&lt;br /&gt;&lt;br /&gt;* Addr to Name conversion &lt;br /&gt;* Reverse lookups are reqd to create more readable o/p displays  / logs etc&lt;br /&gt;* They are called RDs, since they are written in the reverse order&lt;br /&gt;&lt;br /&gt;Consider :    /etc/hosts&lt;br /&gt;&lt;br /&gt;              192.168.0.10  crow.birds.org  &lt;br /&gt;        -----------------------------------------------&lt;br /&gt;        Consider the hostname :                   --------------- [A]&lt;br /&gt;        &lt;br /&gt;                crow      .birds.    org&lt;br /&gt;                &lt;br /&gt;         &lt;-------- specific [host] ----------&gt; generic [.]&lt;br /&gt;                 host      domain    gTLD &lt;br /&gt;        &lt;br /&gt;        -----------------------------------------------&lt;br /&gt;        &lt;br /&gt;        Now consider the IP :                       --------------- [B]&lt;br /&gt;               &lt;br /&gt;                  192.168.0.       10&lt;br /&gt;               &lt;--NW portion--&gt; &lt;Host IP/DNS IP&gt;&lt;br /&gt;&lt;br /&gt;               &lt;br /&gt;                 generic ---------&gt; specific&lt;br /&gt;&lt;br /&gt;        -----------------------------------------------&lt;br /&gt;&lt;br /&gt;   Bcos the structure of an IP addr [B] is the opposite of the domainname [A],&lt;br /&gt;   to create a 'Reverse Domain Name' we reverse the IP address &lt;br /&gt;&lt;br /&gt;                   10.0.168.192.in-addr.arpa.&lt;br /&gt;&lt;br /&gt;     'in-addr.arpa.' is a special TLD domain in which all reverse domains are&lt;br /&gt;     located.&lt;br /&gt;               &lt;br /&gt;                                 . [Reverse Domain root DNS servers]&lt;br /&gt;                                 |&lt;br /&gt;                                arpa&lt;br /&gt;                                 |&lt;br /&gt;                               in-addr&lt;br /&gt;       -------------------------------------------------------------------&lt;br /&gt;       |           |            |         |           |          |       |&lt;br /&gt;     192.168&lt;br /&gt;       |&lt;br /&gt;     -------&lt;br /&gt;     |-&gt;|-&gt;|&lt;br /&gt;     0  1 255&lt;br /&gt;     |&lt;br /&gt;     -------&lt;br /&gt;     |  |  |      &lt;br /&gt;     1-&gt;40 254&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-6361915377473134215?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/6361915377473134215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=6361915377473134215' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6361915377473134215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6361915377473134215'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/dns-architecture.html' title='DNS Architecture'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-1582014836257705874</id><published>2008-03-29T05:36:00.000+05:30</published><updated>2008-03-29T05:39:36.206+05:30</updated><title type='text'>SSH</title><content type='html'>&lt;br /&gt;&lt;strong&gt;OpenSSH Open Secure Shell&lt;br /&gt;&lt;/strong&gt;supports both : SSH1 [rsa] / SSH2 [dsa] protocols&lt;br /&gt;OpenSSH suite :&lt;br /&gt;1. sshd - server&lt;br /&gt;2. ssh - client&lt;br /&gt;3. ssh-keygen&lt;br /&gt;4. ssh-agent&lt;br /&gt;5. ssh-add&lt;br /&gt;6. sftp-server&lt;br /&gt;7. sftp&lt;br /&gt;8. scp&lt;br /&gt;============================&lt;br /&gt;* Replacement for the dangerously insecure Berkely r cmds : rlogin, rcp and rsh&lt;br /&gt;* Whenever you telnet or FTP (not anonymous FTP) to a remote machine, you are&lt;br /&gt;asked to identify yourself by giving your login name and a password.&lt;br /&gt;=========================&lt;br /&gt;Case I - without any keys&lt;br /&gt;=========================&lt;br /&gt;Server&lt;br /&gt;[ganesh]&lt;br /&gt;======&lt;br /&gt;1. # adduser foo&lt;br /&gt;passwd ....&lt;br /&gt;2. # service sshd restart&lt;br /&gt;You OpenSSH server is now up&lt;br /&gt;Client&lt;br /&gt;[brahma]&lt;br /&gt;======&lt;br /&gt;1. login as 'foo'&lt;br /&gt;2. # ssh -l foo ganesh&lt;br /&gt;* The first time around it will ask you if you wish to add the remote host&lt;br /&gt;ganesh to a list of "known_hosts"; go ahead and say yes. After saying yes,&lt;br /&gt;and if there is an account on the remote system ganesh named foo, it will&lt;br /&gt;prompt you for foo's password on the remote system [ganesh].&lt;br /&gt;* If you type in the remote password correctly it should let you in.&lt;br /&gt;3. Type 'yes'&lt;br /&gt;4. Put you password which you gave on the remote SSH server for foo [a VLU]&lt;br /&gt;* You are remotely logged in with ssh on ganesh. Just like telnet but secure.&lt;br /&gt;* Examine your home on brahma [client] : /home/foo/.ssh/known_hosts&lt;br /&gt;Will contain the sshd server name and a DSA algol key.&lt;br /&gt;* The server you just successfully connected to is now a _known_host_&lt;br /&gt;[sshd server ganesh is now a known host server]&lt;br /&gt;* The next time you ssh to ganesh, this file is verified and now you will only&lt;br /&gt;be asked for a password.&lt;br /&gt;* The 'mitm' [man-in-the-middle] attack could still trip you dangerously&lt;br /&gt;===================&lt;br /&gt;Case II - with keys&lt;br /&gt;===================&lt;br /&gt;Client&lt;br /&gt;[brahma]&lt;br /&gt;==========&lt;br /&gt;1. Login as foo&lt;br /&gt;2. ssh-keygen -d&lt;br /&gt;or -t rsa &lt;--- to generate a rsa key&lt;br /&gt;* Will autom generate a DSA public-private key pair of 1,024 bits.&lt;br /&gt;* Press CR for the default file name to save the keys in :&lt;br /&gt;/home/foo/.ssh/id_dsa&lt;br /&gt;* Subsequently, you'll be asked for a passphrase (password) with confirmation.&lt;br /&gt;* This can be anything and can be very long. Over 600 characters will be&lt;br /&gt;accepted in the passphrase.&lt;br /&gt;* The point is that passphrases are not supposed to be like your normal&lt;br /&gt;password and should be much longer and kept just as secret as your normal&lt;br /&gt;password.&lt;br /&gt;* After you've typed in a passphrase twice it will spit out a long string of&lt;br /&gt;numbers with your username@hostaddress at the end. Should look something&lt;br /&gt;like this:&lt;br /&gt;Your public key is:&lt;br /&gt;ssh-dss AAAAB3NzaC1kc3MAAACBANTlkP9edHvaSnr+QDxD3cdJFOpOiGHTultOlp5J7RWzpENIb/AnK0iuYubCErYgGDiyqzR4duXD4V+zNy0vI1++pdFjpkN1h0X1RaCaJ04SnSca7jfnG7Pt65sYNoTldNl20RUZBmb/NbBttWBvLJxsGGs0pawYxXFSlhI7COhBAAAAFQCRW47ddyLK71XJu4vEY38OjpxAvwAAAIBCC+Ki98tAtmwFL+Sdvxxr1HA3bHQSqBUxOZawOkB7ri0l93o/wMcl8e20N+ffrGnVyc7DgI8klt2qXrJQ9LBasLl9aJR+HfUzOGfA8lSdJlxgAfFxHzOXVqgQ7OXhYKsHCs6MwixsuxSH0Nuaw2x4ZLs0ti09KJPwoL0gF8ptNgAAAIBA4MYs/MbtI1dkzk2ltq+vyOVVDuLdhTrMdCfLHGJWUij6wgbCe7wGwDOIR493LrUkgJkB01qru1qHRr1WAzlR/ZZ2Sv0CVsrRCBFN3etrMWhICl/1wV/3Cp7hev1gfjNY2GgXIo51ujIU/yFgQna83Paf2s43e9l7MmB5LdwctA== bar@brahma.bom.labs.net&lt;br /&gt;* However your terminal program will have wrapped the long lines around so&lt;br /&gt;that it all fits on one screen. It's important to keep in mind though that&lt;br /&gt;the string of numbers is and must all be on one line as it is shown above.&lt;br /&gt;* The big line above consists of 4 sections. It's important that each of&lt;br /&gt;those sections have no spaces in them. The first section is the bit level&lt;br /&gt;and is usually going to be 1024, the second section is the salt, the third&lt;br /&gt;is the actual key and the forth section is the user@host identification.&lt;br /&gt;* You will be asked this paraphrase whenever you access the sshd machine.&lt;br /&gt;* You will notice a new dir created in your home : /home/foo/.ssh/&lt;br /&gt;The public and private keys just generated stored viz :&lt;br /&gt;/home/foo/.ssh/&lt;br /&gt;---------------&lt;br /&gt;private key : /home/foo/.ssh/id_dsa&lt;br /&gt;public key : /home/foo/.ssh/id_dsa.pub&lt;br /&gt;* That's all on the client side !&lt;br /&gt;Server-side Config&lt;br /&gt;[ganesh]&lt;br /&gt;==================&lt;br /&gt;1. Login as root.&lt;br /&gt;2. # service sshd start&lt;br /&gt;3. # su - 'foo'&lt;br /&gt;4. # mkdir .ssh&lt;br /&gt;5. # cd /home/foo/.ssh/&lt;br /&gt;6. Copy &amp;amp; Rename the file : /home/foo/.ssh/id_dsa.pub from 'brahma' [Client]&lt;br /&gt;to /home/foo/.ssh/authorized_keys on 'ganesh' using scp or ftp or whatever!&lt;br /&gt;Lets see the contents of foo on brahma w/o logging in&lt;br /&gt;a. # ssh brahma ls&lt;br /&gt;Now lets copy the file /home/foo/.ssh/id_dsa.pub from 'brahma'&lt;br /&gt;here and rename it as authorized_keys&lt;br /&gt;b. scp brahma:.ssh/id_dsa.pub authorized_keys&lt;br /&gt;7. Make sure the perms of /home/foo/.ssh/authorized_keys file on server 'ganesh'&lt;br /&gt;is 600 i.e. R/W only by foo&lt;br /&gt;# chmod 600 authorized_keys&lt;br /&gt;8. Make sure dir /home/foo/.ssh/ has perms of 700&lt;br /&gt;chmod 700 /home/foo/.ssh/&lt;br /&gt;Alert !!! ---&gt; Make sure 7 and 8 are satisfied otherwise ssh will not work&lt;br /&gt;&lt;br /&gt;Execution :&lt;br /&gt;=========&lt;br /&gt;1. Login from client [brahma] to server [ganesh] as foo.&lt;br /&gt;# ssh -l foo ganesh&lt;br /&gt;2. You will now be prompted for your paraphrase.&lt;br /&gt;* This will be matched with your local [brahma] private key and not the&lt;br /&gt;password of foo on ganesh. [/home/foo/.ssh/id_dsa]&lt;br /&gt;* If it matches a request will be sent to the SSH server running on&lt;br /&gt;"ganesh:22".&lt;br /&gt;* The SSH client on the local machine brahma contacts the sshd daemon on the&lt;br /&gt;remote SSH server [ganesh].&lt;br /&gt;* The client tells the server that a user 'foo' wants to connect.&lt;br /&gt;* The server then examines who made the request - 'foo'&lt;br /&gt;* It will check whether 'foo' is a VLU in /etc/passwd.&lt;br /&gt;* If OK, then it will create a challenge using the public key file you had&lt;br /&gt;copied to foo's home on the server, before, from foo's home on brahma :&lt;br /&gt;/home/foo/.ssh/authorized_keys&lt;br /&gt;Remember we had renamed it ?&lt;br /&gt;* If an entry is there for a public key corresponding to the user, the server&lt;br /&gt;generates a random message, constructs an MD5 message digest and encrypts it&lt;br /&gt;with the user's public key - which is now the above file&lt;br /&gt;* This is then sent to the client [brahma].&lt;br /&gt;* The client looks in this identification file aka private key. Since only&lt;br /&gt;the client has the corresponding private key, which is :&lt;br /&gt;[/home/foo/.ssh/id_dsa] on brahma&lt;br /&gt;it can only decrypt the message. This results in the message digest.&lt;br /&gt;* Now the client computes a checksum of the message digest and sends it back to&lt;br /&gt;the server.&lt;br /&gt;* The server then computes the checksum of the message digest it had sent to the&lt;br /&gt;client. If this checksum and the checksum received from the client are the&lt;br /&gt;same, then the client can be trusted to have the correct private key, and the&lt;br /&gt;authentication procedure is completed.&lt;br /&gt;* You normally give foo's local login passwd on server to access FTP etc.&lt;br /&gt;But here that is never asked.&lt;br /&gt;* Never once are you prompted for any password at all.&lt;br /&gt;* Hence, sshd never uses passwords to login and that is one huge leap&lt;br /&gt;as far as security consciousness is concerned !&lt;br /&gt;&lt;br /&gt;======================&lt;br /&gt;Case III&lt;br /&gt;ssh-agent* and ssh-add*&lt;br /&gt;=======================&lt;br /&gt;* How about starting a SSH session, fully secure and never having to enter a&lt;br /&gt;password or even the passphrase too ?&lt;br /&gt;* Well, weird as it sounds security-wise, this is exactly what the ssh-agent&lt;br /&gt;does on the client&lt;br /&gt;* Now try this :&lt;br /&gt;Client&lt;br /&gt;[brahma]&lt;br /&gt;========&lt;br /&gt;1. Login as foo&lt;br /&gt;2. Append the following line to and relogin as foo:&lt;br /&gt;/home/foo./.bash_profile&lt;br /&gt;========================&lt;br /&gt;eval `ssh-agent`&lt;br /&gt;or from the cmd line : # eval $(ssh-agent)&lt;br /&gt;You should now see a message like : Agent pid [number]&lt;br /&gt;* The authentication agent must be running and must be an ancestor of the&lt;br /&gt;current process for ssh-add to work. You need the shell's eval cmd for this.&lt;br /&gt;* ssh-agent executes several commands, creates an PID file and sets some&lt;br /&gt;system env variables.&lt;br /&gt;3. Re-login and the ssh-agent will now be running as 'foo'&lt;br /&gt;4. Now do this :&lt;br /&gt;# ssh-add ----&gt; will load SSH2 keys - The DSA ones&lt;br /&gt;or&lt;br /&gt;# ssh-add .ssh/id_rsa ----&gt; will load SSH1 keys - The RSA ones&lt;br /&gt;Enter the paraphrase you had entered the first time you made the private&lt;br /&gt;keys on the client.&lt;br /&gt;If it matches, you will get the following message :&lt;br /&gt;Identity added : /home/foo/.ssh/id_rsa (/home/foo/.ssh/id_rsa)&lt;br /&gt;5. Try this now :&lt;br /&gt;# ssh -l foo ganesh&lt;br /&gt;And you are in - without password authentication, but totally secure !&lt;br /&gt;* Luckily, ssh-agent doesn't remember the information after you logout.&lt;br /&gt;Otherwise, once a passphrase was entered with ssh-add, the security of a&lt;br /&gt;protected passphrase would be pointless if somebody broke into your system.&lt;br /&gt;* So after you logout, you will have to do a 'ssh-add' for the session&lt;br /&gt;* The agent is only valid for the duration of the session&lt;br /&gt;&lt;br /&gt;scp*&lt;br /&gt;Copy files securely&lt;br /&gt;&lt;br /&gt;* SSH gives you access to a set of commands and a shell on a remote machine.&lt;br /&gt;By itself, it does not enable you to copy files, it however provides the&lt;br /&gt;'scp'command.&lt;br /&gt;- You are foo, logged in to Client brahma&lt;br /&gt;- You wish to copy a file foo1 from your home on the ssh server&lt;br /&gt;ganesh to your home on the remote client brahma or wherever&lt;br /&gt;you are currently logged in&lt;br /&gt;ganesh brahma&lt;br /&gt;[ssh server] [client]&lt;br /&gt;============= ========&lt;br /&gt;/home/foo : /home/foo :&lt;br /&gt;========== ==========&lt;br /&gt;-&gt; Copy file foo1 from ganesh&lt;br /&gt;# ls # ls&lt;br /&gt;# foo1 foo2 # scp ganesh:foo1 . [dot is mandatory]&lt;br /&gt;# ls&lt;br /&gt;# foo1&lt;br /&gt;-&gt; Copy file /etc/hosts from ganesh&lt;br /&gt;# scp ganesh:/etc/hosts .&lt;br /&gt;# ls&lt;br /&gt;# foo1 hosts&lt;br /&gt;# ls&lt;br /&gt;-&gt; Copy file foo1 to ganesh's /tmp&lt;br /&gt;# scp foo1 ganesh:/tmp&lt;br /&gt;&lt;br /&gt;-&gt; Copy file foo3 to foo's home on ganesh&lt;br /&gt;# scp foo3 ganesh:&lt;br /&gt;# cd .ssh/&lt;br /&gt;----&gt; foo's own config file # vi config&lt;br /&gt;for global use Host *gbln&lt;br /&gt;/etc/ssh/ssh_config HostName ganesh.bom.labs.net&lt;br /&gt;User foo&lt;br /&gt;ForwardAgent yes&lt;br /&gt;Now use will be able to do this :&lt;br /&gt;# scp foo3 gbln:&lt;br /&gt;* 'scp' assumes your home directory on the server to be your current working&lt;br /&gt;directory, so if you are using relative paths for the server, they have to&lt;br /&gt;be relative to the location of your home dir on that machine.&lt;br /&gt;* Using the -r switch for 'scp', you can also copy directories recursively.&lt;br /&gt;* 'scp' also allows you to copy files between two remote machines other&lt;br /&gt;than your own, of course.&lt;br /&gt;* Now you might be tempted to try something like this:&lt;br /&gt;You open an SSH connection to ganesh.bom.labs.net. Once you are&lt;br /&gt;logged in, you type&lt;br /&gt;# scp brahma:b1 .&lt;br /&gt;to copy the local file 'b1' to the remote server you are currently logged&lt;br /&gt;in. Most likely you will get a message like :&lt;br /&gt;ssh: secure connection to [brahma machine] refused&lt;br /&gt;What has happened is that you executed the remote version of 'scp', and&lt;br /&gt;it tried to connect to a non-existant SSH server running on your machine&lt;br /&gt;which is brahma !!&lt;br /&gt;MOTS :&lt;br /&gt;Remember to run 'scp' always from a local terminal, unless your machine&lt;br /&gt;[brahma] also runs an SSH server.&lt;br /&gt;&lt;br /&gt;sftp*&lt;br /&gt;Copy files securely with sftp&lt;br /&gt;&lt;br /&gt;* If you prefer a more 'ftp-ish' approach, try 'sftp'&lt;br /&gt;* 'sftp' establishes an SSH tunneled FTP connection to a server and allows you&lt;br /&gt;to use most of the standard FTP command set.&lt;br /&gt;* Since version 2.0.7, the popular graphical FTP client - gftp - supports&lt;br /&gt;sftp-transfers, which makes up for sftp's somewhat limited feature set.&lt;br /&gt;[we are using gftp-2.0.14-2 in RHL9]&lt;br /&gt;[foo@brahma foo]$ sftp ganesh&lt;br /&gt;You will be asked for the paraphrase :&lt;br /&gt;sftp&gt;&lt;br /&gt;* The sshd server starts up the sftp server auto on connect by the sftp&lt;br /&gt;client.&lt;br /&gt;This sftp-server is : /usr/libexec/openssh/ftp-server&lt;br /&gt;'sftp' will activate this server automatically upon connect, and you'll need&lt;br /&gt;no extra permissions on the remote server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configuring the OpenSSH -&lt;br /&gt;&lt;/strong&gt;Server and Client&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configuring the The OpenSSH client - /usr/bin/ssh&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Configuring The Client : Global client config file : /etc/ssh/ssh_config&lt;br /&gt;Per user config file : $HOME/.ssh/config&lt;br /&gt;[by def: dir / file nonexistant]&lt;br /&gt;OpenSSH knows three configuration levels:&lt;br /&gt;* command line options&lt;br /&gt;* User configuration file&lt;br /&gt;* System-wide configuration file ('/etc/ssh/ssh_config').&lt;br /&gt;* Options given on the command line prevail over configuration file options&lt;br /&gt;* Options given in the user's configuration file prevail over those in the&lt;br /&gt;system-wide configuration file.&lt;br /&gt;* All command line options are available as configuration file options.&lt;br /&gt;* Since there is no user config file installed by default and hence, no&lt;br /&gt;$HOME/.ssh/ dir, copy and rename '/etc/ssh/ssh_config' to '~/.ssh/config'&lt;br /&gt;(or edit '/etc/ssh/ssh_config' as 'root').&lt;br /&gt;* The standard config file looks like this:&lt;br /&gt;[lots of explanations and possible options listed]&lt;br /&gt;# Be paranoid by default&lt;br /&gt;Host *&lt;br /&gt;ForwardAgent no&lt;br /&gt;ForwardX11 no&lt;br /&gt;FallBackToRsh no&lt;br /&gt;* The config file is read sequentially, i.e. the first setting that matches a&lt;br /&gt;pattern 'wins'.&lt;br /&gt;* Let's say you have an account at ganesh.bom.labs.net and your account name&lt;br /&gt;is 'foo'.&lt;br /&gt;* Furthermore you want to use the 'ssh-agent' - 'ssh-add' combo (see before) as&lt;br /&gt;well as data compression to speed up transfers.&lt;br /&gt;* And since you are too lazy to type the full hostname every time, you want to&lt;br /&gt;use 'gbln' as an abbreviation for 'ganesh.bom.labs.net'&lt;br /&gt;* Your config file should then look like this:&lt;br /&gt;Host *gbln&lt;br /&gt;HostName ganesh.bom.labs.net&lt;br /&gt;User foo&lt;br /&gt;ForwardAgent yes&lt;br /&gt;Compression yes&lt;br /&gt;# Be paranoid by default&lt;br /&gt;Host *&lt;br /&gt;ForwardAgent no&lt;br /&gt;ForwardX11 no&lt;br /&gt;FallBackToRsh no&lt;br /&gt;* Next time, as foo, you enter :&lt;br /&gt;# ssh gbln&lt;br /&gt;SSH will look up the full hostname, use your user name to login and&lt;br /&gt;authenticate using the key managed by the 'ssh-agent'. It can't get much&lt;br /&gt;easier than that, can it?&lt;br /&gt;* SSH connections to all other hosts will still use the 'paranoid' default&lt;br /&gt;settings, the configured accounts only those paranoid settings which haven't&lt;br /&gt;been explicitly turned off in their configuration or on the command line.&lt;br /&gt;* In the example above, an SSH connection to ganesh.bom.labs.net will have these&lt;br /&gt;options set to 'yes': 'ForwardAgent' and 'Compression', these options,&lt;br /&gt;however, will still be set to 'no' unless overridden by command line arguments&lt;br /&gt;: 'ForwardX11' and 'FallBackToRsh'.&lt;br /&gt;* Further options you might want to have a look at include:&lt;br /&gt;&lt;li&gt;&lt;code&gt;CheckHostIP yes&lt;/code&gt;&lt;br /&gt;This option performs an&lt;br /&gt;additional IP address check on the remote host to prevent&lt;br /&gt;DNS spoofing.&lt;br /&gt;&lt;li&gt;&lt;code&gt;CompressionLevel&lt;/code&gt;&lt;br /&gt;The compression level&lt;br /&gt;ranges from '1' (fast) to '9' (best). Default is '6'.&lt;br /&gt;&lt;li&gt;&lt;code&gt;ForwardX11 yes&lt;/code&gt;&lt;br /&gt;You will need this option&lt;br /&gt;to run remote X applications locally.&lt;br /&gt;&lt;li&gt;&lt;code&gt;LogLevel DEBUG&lt;/code&gt;&lt;br /&gt;This option comes in&lt;br /&gt;handy when you've got trouble with your SSH connection. The&lt;br /&gt;default setting is INFO. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;===================================================&lt;br /&gt;Configuring the The OpenSSH server - /usr/sbin/sshd&lt;br /&gt;===================================================&lt;br /&gt;* SSH server configuration file : /etc/ssh/sshd_config&lt;br /&gt;* Note that OpenSSH does not have different configuration files for SSH 1.x&lt;br /&gt;and 2.x.&lt;br /&gt;* Among the default options you might want to have a look at, are :&lt;br /&gt;PermitRootLogin yes : A preferable option might be PermitRootLogin&lt;br /&gt;without-password which disables 'root' logins from&lt;br /&gt;machines without a matching key pair.&lt;br /&gt;Setting this option to 'no' disables 'root' logins&lt;br /&gt;completely and you'll have to use su from a user&lt;br /&gt;account.&lt;br /&gt;X11Forwarding no Change this option to 'yes' to allow your users to&lt;br /&gt;run X apps on your machine.&lt;br /&gt;Furthermore, disabling this option doesn't improve&lt;br /&gt;your server's security since users can always&lt;br /&gt;install their own forwarders&lt;br /&gt;PasswordAuthentication yes&lt;br /&gt;Setting this option to 'no' will only allow SSH&lt;br /&gt;logins using the key mechanism. Cleartext passwords&lt;br /&gt;tunnelled thru SSH will not be allowed.&lt;br /&gt;This might annoy users who are logging in from&lt;br /&gt;different machines frequently but is a boost to&lt;br /&gt;server security.&lt;br /&gt;(password-based authentication schemes are weak)&lt;br /&gt;Subsystem sftp /usr/libexec/openssh/sftp-server&lt;br /&gt;This is def ftp server bcos users may not like the&lt;br /&gt;cryptic syntax of scp.&lt;br /&gt;Install the 'sftpserv' rpm, which is a SSH tunneled version&lt;br /&gt;of FTP ('sftpserv' is part of the sftp package).&lt;br /&gt;Since users are familiar with ftp, this pkg is exactly like&lt;br /&gt;that and is a worthwhile thing to install.&lt;br /&gt;Do not forget to change the path above to&lt;br /&gt;'/usr/bin/sftpserv'&lt;br /&gt;after install the new server.&lt;br /&gt;Moreover, the popular graphical "gftp" program supports&lt;br /&gt;transfers via 'sftp' since version 2.0.7 (which makes up  for the missing features in pure 'sftp').&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-1582014836257705874?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/1582014836257705874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=1582014836257705874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1582014836257705874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1582014836257705874'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/ssh.html' title='SSH'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3248047973492887084</id><published>2008-03-29T05:33:00.000+05:30</published><updated>2008-03-29T05:34:42.067+05:30</updated><title type='text'>LVM</title><content type='html'>A.&lt;br /&gt;1. Create a 500 MB part of 8e for /home in fdisk&lt;br /&gt;2. U cannot give any label in DD for this - NA&lt;br /&gt;3. Install minimum&lt;br /&gt;B.&lt;br /&gt;# vgscan -&lt;br /&gt;# vgdisplay - will give "no volume groups found"&lt;br /&gt;C. Create a PV called /dev/hda5&lt;br /&gt;Note: 1. In Linux, one cannot access the HW partition hda5 directly -&lt;br /&gt;you go thru the /dev/hda5&lt;br /&gt;'ly, in LVM, one cannot access the HW partition hda5 directly -&lt;br /&gt;you go thru the PV - /dev/hda5&lt;br /&gt;Since Linux and LVM look and access the partition differently -&lt;br /&gt;2. The devdrv name and the PV name are the same, not surprisingly&lt;br /&gt;3. Hence, what linux calls a devdrv, LVM calls a PV&lt;br /&gt;# pvcreate /dev/hda5 &lt;=============================&lt;br /&gt;# pvscan&lt;br /&gt;# pvdisplay /dev/hda5&lt;br /&gt;D. Create a VG called vadapav&lt;br /&gt;# vgcreate vadapav /dev/hda5&lt;br /&gt;# vgscan -&lt;br /&gt;# vgdisplay -&lt;br /&gt;Note : A /dev/vadapav/ dir is created for every VG&lt;br /&gt;E. Create a LV called idli&lt;br /&gt;# lvcreate -l 120 -n idli vadapav &lt;==========================&lt;br /&gt;or&lt;br /&gt;# lvcreate -L 480 -n idli vadapav&lt;br /&gt;which will create&lt;br /&gt;/dev/vadapav/idli ----- Devdrv file is the LV&lt;br /&gt;F. # mke2fs /dev/vadapav/idli &lt;============================&lt;br /&gt;This will Make a FS on hda5 part. of type ext2&lt;br /&gt;I should have given -j&lt;br /&gt;# mount /dev/vadapav/idli /home&lt;br /&gt;# df -h&lt;br /&gt;# umount /home&lt;br /&gt;# tune2fs -j /dev/vadapav/idli&lt;br /&gt;# mount /home&lt;br /&gt;Now u have an ext3 one&lt;br /&gt;To resize a LV :&lt;br /&gt;e2fsadm -l+60 /dev/vadapav/idli&lt;br /&gt;or&lt;br /&gt;e2fsadm -L+240 /dev/vadapav/idli&lt;br /&gt;Adding another Disk&lt;br /&gt;===================&lt;br /&gt;1. fdisk /dev/hdc&lt;br /&gt;* Create a single primary partition the size of the whole disk&lt;br /&gt;* Change id to 8e&lt;br /&gt;* Save and exit from fdisk&lt;br /&gt;* Re-Read new parition table with :&lt;br /&gt;sfdisk -R /dev/hdc&lt;br /&gt;or&lt;br /&gt;hdparm -z /dev/hdc&lt;br /&gt;or&lt;br /&gt;partprobe&lt;br /&gt;or&lt;br /&gt;plain CAD&lt;br /&gt;2. Create PV : # pvcreate /dev/hdc1&lt;br /&gt;3. Add this new PV to the existing VG - vadapav&lt;br /&gt;# vgextend vadapav /dev/hdc1&lt;br /&gt;4. Now resize the old LV - after umounting, of course -&lt;br /&gt;# e2fsadm -l+xxx /dev/vadapav/idli&lt;br /&gt;5. Now mount /dev/vadapav/idli on /home and you have resize /home to&lt;br /&gt;spread across two disks&lt;br /&gt;Removing a Disk&lt;br /&gt;===============&lt;br /&gt;1. Resize the LV - after umounting, of course -&lt;br /&gt;# e2fsadm -l-xxx /dev/vadapav/idli&lt;br /&gt;2. lvremove /dev/vadapav/idli&lt;br /&gt;3. Now remove the LV from the VG too&lt;br /&gt;# vgreduce vadapav /dev/hdc1&lt;br /&gt;***********************************&lt;br /&gt;Summary&lt;br /&gt;=======&lt;br /&gt;A.&lt;br /&gt;1. Create a 500 MB part of 8e for /home in fdisk&lt;br /&gt;2. U cannot give any label in DD for this - NA&lt;br /&gt;3. Install minimum&lt;br /&gt;B.&lt;br /&gt;# pvcreate /dev/hda5 &lt;=============================&lt;br /&gt;C.&lt;br /&gt;# vgcreate vadapav /dev/hda5&lt;br /&gt;D.&lt;br /&gt;# lvcreate -l 120 -n idli vadapav &lt;==========================&lt;br /&gt;E.&lt;br /&gt;# mke2fs -j /dev/vadapav/idli &lt;========================&lt;br /&gt;F.&lt;br /&gt;# mount /dev/vadapav/idli /home&lt;br /&gt;and&lt;br /&gt;configure fstab&lt;br /&gt;Command Used Summary :&lt;br /&gt;====================&lt;br /&gt;* vgscan - Scan LVM system for all VG&lt;br /&gt;* vgdisplay vadapav - To see a particular VG&lt;br /&gt;* vgchange -a n vadapav - To deactivate a VG&lt;br /&gt;* vgremove vadapav - To remove a VG&lt;br /&gt;* vgextend vadapav /dev/hdaX - To add a PV to the VG&lt;br /&gt;* vgreduce vadapav /dev/hdaX - To delete a PV from a VG&lt;br /&gt;* pvscan - Scan LVM system for all PVs&lt;br /&gt;* pvdisplay /dev/hdaX - To see a particular PV&lt;br /&gt;* lvscan - Scan LVM system for all LVs&lt;br /&gt;* lvdisplay /dev/vadapav/idli - To see a particular LV&lt;br /&gt;* lvremove /dev/vadapav/idli - To delete a LV&lt;br /&gt;Alert :&lt;br /&gt;Q: Reduce the LV to 200 MB&lt;br /&gt;RHL9: 1. df -h&lt;br /&gt;/dev/vadapav/idli 101M 4.5M 91M 5% /home&lt;br /&gt;2. umount /dev/vadapav/idli&lt;br /&gt;3. e2fsadm -L200 /dev/vadapav/idli&lt;br /&gt;4. mount -a&lt;br /&gt;Q: Extend the LV to 500 MB&lt;br /&gt;AS4: 1. df -h&lt;br /&gt;/dev/vadapav/idli 101M 4.5M 91M 5% /home&lt;br /&gt;2. lvextend -L500 /dev/vadapav/idli&lt;br /&gt;3. ext2online /dev/vadapav/idli&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3248047973492887084?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3248047973492887084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3248047973492887084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3248047973492887084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3248047973492887084'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/lvm.html' title='LVM'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-7773705145147994349</id><published>2008-03-29T05:24:00.000+05:30</published><updated>2008-03-29T05:31:24.792+05:30</updated><title type='text'>NFS</title><content type='html'>Why use NFS ?&lt;br /&gt;Scenario&lt;br /&gt;A small office has an old Linux server that is running out of disk space.&lt;br /&gt;The office can't tolerate any down time; even hours, because the server is&lt;br /&gt;accessed by overseas programmers and clients at nights and local ones by day.&lt;br /&gt;Budgets are tight and the company needs a quick solution until it can get a purchase order approved for a hardware upgrade.&lt;br /&gt;Another Linux server on the network has additional disk capacity in its&lt;br /&gt;/jokes partition and the office would like to expand into it as an&lt;br /&gt;interim expansion NFS server.&lt;br /&gt;For the scenario you need:&lt;br /&gt;Read-only access to the /jokes directory to all networks&lt;br /&gt;Read/write access to the /jokes from all servers on the 192.168.0.0 /24&lt;br /&gt;network, which is all addresses from 192.168.0.0 to 192.168.0.255&lt;br /&gt;In all cases, use the sync option to ensure that file data cached in&lt;br /&gt;memory is automatically written to the disk after the completion of any&lt;br /&gt;disk data copying operation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Part - I&lt;br /&gt;&lt;strong&gt;Server-side NFS Config&lt;/strong&gt;&lt;br /&gt;1. Which dir do u want to share&lt;br /&gt;2. configure /etc/exports&lt;br /&gt;3. service portmap restart&lt;br /&gt;4. service nfs restart [Use "exportfs -r" to refresh rpc.nfsd which re-reads&lt;br /&gt;/etc/exports - of course, when you modify it only]&lt;br /&gt;5. service nfslock restart&lt;br /&gt;&lt;br /&gt;Testing tools :&lt;br /&gt;===============&lt;br /&gt;6. showmount -e [localhost]&lt;br /&gt;7. rpcinfo -p [localhost]&lt;br /&gt;aka&lt;br /&gt;/etc/rc.d/init.d/portmap&lt;br /&gt;portmap* : Port 111 [portmapper]&lt;br /&gt;Note: # ldd `which portmap`&lt;br /&gt;&gt; libwrap.so.0 =&gt; /usr/lib/libwrap.so.0 (0x40034000)&lt;br /&gt;Hence one can use TCP wrappers to block portmap ergo nfs from clients&lt;br /&gt;eg /etc/hosts.deny&lt;br /&gt;===============&lt;br /&gt;portmap:192.168.0.30&lt;br /&gt;/etc/rc.d/init.d/nfs&lt;br /&gt;====================&lt;br /&gt;rpc.mountd* : Emphemeral Ports provided by portmap [mountd] Remote Mounting&lt;br /&gt;rpc.nfsd* : Port 2049 This is the NFS server [nfsd] Big Boss&lt;br /&gt;rpc.rquotad* : Emphemeral Ports provided by portmap [rquotad] NFS Quotas&lt;br /&gt;/etc/rc.d/init.d/nfslock&lt;br /&gt;========================&lt;br /&gt;rpc.lockd* : Emphemeral Ports provided by portmap [nlockmgr] Concurrency Ctl&lt;br /&gt;rpc.statd* : ------- do ------- [status] NFS status&lt;br /&gt;8. nfsstat -s &lt;-------- Server stats : see that bad calls is &lt; 3%&lt;br /&gt;9. nfsstat -c &lt;-------- Clients stats : see that bad calls is &lt; 3%&lt;br /&gt;10 nfsstat -a &lt;--------&lt;br /&gt;&lt;br /&gt;Part - II&lt;br /&gt;&lt;strong&gt;Client-side NFS Config&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;1. service portmap restart&lt;br /&gt;Always start this first if 2 m/cs have to share files&lt;br /&gt;2. service nfslock restart&lt;br /&gt;3 Find out what the NFS server is sharing :&lt;br /&gt;showmount -e NFSServer&lt;br /&gt;4. mkdir /funny Default: is UDP&lt;br /&gt;5. mount ganesh:/jokes /&lt;br /&gt;mount ganesh:/jokes /funny -o soft,intr,rsize=8192,wsize=8192 tcp&lt;br /&gt;\6. cd /funny&lt;br /&gt;7. ls&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/etc/exports&lt;br /&gt;============&lt;br /&gt;/jokes *.bom.labs.net(rw)&lt;br /&gt;Note : NFS uses UDP but one can use TCP too if the kernel supports it&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Automation of NFS Server and Client&lt;br /&gt;&lt;/strong&gt;using fstab and automount*&lt;br /&gt;Using fstab&lt;br /&gt;===========&lt;br /&gt;Server :&lt;br /&gt;======&lt;br /&gt;1. Disable FWs&lt;br /&gt;2. which dir do u want to share&lt;br /&gt;3. configure /etc/exports&lt;br /&gt;==&gt; /jokes&lt;br /&gt;4. Using chkconfig enable portmap, nfs and nfslock&lt;br /&gt;Client :&lt;br /&gt;======&lt;br /&gt;1. Configure /etc/fstab&lt;br /&gt;====&gt; 192.168.0.20:/jokes /funny nfs soft,intr 0 0&lt;br /&gt;2. Using chkconfig see that portmap, nfslock and netfs are set on&lt;br /&gt;3. On reboot, /etc/rc.d/rc.sysinit will automount&lt;br /&gt;Using autofs&lt;br /&gt;============&lt;br /&gt;Example I&lt;br /&gt;=========&lt;br /&gt;Server :&lt;br /&gt;======&lt;br /&gt;Same as above&lt;br /&gt;Client :&lt;br /&gt;======&lt;br /&gt;1. # mkdir -p /export/nfs/&lt;br /&gt;2. Configure /etc/auto.master&lt;br /&gt;====&gt; /export /etc/auto.misc --timeout=60&lt;br /&gt;3. Configure /etc/auto.misc&lt;br /&gt;key&lt;br /&gt;&lt;br /&gt;\/&lt;br /&gt;====&gt; nfs 192.168.0.20:/jokes&lt;br /&gt;or&lt;br /&gt;====&gt; nfs -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid,tcp \&lt;br /&gt;192.168.0.20:/jokes&lt;br /&gt;4. service autofs restart&lt;br /&gt;5. cd /export/nfs/&lt;br /&gt;and you will see the contents of /jokes/ dir on nfs server ganesh&lt;br /&gt;6. Using chkconfig see that portmap, nfslock and autofs are set on&lt;br /&gt;On reboot, the autofs script will start automount*&lt;br /&gt;Example II&lt;br /&gt;==========&lt;br /&gt;Server :&lt;br /&gt;======&lt;br /&gt;1. Disable FWs&lt;br /&gt;2. which dir do u want to share&lt;br /&gt;3. configure /etc/exports&lt;br /&gt;==&gt; /home *(rw)&lt;br /&gt;4. Using chkconfig enable portmap, nfs and nfslock&lt;br /&gt;Client :&lt;br /&gt;======&lt;br /&gt;1. Configure /etc/auto.master&lt;br /&gt;====&gt; /home /etc/auto.misc --timeout=60&lt;br /&gt;2. Configure /etc/auto.misc&lt;br /&gt;key&lt;br /&gt;&lt;br /&gt;\/&lt;br /&gt;====&gt; ajay 192.168.0.20:/home/ajay&lt;br /&gt;or&lt;br /&gt;====&gt; ajay 192.168.0.20:&amp;amp;&lt;br /&gt;3. service autofs restart&lt;br /&gt;4. Now log in as ajay&lt;br /&gt;and you will see the contents of /home/ajay/, Ajay's home dir&lt;br /&gt;on the NFS server&lt;br /&gt;Here, the key is ajay, so the ampersand wildcard is interpreted to mean&lt;br /&gt;ajay. This means you'll be mounting the ganesh:/home/ajay directory&lt;br /&gt;from the NFS server on ajay's home dir here, on the Client, auto&lt;br /&gt;5. Using chkconfig see that portmap, nfslock and autofs are set on&lt;br /&gt;&lt;br /&gt;Part - IV&lt;br /&gt;&lt;strong&gt;NFS log Files&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;/var/lib/nfs/&lt;br /&gt;=============&lt;br /&gt;etab : export perms of /jokes as shared with all users&lt;br /&gt;====&lt;br /&gt;/jokes (ro,sync,wdelay,hide,secure,root_squash,no_all_squash,subtree_check,secure_locks,mapping=identity,anonuid=-2,anongid=-2)&lt;br /&gt;rmtab : which hosts have mounted your shares&lt;br /&gt;=====&lt;br /&gt;brahma.bom.labs.net:/jokes:0x00000001&lt;br /&gt;shiva.bom.labs.net:/jokes:0x00000002&lt;br /&gt;xtab : per host&lt;br /&gt;====&lt;br /&gt;/jokes brahma.bom.labs.net(ro,sync,wdelay,hide,secure,root_squash,no_all_squash,subtree_check,secure_locks,mapping=identity,anonuid=-2,anongid=-2)&lt;br /&gt;/jokes shiva.bom.labs.net(ro,sync,wdelay,hide,secure,root_squash,no_all_squash,subtree_check,secure_locks,mapping=identity,anonuid=-2,anongid=-2)&lt;br /&gt;&lt;br /&gt;Part - V&lt;br /&gt;&lt;strong&gt;NFS Tuning&lt;/strong&gt;&lt;br /&gt;================================================================================&lt;br /&gt;* rsize and wsize are defaulted to 4K in Linux. Increase to 8k&lt;br /&gt;* For TCP make it 32K. UDP 8K is OK&lt;br /&gt;* In 2.4 kernels, the default input queue is 64&lt;br /&gt;# cat /proc/sys/net/core/rmem_default ----&gt; 65535&lt;br /&gt;# cat /proc/sys/net/core/rmem_max ----&gt; 65535&lt;br /&gt;Increase this to 256K, a good default&lt;br /&gt;# echo 262144 &gt; cat /proc/sys/net/core/rmem_default ----&gt; Now 256K&lt;br /&gt;# echo 262144 &gt; cat /proc/sys/net/core/rmem_max ----&gt; Now 256K&lt;br /&gt;Now restart nfs : service nfs restart which is now tuned&lt;br /&gt;Replace the defaults back to their original values so as not to negatively&lt;br /&gt;affect other daemons&lt;br /&gt;# echo 65535 &gt; /proc/sys/net/core/rmem_default&lt;br /&gt;# echo 65535 &gt; /proc/sys/net/core/rmem_max&lt;br /&gt;Additional use "procinfo*" to see kernel details&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Part - VI&lt;br /&gt;&lt;strong&gt;NFS Security&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;* NFS and portmap have had a number of known security deficiencies in&lt;br /&gt;the past. As a result, its not recommended using NFS over insecure&lt;br /&gt;networks.&lt;br /&gt;* NFS doesn't encrypt data and it is possible for root users on NFS clients&lt;br /&gt;to have root access the server's filesystems.&lt;br /&gt;* You can exercise security-related caution with NFS by following a few&lt;br /&gt;guidelines:&lt;br /&gt;o Restrict its use to secure networks&lt;br /&gt;o Export only the most needed data&lt;br /&gt;o Consider using read-only exports whenever data updates aren't&lt;br /&gt;necessary.&lt;br /&gt;o Use the root_squash option in /etc/exports file (default) to reduce&lt;br /&gt;the risk of the possibility of a root user on the NFS client having&lt;br /&gt;root file permission access on the NFS server. This is normally an&lt;br /&gt;undesirable condition, especially if the NFS client and NFS server&lt;br /&gt;are being managed by different sets of administrators.&lt;br /&gt;These points should be the foundation of your NFS security policy&lt;br /&gt;&lt;br /&gt;Part - VII&lt;br /&gt;&lt;strong&gt;NFS Hanging / TroubleShooting&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;* As seen before, if the NFS server fails, the NFS client waits indefinitely&lt;br /&gt;for it to return. This also forces programs relying on the same client&lt;br /&gt;server relationship to wait indefinitely too.&lt;br /&gt;* For this reason, use the soft option in the NFS client's /etc/fstab&lt;br /&gt;file. This causes NFS to report an I/O error to the calling program&lt;br /&gt;after a long timeout.&lt;br /&gt;You can reduce the risk of NFS hanging by taking a number of&lt;br /&gt;precautions:&lt;br /&gt;o Run NFS on a reliable network&lt;br /&gt;o Avoid having NFS servers that NFS mount each other's filesystems or directories.&lt;br /&gt;o Always use the sync option whenever possible.&lt;br /&gt;o Do not have mission-critical computers rely on an NFS server to operate, unless the server's reliability can be guaranteed.&lt;br /&gt;o Do not include NFS-mounted directories as part of your search path, because a hung NFS connection to a directory in your search path could cause your shell to pause at that point in the search path until the NFS session is regained.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-7773705145147994349?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/7773705145147994349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=7773705145147994349' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7773705145147994349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/7773705145147994349'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/nfs.html' title='NFS'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-6792757363390949539</id><published>2008-03-29T05:22:00.000+05:30</published><updated>2008-03-29T05:24:16.783+05:30</updated><title type='text'>VSFTPD</title><content type='html'>&lt;p&gt;&lt;strong&gt;VSFTPD 1.1 - Very Secure FTP Daemon &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Other FTP servers : WU-FTPD, Pro-FTP etc etc&lt;br /&gt;&lt;br /&gt;Config files : 1. /etc/vsftpd/vsftpd.conf&lt;br /&gt;/etc/vsftpd.chroot_list&lt;br /&gt;2. /etc/vsftpd_users&lt;br /&gt;3. /etc/vsftpd.user_list&lt;br /&gt;/etc/vsftpd.banned_emails&lt;br /&gt;GUI Client: gftp&lt;br /&gt;CLI Client: ftp&lt;br /&gt;-----------------------&lt;br /&gt;/etc/vsftpd/vsftpd.conf&lt;br /&gt;-----------------------&lt;br /&gt;* vsftpd is PARANIOD! By default it allows almost nothing.&lt;br /&gt;* Note: DO not use a space before or after the '='. It is an error !&lt;br /&gt;VSFTPD WILL REFUSE TO START !&lt;br /&gt;* Note: All directives should start from column 1 or else error !&lt;br /&gt;VSFTPD WILL REFUSE TO START !&lt;br /&gt;* If there is an error in a directive [misspelling], the vsftpd&lt;br /&gt;daemon will fail to start or die on you. So, watch out!&lt;br /&gt;* vsftp has a wealth of config options.&lt;br /&gt;Lets look at some 35 of them.&lt;br /&gt;Three types of FTP users :&lt;br /&gt;1. Real user - in which you see : /home/foo and can go anywhere&lt;br /&gt;and can even DL your passwd file&lt;br /&gt;2. Guest user - in which you see : / and can go nowhere&lt;br /&gt;The user is chroot'd to his home and will always see /&lt;br /&gt;Cannot go anywhere ! Called a FTP chroot jail&lt;br /&gt;Both the above are VLUs&lt;br /&gt;Both will see their homes&lt;br /&gt;3. Anonymous FTP user - Not a VLU&lt;br /&gt;Will be logged in as user : ftp/ftp 14:50&lt;br /&gt;Home will be : /var/ftp/&lt;br /&gt;&lt;br /&gt;List of Directives covered :&lt;br /&gt;----------------------------------&lt;br /&gt;A. Directives for anonymous logins&lt;br /&gt;----------------------------------&lt;br /&gt;1 anonymous_enable=YES&lt;br /&gt;2 no_anon_password=NO&lt;br /&gt;3 anon_root=(none)&lt;br /&gt;4 ftp_username=ftp&lt;br /&gt;-----------------------------------------&lt;br /&gt;B. Directives for VLU [Real/Guest] logins&lt;br /&gt;-----------------------------------------&lt;br /&gt;5 local_enable=NO&lt;br /&gt;6 write_enable=NO&lt;br /&gt;7 chroot_local_user=NO&lt;br /&gt;8 local_root=no default&lt;br /&gt;9 chroot_list_enable=NO&lt;br /&gt;10 chroot_list_file=/etc/vsftpd.chroot_list&lt;br /&gt;11 local_max_rate=0 [unlimited]&lt;br /&gt;12 guest_enable=NO&lt;br /&gt;13 guest_username=ftp&lt;br /&gt;---------------------------------&lt;br /&gt;C. Ports / Connections / TimeOuts&lt;br /&gt;---------------------------------&lt;br /&gt;14 listen=no&lt;br /&gt;15 listen_port=21&lt;br /&gt;16 listen_address=default none&lt;br /&gt;17 tcp_wrappers=NO&lt;br /&gt;18 max_clients=0 [unlimited]&lt;br /&gt;19 max_per_ip=0 [unlimited]&lt;br /&gt;20 data_connection_timeout=300&lt;br /&gt;21 idle_session_timeout=300&lt;br /&gt;-----------------------&lt;br /&gt;D. Banners and Messages&lt;br /&gt;----------------------&lt;br /&gt;22 ftpd_banner=(none - default vsftpd banner is displayed)&lt;br /&gt;23 banner_file=(none) Set to some filename&lt;br /&gt;-----------------------------&lt;br /&gt;E. Fine-Tuning Access Control&lt;br /&gt;-----------------------------&lt;br /&gt;24 userlist_enable=NO&lt;br /&gt;25 userlist_file=/etc/vsftp.user_list&lt;br /&gt;26 userlist_deny=YES&lt;br /&gt;27 user_config_dir=(none) or somedir/&lt;br /&gt;----------&lt;br /&gt;F. Logging&lt;br /&gt;----------&lt;br /&gt;28 xferlog_enable=NO&lt;br /&gt;29 xferlog_file=/var/log/vsftpd.log&lt;br /&gt;30 xferlog_std_format=NO&lt;br /&gt;31 log_ftp_protocol=NO&lt;br /&gt;--------------------&lt;br /&gt;G. Uploads/Downloads&lt;br /&gt;--------------------&lt;br /&gt;32 anon_upload_enable=no&lt;br /&gt;33 ascii_upload_enable=no&lt;br /&gt;34 ascii_download_enable=no&lt;br /&gt;----------------&lt;br /&gt;H. Miscellaneous&lt;br /&gt;----------------&lt;br /&gt;35 pam_service_name=vsftpd&lt;br /&gt;*******************************************************************************&lt;br /&gt;Now lets examine them one by one !&lt;br /&gt;By functionality !&lt;br /&gt;************************&lt;br /&gt;----------------------------------&lt;br /&gt;A. Directives for anonymous logins&lt;br /&gt;----------------------------------&lt;br /&gt;1 anonymous_enable=YES&lt;br /&gt;2 no_anon_password=NO&lt;br /&gt;3 anon_root=(none)&lt;br /&gt;4 ftp_username=ftp&lt;br /&gt;1. anonymous_enable=YES&lt;br /&gt;Allow anon logins or not.&lt;br /&gt;ftp' and 'anonymous' are VLUs for anonymous.&lt;br /&gt;All other anonymous-based directives [which follow] are obviously&lt;br /&gt;rendered useless, if this is set to 'NO'&lt;br /&gt;Def: Yes&lt;br /&gt;2. no_anon_password=NO&lt;br /&gt;If yes, anonymous users can log straight in without a password&lt;br /&gt;3. anon_root=/win Def: none&lt;br /&gt;On anonymous login, vsftpd will change over to this /win directory&lt;br /&gt;instead of the def: /var/ftp/.&lt;br /&gt;Note : If /win is world writeable or not owned by root, then failure!&lt;br /&gt;Other failures are silently ignored.&lt;br /&gt;4. ftp_username=ftp&lt;br /&gt;This is the name of the user we use for handling anonymous FTP.&lt;br /&gt;The home directory of this user is the root of the anonymous FTP area.&lt;br /&gt;-----------------------------------------&lt;br /&gt;B. Directives for VLU [Real/Guest] logins&lt;br /&gt;-----------------------------------------&lt;br /&gt;5 local_enable=NO&lt;br /&gt;6 write_enable=NO&lt;br /&gt;7 chroot_local_user=NO&lt;br /&gt;8 local_root=no default&lt;br /&gt;9 chroot_list_enable=NO&lt;br /&gt;10 chroot_list_file=/etc/vsftpd.chroot_list&lt;br /&gt;11 local_max_rate=0 [unlimited]&lt;br /&gt;12 guest_enable=NO&lt;br /&gt;13 guest_username=ftp&lt;br /&gt;5. local_enable=NO If this is not YES, no VLU allowed in. Server is anon&lt;br /&gt;Controls whether local logins are permitted or not. If enabled, normal user&lt;br /&gt;accounts [Real] in /etc/passwd may be used to log in.&lt;br /&gt;This means, by default, vsftpd only allows anon users in.&lt;br /&gt;Wonderfully Paraniod!&lt;br /&gt;VSFPTD is now an Anonymous FTP server, by default !&lt;br /&gt;6. write_enable=NO&lt;br /&gt;For any type of FTP write command, this should be YES&lt;br /&gt;If enabled, allows file uploads. VLU's and anon ftp users [ftp 14:50]&lt;br /&gt;must,then, have write permission on the upload dir. def: /var/ftp/&lt;br /&gt;7. chroot_local_user=NO&lt;br /&gt;If set to YES, VLUs will be placed in a chroot() jail in their home dir.&lt;br /&gt;after login. BUT....&lt;br /&gt;IMP:&lt;br /&gt;====&lt;br /&gt;If set to YES, and [#18] "chroot_list_enable=YES" which obviously implies&lt;br /&gt;that [#12] "chroot_list_file=/etc/vsftpd.chroot_list" is searched.&lt;br /&gt;Then the meaning is the opposite. Users on this file-list WILL NOT be put&lt;br /&gt;in a chroot [their HOME] jail.&lt;br /&gt;Warning: This option has security implications, especially if the users&lt;br /&gt;have upload permission, or shell access. Only enable if you know what you&lt;br /&gt;are doing.&lt;br /&gt;Note that these security implications are not vsftpd specific. They&lt;br /&gt;apply to all FTP daemons which offer to put local users in chroot() jails.&lt;br /&gt;08 local_root=none&lt;br /&gt;This option represents a directory which vsftpd will try to change to after&lt;br /&gt;a local (i.e. non-anonymous) login. Not chroot'd&lt;br /&gt;Failure is silently ignored.&lt;br /&gt;Similar in function to anon_root [#3]&lt;br /&gt;09 chroot_list_enable=NO&lt;br /&gt;If activated, you may provide a list of local VLUs who are placed in a&lt;br /&gt;chroot() jail in their home directory upon login.&lt;br /&gt;The meaning is slightly different if "chroot_local_user" is set to YES.&lt;br /&gt;IMP: [See #9] above&lt;br /&gt;====&lt;br /&gt;In this case, the list becomes a list of users which are NOT to be placed&lt;br /&gt;in a chroot() jail.&lt;br /&gt;By default, the file containing this list is /etc/vsftpd.chroot_list,&lt;br /&gt;but you may override this with the chroot_list_file setting.&lt;br /&gt;10 chroot_list_file=/etc/vsftpd.chroot_list&lt;br /&gt;The option is the name of a file containing a list of local users which&lt;br /&gt;will be placed in a chroot() jail in their home directory.&lt;br /&gt;This option is only relevant if the option [#17] chroot_list_enable&lt;br /&gt;is enabled, and the option [#9] chroot_local_user is disabled.&lt;br /&gt;11 local_max_rate=0 [unlimited]&lt;br /&gt;The maximum data transfer rate permitted, in bytes per second, for local&lt;br /&gt;authenticated users i.e. VLUs&lt;br /&gt;12 guest_enable=NO Normal VLUs converted to anon users and thrown to&lt;br /&gt;/var/ftp/, but not chrootd, unless chroot_local_user&lt;br /&gt;is given.&lt;br /&gt;If enabled, all non-anonymous [VLUs] logins are classed as "anon" logins&lt;br /&gt;and on # pwd will get /var/ftp/&lt;br /&gt;The login is remapped to the user specified in the 'guest_username'&lt;br /&gt;setting, which is ftp, by default&lt;br /&gt;This is like root_squash in NFS&lt;br /&gt;13 guest_username=ftp&lt;br /&gt;If the [above #15] 'guest_enable' is YES, this setting is the real username&lt;br /&gt;which guest users [formerly VLUs] are mapped to.&lt;br /&gt;---------------------------------&lt;br /&gt;C. Ports / Connections / TimeOuts&lt;br /&gt;---------------------------------&lt;br /&gt;14 listen=no&lt;br /&gt;15 listen_port=21&lt;br /&gt;16 listen_address=default none&lt;br /&gt;17 tcp_wrappers=NO&lt;br /&gt;18 max_clients=0 [unlimited]&lt;br /&gt;19 max_per_ip=0 [unlimited]&lt;br /&gt;20 data_connection_timeout=300&lt;br /&gt;21 idle_session_timeout=300&lt;br /&gt;&lt;br /&gt;14 listen=no&lt;br /&gt;If enabled, vsftpd will run in standalone mode.&lt;br /&gt;vsftpd will then take care of listening for and handling incoming&lt;br /&gt;connections on 20/21 ports&lt;br /&gt;15 listen_port=21&lt;br /&gt;If vsftpd is in standalone mode, which is always the case, this is the port&lt;br /&gt;it will listen on for incoming FTP connections.&lt;br /&gt;16 listen_address=default none&lt;br /&gt;To make vsftpd non-promiscuous and listen on only one IP address.&lt;br /&gt;If vsftpd is in standalone mode, the default listen address (of all local&lt;br /&gt;interfaces) may be overridden by this setting.&lt;br /&gt;Provide a numeric IP address.&lt;br /&gt;17 tcp_wrappers=NO&lt;br /&gt;If enabled, and vsftpd was compiled with tcp_wrappers support, incoming&lt;br /&gt;connections will be fed through tcp_wrappers access control. Furthermore,&lt;br /&gt;there is a mechanism for per-IP based configuration. If tcp_wrappers sets&lt;br /&gt;the VSFTPD_LOAD_CONF environment variable, then the vsftpd session will try&lt;br /&gt;and load the vsftpd configuration file specified in this variable.&lt;br /&gt;18 max_clients=0 [unlimited]&lt;br /&gt;If vsftpd is in standalone mode, this is the maximum number of clients which&lt;br /&gt;may be connected. Any additional clients connecting will get an error message.&lt;br /&gt;19 max_per_ip=0 [unlimited]&lt;br /&gt;If vsftpd is in standalone mode, this is the maximum number of clients which&lt;br /&gt;may be connected from the same source internet address. A client will get an&lt;br /&gt;error message if they go over this limit. To prevent DOS.&lt;br /&gt;20 data_connection_timeout=300&lt;br /&gt;The timeout, in seconds, which is roughly the maximum time we permit data&lt;br /&gt;transfers to stall for with no progress. If the timeout triggers, the remote&lt;br /&gt;client is disconnected.&lt;br /&gt;21 idle_session_timeout=300&lt;br /&gt;The timeout, in seconds, which is the maximum time a remote client may&lt;br /&gt;spend between FTP commands. If the timeout triggers, the remote client is&lt;br /&gt;disconnected.&lt;br /&gt;-----------------------&lt;br /&gt;D. Banners and Messages&lt;br /&gt;-----------------------&lt;br /&gt;22 ftpd_banner=(none - default vsftpd banner is displayed)&lt;br /&gt;23 banner_file=(none) Set to some filename&lt;br /&gt;22 ftpd_banner=(none - default vsftpd banner is displayed)&lt;br /&gt;This string option allows you to override the greeting banner&lt;br /&gt;displayed by vsftpd when a connection first comes in.&lt;br /&gt;23 banner_file=(none) Set to some filename&lt;br /&gt;This option is the name of a file containing text to display&lt;br /&gt;when someone connects to the server. If set, it overrides the&lt;br /&gt;banner string provided by the 'ftpd_banner' option.&lt;br /&gt;-----------------------------&lt;br /&gt;E. Fine-Tuning Access Control&lt;br /&gt;-----------------------------&lt;br /&gt;24 userlist_enable=NO&lt;br /&gt;25 userlist_file=/etc/vsftp.user_list&lt;br /&gt;26 userlist_deny=YES&lt;br /&gt;27 user_config_dir=(none) or somedir/&lt;br /&gt;24 userlist_enable=NO&lt;br /&gt;If YES, all users listed in the file pointed to by the 'userlist_file='&lt;br /&gt;directive will be DENIED ACCESS even before they are asked for a&lt;br /&gt;password.&lt;br /&gt;25 userlist_file=/etc/vsftpd.user_list&lt;br /&gt;Filename examined only when 'userlist_enable=YES'.&lt;br /&gt;26 userlist_deny=YES&lt;br /&gt;If set to NO, then exactly the reverse of the above takes place.&lt;br /&gt;All users listed in the above file will ONLY be allowed access.&lt;br /&gt;ALL OTHERS WILL BE DENIED ACCESS.&lt;br /&gt;This option is examined only if 'userlist_enable' is YES.&lt;br /&gt;27 user_config_dir=(none)&lt;br /&gt;An example will make this very powerful directive clear. It&lt;br /&gt;basically allows a user to have his/her very own&lt;br /&gt;/etc/vsftpd/vsftpd.conf file.&lt;br /&gt;That is, a per-user basis special config file.&lt;br /&gt;[Reminds one of the 'config file=smb.conf.%m' directive in Samba]&lt;br /&gt;Let do this :&lt;br /&gt;1. Create a subdir :&lt;br /&gt;# mkdir /etc/vadapav/&lt;br /&gt;2. Create your very own config file with your per-foo directives&lt;br /&gt;for foo :&lt;br /&gt;# vi /etc/vadapav/swarup&lt;br /&gt;3. Put the following directive in /etc/vsftpd/vsftpd.conf&lt;br /&gt;user_config_dir=/etc/vadapav/&lt;br /&gt;4. Restart vsftpd.&lt;br /&gt;5. Now log in as user 'swarup'.&lt;br /&gt;vsftpd will load and use the settings in&lt;br /&gt;/etc/vadapav/foo&lt;br /&gt;for the duration of the session.&lt;br /&gt;The format of this 'foo' file is in line with the normal&lt;br /&gt;/etc/vsftpd/vsftpd.conf file.&lt;br /&gt;Similar to 'config file' directive in Samba&lt;br /&gt;----------&lt;br /&gt;F. Logging&lt;br /&gt;----------&lt;br /&gt;28 xferlog_enable=NO&lt;br /&gt;29 xferlog_file=/var/log/vsftpd.log&lt;br /&gt;30 xferlog_std_format=NO&lt;br /&gt;31 log_ftp_protocol=NO&lt;br /&gt;28 xferlog_enable=NO &lt;---- No logging done if this is NO ---&gt;&lt;br /&gt;If you leave this as NO - the default - then NO logging will take place.&lt;br /&gt;If Yes, all uploads/downloads will be placed in /var/log/vsftpd.log.&lt;br /&gt;You can override this using 'xferlog_file=filename"&lt;br /&gt;Note : Default: NO (but the sample config file by RedHat enables it)&lt;br /&gt;29 xferlog_file=/var/log/vsftpd.log&lt;br /&gt;This option is the name of the file to which we write the transfer log.&lt;br /&gt;The transfer log is only written if the above option 'xferlog_enable=Yes'.&lt;br /&gt;30 xferlog_std_format=NO&lt;br /&gt;Def: No Generates logs in vsftpd's own format&lt;br /&gt;If Yes, generates logs in xferlog log format. You can use Apache/SQUID&lt;br /&gt;log analyzers then&lt;br /&gt;31 log_ftp_protocol=NO&lt;br /&gt;If Yes, all FTP requests/responses are logged&lt;br /&gt;BUT&lt;br /&gt;IFF 'xferlog_std_format=No&lt;br /&gt;Useful for debugging.&lt;br /&gt;----------------&lt;br /&gt;G. Uploads/Downloads&lt;br /&gt;--------------------&lt;br /&gt;32 anon_upload_enable=no&lt;br /&gt;33 ascii_upload_enable=no&lt;br /&gt;34 ascii_download_enable=no&lt;br /&gt;32 anon_upload_enable=no&lt;br /&gt;Allow anon users to upload files&lt;br /&gt;write_enable has to be enabled&lt;br /&gt;The anon upload dir has to be writeable for user ftp&lt;br /&gt;33 ascii_upload_enable=no&lt;br /&gt;34 ascii_download_enable=no&lt;br /&gt;Allow users to upload files&lt;br /&gt;write_enable has to be enabled&lt;br /&gt;----------------&lt;br /&gt;G. Miscellaneous&lt;br /&gt;----------------&lt;br /&gt;35 pam_service_name=vsftpd&lt;br /&gt;35 pam_service_name=vsftpd&lt;br /&gt;This string is the name of the PAM service vsftpd will use.&lt;br /&gt;Note : The manual specifies 'ftp' which is wrong - It is 'vsftpd'&lt;br /&gt;****************************&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-6792757363390949539?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/6792757363390949539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=6792757363390949539' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6792757363390949539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/6792757363390949539'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/vsftpd.html' title='VSFTPD'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-3414384485504774187</id><published>2008-03-29T04:56:00.000+05:30</published><updated>2008-03-29T05:02:09.732+05:30</updated><title type='text'>Samba Server</title><content type='html'>[global]&lt;br /&gt;&lt;strong&gt;SERVER CONFIG OPTIONS&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;workgroup = VASHILUG&lt;br /&gt;netbios name = MARUTI&lt;br /&gt;encrypt passwords = yes&lt;br /&gt;smb passwd file = /etc/samba/smbpasswd&lt;br /&gt;server string = Samba %v at %h (.bom.labs.net)&lt;br /&gt;time server = yes&lt;br /&gt;keepalive =300&lt;br /&gt;deadtime =0&lt;br /&gt;#config file = /etc/samba/smb.conf.%m&lt;br /&gt;#include = /etc/samba/smb.conf.%m&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;NETWORKING CONFIG&lt;br /&gt;&lt;/strong&gt;hosts allow = 192.168.0.&lt;br /&gt;##allow hosts&lt;br /&gt;hosts deny = ALL EXCEPT 192.168.0.10 192.168.0.20 127.0.0.1&lt;br /&gt;##deny hosts&lt;br /&gt;interfaces = 192.168.0.20/24 127.0.0.1&lt;br /&gt;bind interfaces only = yes&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;LOGGING CONFIG OPTIONS&lt;/strong&gt;&lt;br /&gt;log file = /var/log/samba.log.%m&lt;br /&gt;log level =1&lt;br /&gt;##debug level&lt;br /&gt;max log size = 100&lt;br /&gt;debug timestamp =yes&lt;br /&gt;## timestamp logs&lt;br /&gt;debug pid =yes&lt;br /&gt;debug uid =yes&lt;br /&gt;syslog =1&lt;br /&gt;syslog only =no&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HOME SHARES SECTION&lt;/strong&gt;&lt;br /&gt;[homes]&lt;br /&gt;comment = Home Directories&lt;br /&gt;browseable =no&lt;br /&gt;##browsable&lt;br /&gt;writable = yes&lt;br /&gt;## writeable = yes&lt;br /&gt;## write ok = yes&lt;br /&gt;DISK SHARES SECTION - BASIC DISK SHARES CONFIG OPTIONS&lt;br /&gt; [vadapav]&lt;br /&gt;available = no&lt;br /&gt;browseable =yes&lt;br /&gt;writeable = yes&lt;br /&gt;read only = no&lt;br /&gt;[accts]&lt;br /&gt;path = /accounts&lt;br /&gt;## directory&lt;br /&gt;copy = vadapav&lt;br /&gt;available = yes&lt;br /&gt;comment = Accounts Dept&lt;br /&gt;[fin]&lt;br /&gt;path = /finance&lt;br /&gt;copy = vadapav&lt;br /&gt;available = yes&lt;br /&gt;comment = Finance Dept&lt;br /&gt;[hr]&lt;br /&gt;path = /hrd&lt;br /&gt;copy = vadapav&lt;br /&gt;available = yes&lt;br /&gt;comment = HR Dept&lt;br /&gt;[cdrom]&lt;br /&gt;path=/mnt/cdrom&lt;br /&gt;root preexec = mount /dev/cdrom /mnt/cdrom&lt;br /&gt;root postexec = umount /mnt/cdrom&lt;br /&gt;&lt;strong&gt;SHARE LEVEL ACCESS CONTROL AND PERMISSIONS&lt;/strong&gt;&lt;br /&gt;[funny]&lt;br /&gt;#path=/jokes&lt;br /&gt;#writeable=&lt;br /&gt;#hosts allow =&lt;br /&gt;#hosts deny =&lt;br /&gt;#valid users =&lt;br /&gt;#invalid users =&lt;br /&gt;#admin users =&lt;br /&gt;#read list =&lt;br /&gt;#write list =&lt;br /&gt;#max connections =0&lt;br /&gt;##map to guest =Never This is Global but is default anyway.&lt;br /&gt;#guest account =nobody&lt;br /&gt;#guest ok =no&lt;br /&gt;##public&lt;br /&gt;#guest only =no&lt;br /&gt;##only guest=no&lt;br /&gt;&lt;strong&gt;SERVER CONFIG OPTIONS [10]&lt;/strong&gt;&lt;br /&gt;# 1 workgroup = VASHILUG&lt;br /&gt;# 2 netbios name = MARUTI&lt;br /&gt;# 3 encrypt passwords = yes&lt;br /&gt;# 4 smb passwd file = /etc/samba/smbpasswd&lt;br /&gt;# 5 server string = Samba %v at %h (.bom.labs.net) (%m)&lt;br /&gt;# 6 time server = yes&lt;br /&gt;# 7 keepalive=300&lt;br /&gt;# 8 deadtime=0&lt;br /&gt;# 9 config file = /etc/samba/smb.conf.%m&lt;br /&gt;# 10 include = /etc/samba/smb.conf.%m&lt;br /&gt;&lt;strong&gt;NETWORKING CONFIG OPTIONS [7]&lt;/strong&gt;&lt;br /&gt;# 12 hosts allow = 192.168.0.&lt;br /&gt;# 13 #allow hosts&lt;br /&gt;# 14 hosts deny = ALL EXCEPT 192.168.0.10 192.168.0.20 127.0.0.1&lt;br /&gt;# 15 #deny hosts&lt;br /&gt;# 16 interfaces = 192.168.0.10/24 127.0.0.1&lt;br /&gt;# 17 bind interfaces only = yes&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VI - LOGGING CONFIG OPTIONS [10]&lt;/strong&gt;&lt;br /&gt;# 18 log file = /var/log/samba.log.%m&lt;br /&gt;# 19 log level =1&lt;br /&gt;# 20 ##debug level&lt;br /&gt;# 21 max log size = 100&lt;br /&gt;# 22 debug timestamp =yes&lt;br /&gt;# 23 ## timestamp logs&lt;br /&gt;# 24 debug pid =yes&lt;br /&gt;# 25 debug uid =yes&lt;br /&gt;# 26 syslog =1&lt;br /&gt;# 27 syslog only =no&lt;br /&gt;&lt;strong&gt;BASIC DISK SHARES CONFIG OPTIONS [11]&lt;/strong&gt;&lt;br /&gt;# 28 path = /accounts&lt;br /&gt;# 29 #directory&lt;br /&gt;# 30 comment = Home Directories&lt;br /&gt;# 31 read only = no&lt;br /&gt;# 32 writeable = yes&lt;br /&gt;# 33 #writable&lt;br /&gt;# 34 #write ok&lt;br /&gt;# 35 copy = template-1&lt;br /&gt;# 36 available = yes&lt;br /&gt;# 37 root preexec = mount /dev/cdrom /mnt/cdrom&lt;br /&gt;# 38 root postexec = umount /mnt/cdrom&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SHARE LEVEL ACCESS CONTROL AND PERMISSIONS [12]&lt;/strong&gt;&lt;br /&gt;# hosts allow&lt;br /&gt;# hosts deny&lt;br /&gt;# 39 valid users =&lt;br /&gt;# 40 invalid users =&lt;br /&gt;# 41 admin users =&lt;br /&gt;# 42 read list =&lt;br /&gt;# 43 write list =&lt;br /&gt;# 44 max connections =0&lt;br /&gt;# 45 # map to guest =Never This is Global but is default anyway.&lt;br /&gt;# 46 guest account =nobody&lt;br /&gt;# 47 guest ok =no&lt;br /&gt;# 48 #public&lt;br /&gt;# 49 guest only =no&lt;br /&gt;# 50 #only guest=no&lt;br /&gt;## "Note that guest ok parameter must be set to ok for this to work"&lt;br /&gt;########################## 50 Directives #######################&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-3414384485504774187?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/3414384485504774187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=3414384485504774187' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3414384485504774187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/3414384485504774187'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/samba-server.html' title='Samba Server'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-8310447760472797718</id><published>2008-03-29T04:52:00.000+05:30</published><updated>2008-03-29T04:55:26.314+05:30</updated><title type='text'>LILO boot error codes</title><content type='html'>During the Boot Process,When LILO loads itself, it displays the word LILO.&lt;br /&gt;Each letter is printed before or after performing some specific action. If LILO&lt;br /&gt;fails at some point, the letters printed so far can be used to identify the problem.&lt;br /&gt;Output Problem&lt;br /&gt;(nothing)           No part of LILO has been loaded. LILO either isn't installed or the&lt;br /&gt;partition on which its boot sector is located isn't active.&lt;br /&gt;&lt;br /&gt;L    The first stage boot loader has been loaded and started, but it can't load the second stage boot loader. The two-digit error codes indicate the type of problem. This condition usually indicates a media failure or a geometry mismatch (e.g. bad disk parameters).&lt;br /&gt;LI    The first stage boot loader was able to load the second stage boot loader, but has failed to execute it. This can either be caused by a geometry mismatch or by moving /boot/boot.b without running the map installer.&lt;br /&gt;LIL    The second stage boot loader has been started, but it can't load the descriptor table from the map file. This is typically caused by a media failure or by a geometry mismatch.&lt;br /&gt;LIL?    The second stage boot loader has been loaded at an incorrect address.&lt;br /&gt;This is typically caused by a subtle geometry mismatch or by moving  /boot/boot.b without running the map installer.&lt;br /&gt;LIL-    The descriptor table is corrupt. This can either be caused by a&lt;br /&gt;geometry mismatch or by moving /boot/map without running the map&lt;br /&gt;installer.&lt;br /&gt;LILO   All parts of LILO have been successfully loaded.&lt;br /&gt;&lt;br /&gt;If the BIOS signals an error when LILO is trying to load a boot image,&lt;br /&gt;the respective error code is displayed. These codes range from 0x00&lt;br /&gt;through 0xbb.&lt;br /&gt;See man lilo for explanation of these codes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-8310447760472797718?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/8310447760472797718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=8310447760472797718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8310447760472797718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8310447760472797718'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/lilo-boot-error-codes.html' title='LILO boot error codes'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-2659536056549859941</id><published>2008-03-29T04:48:00.000+05:30</published><updated>2008-03-29T04:51:51.720+05:30</updated><title type='text'>User Administration</title><content type='html'>1. Create a user :&lt;br /&gt;# adduser raj&lt;br /&gt;# grep raj /etc/passwd /etc/shadow&lt;br /&gt;/etc/passwd:raj:x:513:513::/home/raj:/bin/bash&lt;br /&gt;No point looking at /etc/passwd since nothing&lt;br /&gt;changes there&lt;br /&gt;/etc/shadow:raj:!!:13034:0:99999:7:::&lt;br /&gt;&lt;br /&gt;2. chage -d 0 raj&lt;br /&gt;The 3rd field of /etc/shadow is :&lt;br /&gt;Days since Jan 1, 1970 that password was last changed&lt;br /&gt;We make it 0, which means the passwd was last changed on&lt;br /&gt;Jan 1, 1970 and hence has expired, so it is promptly locked&lt;br /&gt;with this : --&gt; !!&lt;br /&gt;# grep raj /etc/shadow&lt;br /&gt;/etc/shadow:raj:!!:0:0:99999:7:::&lt;br /&gt;&lt;br /&gt;3. Test the password status :&lt;br /&gt;# passwd -S raj&lt;br /&gt;Password locked.&lt;br /&gt;raj cannot log in, yet&lt;br /&gt;&lt;br /&gt;4. Unlock the password, forcefully&lt;br /&gt;# passwd -uf raj&lt;br /&gt;Unlocking password for user raj.&lt;br /&gt;passwd: Success.&lt;br /&gt;This changes the !! to a blank which means the password is now unlocked&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-2659536056549859941?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/2659536056549859941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=2659536056549859941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/2659536056549859941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/2659536056549859941'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/user-administration.html' title='User Administration'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-8564253888358503032</id><published>2008-03-29T04:37:00.000+05:30</published><updated>2008-03-29T04:48:00.929+05:30</updated><title type='text'>Faqs</title><content type='html'>1. When u press Alt+F2 and login in, which files are executed ?&lt;br /&gt;Ans.&lt;br /&gt;/etc/issue&lt;br /&gt;$HOME/.hushlogin iff not exists&lt;br /&gt;* mingetty checks for .hushlogin in $HOME&lt;br /&gt;If $HOME/.hushlogin DOES NOT EXISTS then it does the foll :&lt;br /&gt;- execs lastlog* -u $USER using /var/log/lastlog&lt;br /&gt;- execs /etc/motd&lt;br /&gt;- checks users mail, if any&lt;br /&gt;/etc/profile&lt;br /&gt;/etc/inputrc&lt;br /&gt;/etc/termcap&lt;br /&gt;/etc/profile.d/*.sh [13 shell scripts executed]&lt;br /&gt;/etc/bashrc&lt;br /&gt;$HOME/.bash_profile&lt;br /&gt;Misc: $HOME/.bash_history&lt;br /&gt;$HOME/.bash_logout&lt;br /&gt;$HOME/.bashrc&lt;br /&gt;&lt;br /&gt;2. LILO to GRUB : Change your bootloader&lt;br /&gt;Ans.&lt;br /&gt;# grub-install /dev/hda&lt;br /&gt;Config file : /etc/lilo.conf&lt;br /&gt;If you re-install Win$, you must boot from a boot floppy and do a 'lilo -v'&lt;br /&gt;&lt;br /&gt;3. GRUB to LILO : Change your bootloader&lt;br /&gt;Ans.&lt;br /&gt;a. cp /etc/lilo.conf.anaconda /etc/lilo.conf&lt;br /&gt;b. lilo -v [-t]&lt;br /&gt;Config file : /boot/grub/grub.conf&lt;br /&gt;: /etc/grub.conf [symlink to above]&lt;br /&gt;If you re-install Win$, no effect on Linux since MBR does not contain&lt;br /&gt;code except for a small loader which loads the main grub in 2 stages :&lt;br /&gt;/usr/share/grub/i386-redhat/stage1 512 bytes&lt;br /&gt;/usr/share/grub/i386-redhat/stage2 104K&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. To put a password in GRUB :&lt;br /&gt;Ans.&lt;br /&gt;password --md5 $1$JfobY0$HevBan5wGn.C/eteLH/jT1&lt;br /&gt;# grub-md5-crypt&lt;br /&gt;&gt;&gt; vashi123&lt;br /&gt;&gt;&gt; vashi123&lt;br /&gt;Now copy / paste this readable but scrambled password in grub.conf&lt;br /&gt;It is the md5 encrypted equivalent of 'vashi123'&lt;br /&gt;&lt;br /&gt;5. To uninstall Linux :&lt;br /&gt;Ans.&lt;br /&gt;# fdisk /dev/hda and delete all Linux partitions&lt;br /&gt;# lilo -u Uninstall lilo&lt;br /&gt;or&lt;br /&gt;# Boot with Win$ startup disk&lt;br /&gt;A:&gt; fdisk /mbr&lt;br /&gt;A:&gt; Now reboot and you will have Win$ only&lt;br /&gt;&lt;br /&gt;6. LILO : To create a boot floppy if your boot loader is LILO&lt;br /&gt;Ans.&lt;br /&gt;# uname -r&lt;br /&gt;2.4.20-8&lt;br /&gt;# mkbootdisk 2.4.20-8&lt;br /&gt;Obviously the floppy should not be mounted !&lt;br /&gt;Shorter version :&lt;br /&gt;# mkbootdisk `uname -r`&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. GRUB : To create a boot floppy if your boot loader is GRUB&lt;br /&gt;Ans.&lt;br /&gt;Get a working floppy !&lt;br /&gt;1. # mke2fs /dev/fd0&lt;br /&gt;2. # mount /mnt/floppy&lt;br /&gt;3. # cd /mnt/floppy&lt;br /&gt;4. # mkdir -p boot/grub&lt;br /&gt;5. # cd /boot/grub/&lt;br /&gt;6. # cp stage1 /mnt/floppy/boot/grub/&lt;br /&gt;7. # cp stage2 /mnt/floppy/boot/grub/&lt;br /&gt;8. # cp grub.conf /mnt/floppy/boot/grub/&lt;br /&gt;9. # grub --batch &lt;&lt;&gt; root (fd0)&lt;br /&gt;&gt; setup (fd0)&lt;br /&gt;&gt; quit&lt;br /&gt;&gt; EOT&lt;br /&gt;The moment you press Enter, a Boot grub floppy is created.&lt;br /&gt;Boot with it to test it!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. To Change the splash screen in grub :&lt;br /&gt;Ans.&lt;br /&gt;Using ImageMagick-5.4.7-10 software&lt;br /&gt;* /usr/bin/identify -v bear.jpg&lt;br /&gt;* /usr/bin/convert&lt;br /&gt;* /usr/bin/animate&lt;br /&gt;* /usr/bin/composite&lt;br /&gt;* /usr/bin/conjure&lt;br /&gt;* /usr/bin/display&lt;br /&gt;* /usr/bin/import&lt;br /&gt;* /usr/bin/mogrify&lt;br /&gt;* /usr/bin/montage&lt;br /&gt;Consider bear.jpg&lt;br /&gt;1. convert -depth 8 -colors 14 -resize 640x480 bear.jpg bear.xpm&lt;br /&gt;Has to be max 14 colors&lt;br /&gt;Has to be 640x480 resolution&lt;br /&gt;Has to be xpm format [X Windows System pixmap (color)]&lt;br /&gt;See man ImageMagic&lt;br /&gt;2. Now gzip the bear.xpm&lt;br /&gt;# gzip bear.xpm -------&gt; bear.xpm.gz&lt;br /&gt;3. Copy it to /boot/grub/&lt;br /&gt;# cp bear.xpm.gz /boot/grub/&lt;br /&gt;4. Configure /boot/grub/grub.conf&lt;br /&gt;splashimage=(hd0,11)/grub/bear.xpm.gz&lt;br /&gt;5. reboot&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-8564253888358503032?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/8564253888358503032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=8564253888358503032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8564253888358503032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/8564253888358503032'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/faqs.html' title='Faqs'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-1543830847236550096</id><published>2008-03-29T04:10:00.000+05:30</published><updated>2008-03-29T04:36:46.402+05:30</updated><title type='text'>Linux Boot Process</title><content type='html'>======================&lt;br /&gt;The Linux Boot Process&lt;br /&gt;=======================&lt;br /&gt;Part I&lt;br /&gt;======&lt;br /&gt;01. Power On&lt;br /&gt;02. ROM - BIOS loaded into RAM auto by the boot code at the start of ROM [bootstrap]&lt;br /&gt;Purpose of BIOS : Load the OS - any/some OS&lt;br /&gt;03. POST - HW Inventory - Int 19H&lt;br /&gt;04. CMOS - [Current bootable devices]&lt;br /&gt;05. BIOS loads/starts [boots] whatever it finds in the first Sector [Sect 1]  of HDD into RAM i.e. [cylinder 0, head 0, sector 1 of a hard disk]&lt;br /&gt;- This first Sector is aka the MBR [on Windows-based systems]&lt;br /&gt;Note: There is only one MBR per HDD, obviously !!&lt;br /&gt;** During installation, when the Linux kernel is being installed, its exact size and location [CHS] on the HDD is stored in /boot/map in the /boot partition. By that we mean, the exact CHS no on the HDD of where it installed /boot/vmlinuz-2.4.20-8 Tis is the address of the Linux kernel on the HDD&lt;br /&gt;06. BIOS then loads/executes [boots/runs] this first stage BL - which is&lt;br /&gt;LILO [i.e /boot/boot.b] which is in the BS of the MBR and put there at install time AND NOT&lt;br /&gt;/boot/boot.b from the /boot partition] and Transfers control to the it&lt;br /&gt;Tis is called the 1st stage of bootloading&lt;br /&gt;07. This first-stage BL has but one purpose in life : To load the 2nd stage BL.&lt;br /&gt;08. Makes BIOS calls - Int 13 fn 8 --&gt; "Get drive parameters" and - Int 13 fn 2 --&gt; "Read sectors from drive" - which returns the disk geometry in 24-bit address format upto the&lt;br /&gt;1024 cylinder limit.&lt;br /&gt;Since you have enabled the LBA mode, 64-bit address format is used and&lt;br /&gt;instead of the CHS way, BIOS reads the disk by numbering the sectors&lt;br /&gt;from 1,2,3... etc&lt;br /&gt;The requested info from this BIOS call is stored by the BIOS in the first&lt;br /&gt;page of memory ( &lt; 4k )&lt;br /&gt;09. The first-stage loader then requests the BIOS for an Int 13 fn 2, gives it&lt;br /&gt;the CHS # of the /boot/boot.map file&lt;br /&gt;Now the BL speaks CHS and the BIOS speaks 24-bit addresses.&lt;br /&gt;It is LBA which allows the BIOS to act as a speaker of both, CHS and&lt;br /&gt;Linear Sector Addressing - using 64-bit addresses - Translator&lt;br /&gt;10. BIOS loads this 2nd stage BL - from the CHS no supplied by the 1st stage&lt;br /&gt;11. The 2nd-stage BL now loads the contents of the balance of the BS into the RAM&lt;br /&gt;And what is that ?&lt;br /&gt;/etc/lilo.conf&lt;br /&gt;Not the file lilo.conf in dir /etc&lt;br /&gt;but the contents of the BS - which is the same file - but in binary form&lt;br /&gt;and was put there by the installer&lt;br /&gt;12. The 2nd stage BL now examines this binary-format-BS which contains&lt;br /&gt;"lilo.conf" and follows the instructions given there !!&lt;br /&gt;It requests BIOS for an Int 13h and gives it the CHS # of the&lt;br /&gt;/boot/message file which BIOS promptly fetches and the 2nd stage BL&lt;br /&gt;executes - This is the splash screen&lt;br /&gt;13. The 2nd stage BL then executes the instructions it got from the BS&lt;br /&gt;after the 1st stage had loaded it, and executes those instructions&lt;br /&gt;/etc/lilo.conf&lt;br /&gt;==============&lt;br /&gt;prompt &lt;--------- Display labels&lt;br /&gt;timeout=50 &lt;--------- In decisecs&lt;br /&gt;default=linux &lt;--------- What to do after timeout&lt;br /&gt;boot=/dev/hda &lt;--------- Where to install the 1st stage BL&lt;br /&gt;Here, in the BS of the MBR of Primary&lt;br /&gt;Master HDD&lt;br /&gt;map=/boot/map &lt;--------- Location of map file which contains size and location of&lt;br /&gt;ll=/boot/boot.b &lt;--------- Boot sector image/file for MBR or&lt;br /&gt;1st stage LILO to be installed in BS of the MBR&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Message=/boot/message&lt;-------- Splash Screen&lt;br /&gt;lba32&lt;br /&gt;image=/boot/vmlinuz-2.4.20-8 &lt;------ Big Boss - The Linux kernel&lt;br /&gt;label=linux &lt;------ An unscary word for the kernel&lt;br /&gt;initrd=/boot/initrd-2.4.20-8.img &lt;--- Image of support modules&lt;br /&gt;read-only&lt;br /&gt;append="hdc=ide-scsi root=LABEL=/" &lt;--- Parameters LILO will pass to&lt;br /&gt;init before it starts&lt;br /&gt;other=/dev/hda1 Another OS&lt;br /&gt;optional&lt;br /&gt;label=DOS&lt;br /&gt;14. After timing out AND IF the default image is the Linux kernel, and IT IS&lt;br /&gt;in the case above, the 2nd stage boot loader - /boot/boot.b -&lt;br /&gt;loads the Linux kernel in RAM&lt;br /&gt;15. Now what is a BootLoader ?&lt;br /&gt;BootLoaders load "kernel images" into mem and hand control of the CPU&lt;br /&gt;over to the newly loaded kernel [/boot/vmlinuz-2.4.20.8]&lt;br /&gt;To make your new kernel work, you must tell the BL about the kernel&lt;br /&gt;Nearly all BLs use and understand CHS numbers.&lt;br /&gt;[BIOS can now understand CHS nos too, bcos of LBA]&lt;br /&gt;16. Now the 2nd-stage wishes to load the kernel, as instructed by the&lt;br /&gt;binary-format lilo.conf after timing out or whatever the user chooses&lt;br /&gt;But there's a problem !!&lt;br /&gt;The Linux kernel is on the HDD !!&lt;br /&gt;In /boot to be precise !!&lt;br /&gt;And the 2nd-stage LILO BL has no idea how to access the HDD&lt;br /&gt;Why ?&lt;br /&gt;The HDD drivers - /dev/hda... are in /dev on the HDD&lt;br /&gt;and to access it the 2nd stage BL requires the file /dev/hda&lt;br /&gt;which once again is itself on the HDD !!&lt;br /&gt;Hen-and-Egg situation !!&lt;br /&gt;17. The 2nd stage BL has no choice but to use the BIOS as its HDD device&lt;br /&gt;driver to access the HDD at boot time.&lt;br /&gt;After all that's where the kernel is [/boot/vmlinuz-2.4.20-8] !!&lt;br /&gt;18. The 2nd stage BL once again requests BIOS - Int 13h fn 2 - and hands it&lt;br /&gt;the CHS # of the /boot/map file, which BIOS loads&lt;br /&gt;19. The 2nd stage loader now examines this /boot/map and extracts the&lt;br /&gt;CHS # inside it - which was put there by the BL installer - anaconda -&lt;br /&gt;and /sbin/lilo - and requests BIOS once more to load whatever is there&lt;br /&gt;in that CHS # address&lt;br /&gt;17. BIOS then loads the Linux kernel /boot/vmlinuz-2.4.20-8 into the RAM&lt;br /&gt;and hands it to the 2nd stage BL&lt;br /&gt;18. The 2nd stage BL uncomptars this file and fills the memory with kernel&lt;br /&gt;mem structures which can be seen in the /proc virtual file system&lt;br /&gt;The Engine Of The Car Is Ready And Running !!&lt;br /&gt;The Linux OS is ready and running !! Kernel Land is ready !!&lt;br /&gt;BUT WE FORGOT TO MAKE THE CAR PROPER ITSELF !! No Userland !!&lt;br /&gt;How do we drive this car if there is no seat, steering wheel. Nothing.&lt;br /&gt;Just an engine !!&lt;br /&gt;=============================&lt;br /&gt;Part II /sbin/init takes over&lt;br /&gt;=============================&lt;br /&gt;19. Now that the Linux Kernel is in the RAM, and is much more powerful&lt;br /&gt;and immensely larger than the 2nd stage BL, it takes over total control&lt;br /&gt;from it and makes yet another BIOS call Int 13h fn 2 for the&lt;br /&gt;file /boot/initrd-2.4.20-8.img&lt;br /&gt;20. It uncompresses it in RAM and creates a mini-FS as can be seen if&lt;br /&gt;we look inside the image&lt;br /&gt;# mount -o loop /boot/initrd-2.4.20-8.img /win&lt;br /&gt;# cd /win&lt;br /&gt;# ls&lt;br /&gt;21. Note that the HDD driver is available now; Hence the kernel executes the&lt;br /&gt;"linuxrc" script which mounts the "root" partition in R/O mode and&lt;br /&gt;loads the /sbin/init* program into RAM&lt;br /&gt;The Userland Part of Linux is now started by the /sbin/init daemon&lt;br /&gt;22. /sbin/init* examines /etc/inittab&lt;br /&gt;&lt;br /&gt;/etc/inittab&lt;br /&gt;============&lt;br /&gt;id:3:initdefault:&lt;br /&gt;# System initialization.&lt;br /&gt;si::sysinit:/etc/rc.d/rc.sysinit&lt;br /&gt;l0:0:wait:/etc/rc.d/rc 0&lt;br /&gt;l1:1:wait:/etc/rc.d/rc 1&lt;br /&gt;l2:2:wait:/etc/rc.d/rc 2&lt;br /&gt;l3:3:wait:/etc/rc.d/rc 3&lt;br /&gt;l4:4:wait:/etc/rc.d/rc 4&lt;br /&gt;l5:5:wait:/etc/rc.d/rc 5&lt;br /&gt;l6:6:wait:/etc/rc.d/rc 6&lt;br /&gt;ls:S:wait:/etc/rc.d/rc S&lt;br /&gt;~:S:respawn:/sbin/sulogin&lt;br /&gt;# Trap CTRL-ALT-DELETE&lt;br /&gt;ca::ctrlaltdel:/sbin/shutdown -t3 -r now&lt;br /&gt;pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"&lt;br /&gt;# If power was restored before the shutdown kicked in, cancel it.&lt;br /&gt;pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"&lt;br /&gt;# Run gettys in standard runlevels&lt;br /&gt;1:2345:respawn:/sbin/mingetty --noclear tty1&lt;br /&gt;2:2345:respawn:/sbin/mingetty tty2&lt;br /&gt;3:2345:respawn:/sbin/mingetty tty3&lt;br /&gt;4:2345:respawn:/sbin/mingetty tty4&lt;br /&gt;5:2345:respawn:/sbin/mingetty tty5&lt;br /&gt;6:2345:respawn:/sbin/mingetty tty6&lt;br /&gt;11:2345:respawn:/sbin/mingetty tty11&lt;br /&gt;# Run xdm in runlevel 5&lt;br /&gt;x:5:respawn:/etc/X11/prefdm -nodaemon&lt;br /&gt;=======================================================================&lt;br /&gt;23. a. Executes /etc/rc.d/rc.sysinit in a subshell of inittab shell&lt;br /&gt;rc.sysinit&lt;br /&gt;==========&lt;br /&gt;calls /etc/sysconfig/network in same env [shell]&lt;br /&gt;sets the hostname and checks whether NW is yes or no&lt;br /&gt;ie checks for existence for NW card&lt;br /&gt;calls /etc/init.d/functions script in the same env [i.e rc.sysinit]&lt;br /&gt;sets global umask and path and defines 17 shells fns&lt;br /&gt;within the rc.sysinit shell env&lt;br /&gt;# cat functions  grep \(\)sortnl&lt;br /&gt;/etc/init.d/functions&lt;br /&gt;=====================&lt;br /&gt;1 action() {&lt;br /&gt;2 checkpid() {&lt;br /&gt;3 confirm() {&lt;br /&gt;4 daemon() {&lt;br /&gt;5 echo_failure() {&lt;br /&gt;6 echo_passed() {&lt;br /&gt;7 echo_success() {&lt;br /&gt;8 echo_warning() {&lt;br /&gt;9 failure() {&lt;br /&gt;10 killproc() {&lt;br /&gt;11 passed() {&lt;br /&gt;12 pidfileofproc() {&lt;br /&gt;13 pidofproc() {&lt;br /&gt;14 status() {&lt;br /&gt;15 strstr() {&lt;br /&gt;16 success() {&lt;br /&gt;17 warning() {&lt;br /&gt;24. Displays the "Welcome to Red Hat..." from /etc/redhat-release&lt;br /&gt;25. Runs dmesg* which creates /var/log/dmesg and&lt;br /&gt;display its contents on the screen&lt;br /&gt;26. Mounts all local filesystems from /etc/fstab and updates /etc/mtab&lt;br /&gt;Mount simply displays the contents of /etc/mtab&lt;br /&gt;Now /etc/rc.d/rc.sysinit script ends !!&lt;br /&gt;Summary: rc.sysinit : 1. sets the global umask, global PATH,&lt;br /&gt;sets up the NW'ing subsystem&lt;br /&gt;Basically starts the System Daemons&lt;br /&gt;b. Back to inittab&lt;br /&gt;27. rc is executed in a new subshell of /etc/inittab&lt;br /&gt;starts and stops the Application NWing daemons&lt;br /&gt;runs /etc/rc.d/rc.local which is a symlink in all RLs and is the&lt;br /&gt;only script which is run regardless of the RL and is&lt;br /&gt;S99local in all /etc/rc.d/rc?.d/...] and points to&lt;br /&gt;/etc/rc.d/rc.local&lt;br /&gt;goes back to inittab&lt;br /&gt;Summary: rc : starts the 3rd party NW services [User NW services]&lt;br /&gt;Basically starts the Application Daemons&lt;br /&gt;i.e all the * in ntsysv&lt;br /&gt;&lt;br /&gt;28. c. shutdown CAD magic keys are set - You can hack it if you wish&lt;br /&gt;29. d. poweroff and poweron considerations [start upsd* daemon "ups" initscript&lt;br /&gt;which reads /etc/sysconfig/ups  which you will configure for your UPS model&lt;br /&gt;&lt;br /&gt;30 e. 6 mingettys are spawned with dev drvs ; all enter sleep state&lt;br /&gt;- EXCEPT one&lt;br /&gt;31.f. Iff Runlevel 5, then script "prefdm" is executed..&lt;br /&gt;we will do this in class of X&lt;br /&gt;NOW INITTAB IS OVER&lt;br /&gt;========&lt;br /&gt;Part III&lt;br /&gt;========&lt;br /&gt;Note:&lt;br /&gt;What is a getty? [RHL has agetty* [Alternate Linux getty]&lt;br /&gt;mgetty* [Modem getty]&lt;br /&gt;mingetty* [Minimal getty]&lt;br /&gt;A getty is is a program that opens a tty port, prompts for a login name,&lt;br /&gt;and runs the /bin/login command. It is normally invoked by init.&lt;br /&gt;32 g. The first mingetty [awake one] loads dev drv /dev/tty1&lt;br /&gt;* execs /etc/issue [Magic cookies Allowed: man uname / man mingetty]&lt;br /&gt;33. * mingetty then executes the /bin/login process&lt;br /&gt;and is then put to sleep state by init&lt;br /&gt;34. * /bin/login displays login. You login!&lt;br /&gt;35. * /bin/login execs /usr/bin/passwd which challenges for passwd from&lt;br /&gt;user which then does authentication and authorization using PAM&lt;br /&gt;36. * init then puts the login daemon into sleep state, wakes up&lt;br /&gt;mingetty which now takes over&lt;br /&gt;37. * mingetty checks for .hushlogin in $HOME/$USER&lt;br /&gt;38. If $HOME/.hushlogin DOES NOT EXISTS&lt;br /&gt;then it does the foll :&lt;br /&gt;39. - execs lastlog* -u $USER using /var/log/lastlog&lt;br /&gt;- execs /etc/motd&lt;br /&gt;- checks users mail, if any, in /var/spool/mail/$USER&lt;br /&gt;40. * init then wakes /bin/login process&lt;br /&gt;41. * mingetty then goes into zombie state and is killed by init&lt;br /&gt;42. * login then loads /bin/bash as a monitored child process&lt;br /&gt;43. * /bin/bash takes over and login goes into sleep state&lt;br /&gt;44. * Execs /etc/profile Sets system-wide ENV variables Global Profile&lt;br /&gt;exec /etc/inputrc Sets keyb mappings [See stty -a]&lt;br /&gt;Show Terminal characteristics&lt;br /&gt;eg # stty intr ^g --&gt; Keyboard mapping&lt;br /&gt;# stty -echo --&gt; Terminal Characteristics&lt;br /&gt;eg /etc/inputrc See man bash - /bell-style&lt;br /&gt;============&lt;br /&gt;set bell-style [audible] [none] [visible]&lt;br /&gt;set disable-completion [off] on&lt;br /&gt;To do it per-user:&lt;br /&gt;=================&lt;br /&gt;setterm -blength 0 [in per user .bash_profile]&lt;br /&gt;or&lt;br /&gt;xset b off [in GUI]&lt;br /&gt;[bash -r, --noediting as args in /etc/passwd&lt;br /&gt;7th field]&lt;br /&gt;45. exec /etc/termcap Sets the terminal capabilities&lt;br /&gt;46. exec /etc/profile.d/*.sh [13 shell scripts are executed]&lt;br /&gt;1. colorls.sh&lt;br /&gt;2. glib2.sh&lt;br /&gt;3. gnome-ssh-askpass.sh&lt;br /&gt;4. krb5.sh&lt;br /&gt;5. lam.sh&lt;br /&gt;6. lang.sh&lt;br /&gt;7. less.sh&lt;br /&gt;8. mc.sh&lt;br /&gt;9. pvm.sh&lt;br /&gt;10. qt.sh&lt;br /&gt;11. vim.sh&lt;br /&gt;12. which-2.sh&lt;br /&gt;13. xpvm.sh&lt;br /&gt;47. i. * Execs /etc/bashrc - Sets system-wide [Global] aliases/shell functions&lt;br /&gt;sets the users and root's final global umask&lt;br /&gt;48. * execs user's personal .bash_profile&lt;br /&gt;49. execs .bashrc Run after every command you execute&lt;br /&gt;50. .bash_history&lt;br /&gt;51. .bash_logout&lt;br /&gt;52. Finally, at last, the comforting shell login prompt bash&lt;br /&gt;inviting you type a cmd and explore the party [FS] !!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-1543830847236550096?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/1543830847236550096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=1543830847236550096' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1543830847236550096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1543830847236550096'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/linux-boot-process.html' title='Linux Boot Process'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5374034941645378319.post-1896693280908427037</id><published>2008-03-29T03:13:00.000+05:30</published><updated>2008-03-29T04:09:52.008+05:30</updated><title type='text'>Comparison between DOS and Linux Commands</title><content type='html'>&lt;strong&gt;&lt;em&gt;DOS command //  Linux Commands&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt; 1. dir //  ls&lt;br /&gt; 2. dir/w  // ls -l aka ll&lt;br /&gt; 3. dir/p  // ls -lmore ;  ls -lless&lt;br /&gt; 4. dir/s //  ls -R recursive&lt;br /&gt; 5.  cls  //    clear&lt;br /&gt; 6.  type //  cat&lt;br /&gt; 7.   cd // pwd&lt;br /&gt; 8.  md // mkdir&lt;br /&gt; 9.  rd  // rmdir If empty&lt;br /&gt;10. del // rm&lt;br /&gt;11. move/ren //  mv&lt;br /&gt;12. copy  // cp&lt;br /&gt;13. xcopy  // cp -a&lt;br /&gt;14. deltree // rm -fr &lt;dirname&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5374034941645378319-1896693280908427037?l=linuxconcept.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxconcept.blogspot.com/feeds/1896693280908427037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5374034941645378319&amp;postID=1896693280908427037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1896693280908427037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5374034941645378319/posts/default/1896693280908427037'/><link rel='alternate' type='text/html' href='http://linuxconcept.blogspot.com/2008/03/comparison-of-dos-and-linux-commands.html' title='Comparison between DOS and Linux Commands'/><author><name>varghese</name><uri>http://www.blogger.com/profile/11502033650710309585</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
