NFS FILE SERVER

Saturday, May 23, 2009
Your Ad Here
By default the RedHat linux has built in Kernel support for NFS.
The Filesystem to share are defined in /etc/exports file.
In our lab session, we will configure our web server so that users can access their respective home directory and will have read- only access to /all directory. We must remind whatever share permission we specify in the /etc/exports file, the most restrictive settings will activated. The IP address of our NFS server is 192.168.100.2.
First of all, edit the /etc/exports file by inserting the following lines
/all *(ro)
/home *(rw)
Export the share using the following command –
exportfs –a –v
Restart the service –
service nfs restart
service nfslock restart

Check which folders are NFS shared –
exportfs
Go to any client computer, make a directory using mkdir command say /all
mkdir /all
Assign necessary permission, here we will set – chmod 705 –R /all
Mount the NFS shared directory to your client’s computer
mount 192.168.100.2:/all /all
At this point, users from your client computer will access /all directory in your NFS server.
Yes, it is read-only access.
Now, you have to configure your network such a way, so that, whenever a user logs in to any computer, he will get the same file system and hierarchy in his/her home directory.
In fact, whenever a user saves files to his/her home directory, it will be saved to NFS Server.

Labels: , , , , , , , , , , ,

 
posted by Gautam at 2:26 AM, | 0 comments

Working with Boot Loader

Wednesday, May 13, 2009
Your Ad Here
Let us know, how we can configure our boot loader.In linux the file is
/boot/grub/grub.conf. You will find a soft link of this file in /etc directory.
The boot loader file specifies the computer where the system files exist in our system so that the computer can boot perfectly. The grub.conf understands Microsoft’s boot loader file also. If we have multiboot system, we can configure the linux boot loader file, /boot/grub/grub.conf to set the default operating system and how long the computer can wait before booting the system with the default operating system.
Let us have a look at the screen shot below for /boot/grub/grub.conf file.

According to the above example, there is only one operating system loaded – the Red Hat Enterprise Linux, see the title section here. You are open to change the contents of the title . The default=0 tells the system to boot using the OS referred by the first title. The timeout=5 defines that the system will wait for 5 seconds before booting with the default Operating system. The splashimage is nothing but the image you see in the boot loader screen. Here, considering you have a dual booting system, you may choose which Operating System will be loaded. The hiddenmenu does what its name implies – it hides the menu. The root (hd0,0) indicates where the system will find the root of the booting related files. In Red Hat linux, the name of the directory is /boot. The hd0,0 section could be different in accordance with the partition information in your hard disk. Here hd0,0 indicates the first partition in the first hard disk. The next two lines defines the kernel and initrd image file name.Let us check another grub.conf file below –
# grub.conf generated by anaconda
#
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
root (hd0,1)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /initrd-2.4.18-14.img
title DOS
rootnoverify (hd0,0)
chainloader +1
# end of file
According to the above file the computer’s default operating system is Red Hat Linux. You
know, why !!. If you want to set DOS as the default, what we can do is just change the
value for ‘default’. Replace 0 with 1.
At this point if you reboot the computer you will see at the top Red Hat Linux exists though the DOS has been selected. If you interchange the title directives, you will see at the top DOS exists and it has also been selected.
Here is the modified /boot/grub/grub.conf file....
# grub.conf generated by anaconda
#
#boot=/dev/hda
default=0
timeout=20
splashimage=(hd0,1)/grub/splash.xpm.gz
title DOS
rootnoverify (hd0,0)
chainloader +1
title Red Hat Linux (2.4.18-14)
root (hd0,1)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /initrd-2.4.18-14.img
# end of file
Please note that, there is no need to run any command to make the change effective.

Labels: , , , , , , , , , , ,

 
posted by Gautam at 11:30 PM, | 0 comments

FTP SERVER

