NFS: Network File System
1. install NFS in server
yum install nfs-utils
note: how to verify if a package is already installed or not
rpm -qa | grep "nfs"
2. start and enable the serivce
# service nfs start
# chkconfig nfs on
3. add the follwoing entry in /etc/exports file
/king -rw 192.168.2.0/24
/queen -ro 192.168.2.0/24
4. restart nfs service
service nfs restart
---------------------------------------------------------------------------
how to access NFS share in client machine:
1. verify the NFS shares available at server
#showmount -e 192.168.2.250
2. mount the network file system(share)
# mount -t nfs 192.168.2.250:/king /sample
3. mounting permanently
# vi /etc/fstab
192.168.2.250:/king /sample nfs defaults 0 0
====================================================================
autofs: In NFS once if FS is mounted, it will be utilizing n/w resources till the FS is unmounted. to overcome this, we have autofs which will automatically unmount the partition if it is no longer in use(5 mins)
1. install autofs
yum install autofs
2. start & enable the service
service autofs start
chkconfig autofs on
3. How to access NFS using default autofs setup
#cd /net
#cd 192.168.2.250
#cd king
==>configuration file for autofs is '/etc/auto.master'
Confguring user defined AUTOFS:
1. add the follwoing line in /etc/auto.master
/stage /etc/auto.demo
(or)
/stage /etc/auto.demo --timeout=600 --> setting our own timeout
2. create a file /etc/auto.demo and add following
king -rw 192.168.2.250:/king
raj -rw 192.168.2.250:/queen
3. reload autofs
service autofs reload
4. verify auto mounts
#cd /stage/king
==========================================================================
CIFS: COMMON INTERNET FILE SYSTEM
1. INSTALL THE PAackage SAMBA
yum install samba
2. start and enable 'smb' service
service smb start
chkconfig smb on
3.create samba user accounts
# useradd -s /sbin/nologin uclid01
# smbpasswd -a uclid01
passwd:
4. Configuration file for CIFS is /etc/samba/smb.conf
do folliwing modifications to share a folder called '/king'
line 74 : workgroup = WORKGROUP
line 80 : hosts allow = 192.168.2. [uncomment and do modification]
* comment share definitions [homes] and [printers]
* add following at end of file
[public]
comment = sample CIFS share
path = /king
public = yes
writable = yes
printable = no
browsable = yes
write list = uclid01 --user who can access it
5. restart smb service
service smb restart
6. verify share is available or not
smbclient -L //192.168.2.250 -U user01
How to access CIFS Share from windows:
Run--> \\192.168.2.250
How to access the cIFS share in LINUX box:
# verify
smbclient -L //192.168.2.250 -U uclid01
# mount
mount -t cifs -o username=uclid01 //192.168.2.250/public /smb
(or)
mount -t cifs -o username=uclid01,password=uclid01 //192.168.2.250/public /smb
How to mount CIFS PErmanently:
1. creaye a login credential file as follows:
cat > /.smbaccount
username=uclid01
password=uclid01
ctrl+d
2. set '600' permissions to the file
chmod 600 /.smbaccount
3. add the following entry in fstab file
//192.168.2.250/public /smb cifs credentials=/.smbaccount 0 0
------------------------------------------------------------------------------
FTP: File Transfer Protocol
* public ftp
* ftp with user account
1. How to install?
# yum install vsftpd
2. start and enable service
#service vsftpd start
#chkcinfig vsftpd on
3. Default location for 'PUB' folder
/var/ftp/pub
Add some files in above folder and access them through ftp
4. configuration files location: /etc/vsftpd/
Comments
Post a Comment