Monday, May 4, 2009
Your Ad Here
Setting up FTP server is a standard method for sharing files over the internet.
Two FTP server packages are provided with Linux RedHat 8 distribution, - the Washington
University FTPD (WUFTPD) and the Very Secure FTPD (VSFTPD).
Among the two, VSFTPD is considered to be better for high-volume FTP servers.
Access to the FTP server relies on a login process in the particular FTP server. Users with
their accounts on the system most likely have access to the greater part of the file system
after been authenticated comparing to ‘Anonymous’ user.
We will only concentrate to the VSFTPD configuration.
Setting up VSFTPD:
Start the VSFTPD FTP Server: Redhat 8
First of all check whether WUFTPD is running or not. To stop WUFTPD you must modify
the /etc/xinetd.d/wu-ftpd file. Replace the seeting
disable = no with disable = yes.
Edit the /etc/xinetd.d/vsftpd file by replacing the setting
disable = yes with disable = no
Restart the xinetd server by running the following command –
service xinetd restart or
/etc/init.d/xinetd restart
At this point, by default, anonymous users are given ‘read-only’ access to files and
subdirectories in /var/ftp.
Authenticated local users get access to their respective home directories.
With RHEL 3 or RHEL 4 starting ftp service is really simple. All you have to do is
exetcute the following command - service vsftpd restart .
To Start the ftp service in booting time, execute chkconfig vsftpd on
The vsftp ftp service configuration file is vsftpd.conf In case of Redhat 8, you will find
this file in /etc/ folder. In RHEL 3/4 you will find the file in /etc/vsftpd/ directory.
The vsftpd.conf file:
Configuration for the anonymous users:
By default, the anonymous users have read-only access to /var/ftp directory. The
default location for anonymous users can be changed by keeping the following directive in
the vsftpd.conf file – anon_root=/var/new .
Please be noted, whenever you modify the vsftpd.conf file, you need to restart the ftp service.
The anonymous_enable=YES option in vsftpd.conf file lets the anonymous users to access
the /var/ftp directory. It is the default setting.
If you want to disable anonymous access modify the
anonymous_enable=YES to anonymous_enable=NO
We can allow anonymous users to upload files using –
anon_upload_enable=YES option, provided that the directory or directories, where the
filess will be uploaded, are exist with write permission. For the security reason it is
always better to create a directory in /var/ftp with 777 permission – where the
anonymous users will upload their files.
Create a directory, say, public
mkdir /var/ftp/public
Set the permission
chmod 777 –R /var/ftp/public
We must keep in mind, ownership will be granted to ftp user for the files uploaded by
anonymous users. So, it is understandable, anonymous users get read-only access to the uploaded files.
If you want to allow the anonymous users to rename or delete the files in
/var/ftp/public directory, place the following option in the vsftpd.conf file –
anon_other_write_enable=YES
If you want to allow the anonymous users to create their own directory in the
/var/ftp/public directory, place the following option in the vsftpd.conf file –
anon_mkdir_write_enable=YES
If you want to configure the FTP server so that a particular user, say Linuxuser, will be
granted the ownership of the files uploaded by the anonymous users, place the following
options in the vsftpd.conf file –
chown_uploads=YES
chown_username=Linuxuser
Do not forget to restart ftp service –
service vsftpd restart

Labels: , , , , , , ,

 
posted by Gautam at 10:43 PM, | 0 comments

DUMP and RESTORE

Your Ad Here
DUMP and RESTORE:
Dump and Restore is used to take backup or restore ‘only ext2 or ext3’ file system. This
particular dump and restore utility can be u sed to take full or incremental backup.
To take a full backup of the /home filesystem onto the tape device nst1 we can use the
following command –
dump -0u-f /dev/nst0 /home
Here we specify 0 to define full backup and u (dump -0u-f /dev/nst0 /home)
is specified so that dump information will be recorded for future use of dump. Generally
administrators love to take full backup on weekly or monthly basis while regularly take
incremental backup. For incremental backup, the command may be as follows –
dump -4u-f /dev/nst0 /home
Please note, we use 4 instead of 0 to define incremental backup.
To restore data backed up with dump command we use restore command. For example,
suppose we had /dev/hda9 mounted on /home. On a clean device mounted on /home,
first of all we should change the working directory there and then use the following
command – restore –rf /dev/nst0
Whenever we use dump command using –u option, it will update /etc/dumpdates, which
actually contents the dump-information.

SOME BACKUP RELATED COMMANDS:

To Erase Dat Drive
mt –f /dev/st0 erase
To rewind the Dat Drive
mt –f /dev/st0 rewind
To backup the www Server
find /etc/httpd/conf /usr/local –print | cpio –ovcB > /dev/st0
To backup up Sendmail Mail Server
find /var /home /etc/mail –print | cpio –ovcB > /dev/st0

Labels: , , , , , , , , , ,

 
posted by Gautam at 4:41 AM, | 0 comments

SCHEDULING TASKS:

Saturday, May 2, 2009
Your Ad Here
Using the ‘at’ utility. The at facilty is designed to run jobs at specific times. Submitted jobs are spooled to /var/spool/at directory.
The daemon name is atd. Access Control Files:
/etc/at.allow - Contains list of users who are granted to submit ‘at’ jobs.
/etc/at.deny - Contains list of users who have ‘No’ permission to submit ‘at’ jobs.
Let us see how can we use the ‘at’ facility. For Example, we need to copy the contents of /home directory in compressed form to /tmp/backup directory.
To do this, we can run the following commands –
at 12:00
cd /home
mkdir /tmp/home
mkdir /tmp/backup
cp –Rf * /tmp/home
cd /tmp/home
tar czvf backup.tar.gz *
cp backup.tar.gz /tmp/backup
+d
We can also run a single command to make this happen – this command will do the same task above.
echo “cd /home; mkdir /tmp/home; mkdir /tmp/backup; cp –Rf * /tmp/home; cd
/tmp/home; tar czvf backup.tar.gz *; cp backup.tar.gz /tmp/backup” | at 12:00
Example for specifying times for at jobs:
at now The job will run immediately
at now + 2 minutes The job will run 2 minutes from the current time.
at next hour The job will run after 1 hour from the current time.
at next month The job will run after 1 month from the current time.
at next year The job will run after 1 year from the current time.
at next fri The job will run on next Friday
at 16:00 today The job will run today at 16 hours.
at 16:00 tomorrow The job will run tomorrow at 16 hours
at 16:00 May 31 2004 The job will run on May 31s t , 2004 at 16 hours
I think, the most efficient way to use the at facility with –f option.
• f option can be used to use contents of a file to executed as ‘at’ command.
For Example, if we use the following command –
at –f /home/newback now + 10 hours
The system will see the contents of the /home/newback file and use them as ‘at’ command

Labels: , , , , , , , ,

 
posted by Gautam at 2:31 AM, | 0 comments