[root@test test1]# echo $HOME /root [root@test test1]# echo $USER root [root@test test1]# [root@test test1]# cat sayH.sh echo ...

Shell Script

[root@test test1]# echo $HOME
/root
[root@test test1]# echo $USER
root
[root@test test1]#


[root@test test1]# cat sayH.sh
echo " Type your first name"
read fname
echo "MY first name is" $fname
[root@test test1]#



How to change a color in shell script

Black="\[\033[0;30m\]"        # Black
Red="\[\033[0;31m\]"          # Red
Green="\[\033[0;32m\]"        # Green
Yellow="\[\033[0;33m\]"       # Yellow
Blue="\[\033[0;34m\]"         # Blue
Purple="\[\033[0;35m\]"       # Purple
Cyan="\[\033[0;36m\]"         # Cyan
White="\[\033[0;37m\]"        # White

Red="\[\033[1;31m\]"          # Bold Red
Red="\[\033[4;31m\]"          # Underline in Red
echo -e "\n\n ${Red}.................Copying user.sh to /etc/profile.d. This will set timestamp format for command history .....${NC}"
echo -e "\n\n ${Green}.................Copying user.sh to /etc/profile.d. This will set timestamp format for command history .....${NC}"
echo -e "\n\n ${Yellow}.................Copying user.sh to /etc/profile.d. This will set timestamp format for command history .....${NC}"
echo -e "\n\n ${Blue}.................Copying user.sh to /etc/profile.d. This will set timestamp format for command history .....${NC}"
echo -e "\n\n ${Purple}.................Copying user.sh to /etc/profile.d. This will set timestamp format for command history .....${NC}"
echo -e "\n\n ${Cyan}.................Copying user.sh to /etc/profile.d. This will set timestamp format for command history .....${NC}"
echo -e "\n\n ${White}.................Copying user.sh to /etc/profile.d. This will set timestamp format for command history .....${NC}"


How to change line and output

[root@test test1]# echo -n "Do not output the trailing new line"
Do not output the trailing new line[root@test test1]#

[root@test test1]# echo -e "Do not output the trailing new line"
Do not output the trailing new line
[root@test test1]#

[root@test test1]# echo -e "\a Do not output the trailing new line"
 Do not output the trailing new line
[root@test test1]#

[root@test test1]# echo -e "\b Do not output the trailing new line"                                                                                                           Do not output the trailing new line
[root@test test1]#

[root@test test1]# echo -e "\c Do not output the trailing new line"
[root@test test1]#

[root@test test1]# echo -e "\n Do not output the trailing new line"

 Do not output the trailing new line
[root@test test1]#

[root@test test1]# echo -e "\r Do not output the trailing new line"
 Do not output the trailing new line
[root@test test1]#

[root@test test1]# echo -e "\t Do not output the trailing new line"
Do not output the trailing new line
[root@test test1]#

[root@test test1]# echo -e "An apple a day keeps away \a\t\tdoctor\n"
An apple a day keeps away doctor

How to exper use :-
==================================================================
[root@test test1]#

[root@test test1]# expr 1 + 3
4
[root@test test1]# expr 2 - 1
1
[root@test test1]# expr 10 / 2
5
[root@test test1]# expr 20 % 3
2
[root@test test1]# expr 10 \* 3
30
[root@test test1]# echo `expr 6 + 3`
9
[root@test test1]#

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

[root@test test1]# cat nestedif.sh
#osch=0

echo "1. Unix (Sun Os)"
echo "2. Linux (Red Hat)"
echo -n "Select your os choice [1 or 2]? "
read osch

if [ $osch -eq 1 ] ; then

     echo "You Pick up Unix (Sun Os)"

else #### nested if i.e. if within if ######
         
       if [ $osch -eq 2 ] ; then
             echo "You Pick up Linux (Red Hat)"
       else
             echo "What you don't like Unix/Linux OS."
       fi
fi
[root@test test1]#

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

[root@test test1]# cat elf.sh
#
#!/bin/sh
# Script to test if..elif...else
#
if [ $1 -gt 0 ]; then
  echo "$1 is positive"
elif [ $1 -lt 0 ]
then
  echo "$1 is negative"
elif [ $1 -eq 0 ]
then
  echo "$1 is zero"
else
  echo "Opps! $1 is not number, give number"
fi
[root@test test1]#

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

[root@test test1]# cat mtable.sh
#!/bin/sh
#
#Script to test for loop
#
#
if [ $# -eq 0 ]
then
echo "Error - Number missing form command line argument"
echo "Syntax : $0 number"
echo "Use to print multiplication table for given number"
exit 1
fi
n=$1
for i in 1 2 3 4 5 6 7 8 9 10
do
echo "$n * $i = `expr $i \* $n`"
done
[root@test test1]#

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

0 coment�rios:

Note: only a member of this blog may post a comment.

Q:1 Why to use NFS ? Ans: A Network File System (NFS) allows remote machine to mount file systems over a network and interact with those ...

NFS Interview Questions

Q:1 Why to use NFS ?

Ans: A Network File System (NFS) allows remote machine to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to consolidate resources onto centralized servers over the network.

Q:2 What is the default port of NFS server ?

Ans: By default NFS uses 2049 TCP port.

Q:3 What are different versions of NFS Server ?

Ans: Currently, there are three versions of NFS. NFS version 2 (NFSv2) is older and widely supported. NFS version 3 (NFSv3) supports safe asynchronous writes and is more robust at error handling than NFSv2; it also supports 64-bit file sizes and offsets, allowing clients to access more than 2Gb of file data.

NFS version 4 (NFSv4) works through firewalls and on the Internet, no longer requires an rpcbind service, supports ACLs, and utilizes stateful operations. Red Hat Enterprise Linux 6.X & Centos 6.X supports NFSv2,NFSv3, and NFSv4 clients. When mounting a file system via NFS, Red Hat Enterprise Linux uses NFSv4 by default, if the server supports it.

Q:4 What are configuration files of NFS server ?

Ans: ‘/etc/exports’ is the main configuration file that controls which file systems are exported to remote hosts and specifies options.
‘/etc/sysconfig/nfs‘ is the file through which we can fix ports for RQUOTAD_PORT, MOUNTD_PORT, LOCKD_TCPPORT, LOCKD_UDPPORT and STATD_PORT

Q:5 What are different options used in /etc/exports file ?

Ans: Below are list of options used in /etc/exports file :

ro: The directory is shared read only; the client machine will not be able to write to it. This is the default.
rw: The client machine will have read and write access to the directory.
root_squash: By default, any file request made by user root on the client machine is treated as if it is made by user nobody on the server. (Exactly which UID the request is mapped to depends on the UID of user “nobody” on the server, not the client.)
no_root_squash : if this option is used , then root on the client machine will have the same level of access to the files on the system as root on the server. This can have serious security implications, although it may be necessary if you want to perform any administrative work on the client machine that involves the exported directories. You should not specify this option without a good reason.
no_subtree_check : If only part of a volume is exported, a routine called subtree checking verifies that a file that is requested from the client is in the appropriate part of the volume. If the entire volume is exported, disabling this check will speed up transfers.
sync : Replies to the NFS request only after all data has been written to disk. This is much safer than async, and is the default in all nfs-utils versions after 1.0.0.
async : Replies to requests before the data is written to disk. This improves performance, but results in lost data if the server goes down.
no_wdelay : NFS has an optimization algorithm that delays disk writes if NFS deduces a likelihood of a related write request soon arriving. This saves disk writes and can speed performance
wdelay : Negation of no_wdelay , this is default
nohide : Normally, if a server exports two filesystems one of which is mounted on the other, then the client will have to mount both filesystems explicitly to get access to them. If it just mounts the parent, it will see an empty directory at the place where the other filesystem is mounted. That filesystem is “hidden”. Setting the nohide option on a filesystem causes it not to be hidden, and an appropriately authorised client will be able to move from the parent to that filesystem without noticing the change.
hide : Negation of nohide This is the default
Q:6 How to list available nfs share on local machine & remote machine ?

Ans: ‘showmount -e localhost’ : Shows the available shares on your local machine
‘showmount -e <Remote-server-ip or hostname>‘: Lists the available shares at the remote server

Q:7 What is pNFS ?

Ans: Parallel NFS (pNFS) as part of the NFS v4.1 standard is available as of Red Hat Enterprise Linux 6.4. The pNFS architecture improves the scalability of NFS, with possible improvements to performance. That is, when a server implements pNFS as well, a client is able to access data through multiple servers concurrently. It supports three storage protocols or layouts: files, objects, and blocks.

Q:8 What is the difference between Hard mount & Soft mount in nfs ?

Ans:  Difference between soft mount and hard mount is listed below :

 Soft Mount : Consider we have mounted a NFS share using ‘soft mount’ . When a program or application requests a file from the NFS filesystem, NFS client daemons will try to retrieve the data from the NFS server. But, if it doesn’t get any response from the NFS server (due to any crash or failure of NFS server), the NFS client will report an error to the process on the client machine requesting the file access. The advantage of this mechanism is “fast responsiveness” as it doesn’t wait for the NFS server to respond. But, the main disadvantage of this method is data corruption or loss of data. So, this is not a recommended option to use.
Hard Mount : Suppose we have mounted the NFS share using hard mount, it will repeatedly retry to contact the server. Once the server is back online the program will continue to execute undisturbed from the state where it was during server crash. We can use the mount option “intr” which allows NFS requests to be interrupted if the server goes down or cannot be reached. Hence the recommended settings are hard and intr options.
Q:9 How to check iostat of nfs mount points ?

Ans: Using command ‘nfsiostat‘ we can list iostat of nfs mount points. Use the below command :
# nfsiostat <interval> <count> <mount_point>

<interval> : specifies the amount of time in seconds between each report. The first report contains statistics for the time since each file system was mounted. Each subsequent report contains statistics collected during the interval since the previ-ous report.

<count> : If the <count> parameter is specified, the value of <count> determines the number of reports generated at seconds apart. if the interval parameter is specified without the <count> parameter, the command generates reports continuously.

<mount_point> : If one or more <mount point> names are specified, statistics for only these mount points will be displayed. Otherwise, all NFS mount points on the client are listed.

Q:10 How to check nfs server version ?

Ans: ‘nfsstat -o all’ command shows all information about active versions of NFS.

Q:11 What is portmap?

Ans: The portmapper keeps a list of what services are running on what ports. This list is used by a connecting machine to see what ports it wants to talk to access certain services.

Q:12 How to reexport all the directories of ‘/etc/exports’ file ?

Ans: Using the command ‘ exportfs -r ‘ , we can reexport or refresh entries of ‘/etc/exports’ file without restarting nfs service

0 coment�rios:

Note: only a member of this blog may post a comment.

User Management Interview Questions: 1. How to create a user ? Brief with full syntax.. /usr/sbin/useradd -u uid -g gid -c " User De...

User and Group managent interview questions

User Management Interview Questions:
1. How to create a user ? Brief with full syntax..
/usr/sbin/useradd -u uid -g gid -c " User Descriptions" -m -d "Home Directory Path" -s "Shell" username
Example :
#useradd -u 535 -g unix -c "Unixrock blog" -m -d /export/home/unixrock -s /usr/bin/bash unixrock

–u UID ( From 0 to 65535 ) , 0 is reserved for root
-g Primary Group
-m Force to Create Home Directory Specified by –d and copy default skeleton files in /etc/skel folder
-d User Home Directory Path
-c User Descriptions
-s Shell Path
2. What are the important files for User Management task?
/etc/passwd
/etc/shadow
/etc/group
/etc/default/passwd
/etc/default/login

3. Describe the /etc/passwd fields ?
/etc/passwd file is having 7 fields
username:password:uid:gid:comment:home-directory-path:login-shell
Example :
unixrock:x:535:121:Unixrock blog:/export/home/unixrock:/usr/bin/bash

4. Describe the /etc/shadow file fields ?
/etc/shadow file is having 9 fields
loginID:password:lastchg:min:max:warn:inactive:expire:reserved
Example:
unixrock:R1EbI61VDyM2I:15995:7:91:7:::

5. Describe the /etc/group file fields ?
/etc/group file is having 4 fields
groupname:group-pwd:GID:user-list
Example:
unixrock::121:unixrock, raj

6. What is the different between "su  UserID" and "su - UserID" ?
"su UserID"     -  Doesn't check the PATH and Current Working Directory
"su - UserID"   -  Load the User's Profiles  (PATH/Current Working Directory)

7. Default permission of Passwd/Shadow/Group files ?
/etc/passwd 644
/etc/shadow 644
/etc/group    400
bash-3.00# ls -ld /etc/passwd /etc/shadow /etc/group
-rw-r--r--   1 root     sys          459 Dec 10 16:32 /etc/group
-rw-r--r--   1 root     sys        18498 Dec 11 09:09 /etc/passwd
-r--------   1 root     sys        10334 Dec 11 09:35 /etc/shadow
bash-3.00#

8. Default permission of file and Directory ?
Default permission of file is 644  (666 - 022 (umask vaule))
Default permission of directory is 755  (777 -022 (umask vaule))

9. How to view the list of users who currently logged in the system ?
"who" command will show the users who logged in the current system.
The command refers /var/adm/utmpx to obtain the information.
bash-3.00# who
root       pts/2        Sep 10 22:11    (192.168.10.22)
root       pts/3        Dec 11 22:55    (192.168.10.22)
bash-3.00#
bash-3.00# ls -ld /var/adm/utmpx
-rw-r--r--   1 root     bin         2976 Dec 11 22:55 /var/adm/utmpx
bash-3.00# file /var/adm/utmpx
/var/adm/utmpx: data
bash-3.00#

10. How to view the User's login and logout details ?
"last " command will show the users login and logout details.
The command refers /var/adm/wtmpx to obtain the information.
bash-3.00# last
root      pts/3        192.168.10.22    Wed Dec 11 22:55   still logged in
root      sshd         192.168.10.22    Wed Dec 11 22:55   still logged in
root      pts/2        192.168.10.22    Tue Sep 10 22:11   still logged in
root      sshd         192.168.10.22    Tue Sep 10 22:11 - 22:55 (92+00:43)
reboot    system boot                   Tue Sep 10 22:03
reboot    system down                   Fri Sep  6 17:59
wtmp begins Tue Aug 13 01:32
bash-3.00#
bash-3.00# ls -ld /var/adm/wtmpx
-rw-r--r--   1 adm      adm        68820 Dec 11 22:55 /var/adm/wtmpx
bash-3.00# file /var/adm/wtmpx
/var/adm/wtmpx: data
bash-3.00#

11. How to view details information about the User?
"finger username" will show the details about the user.
bash-3.00# finger unixrock
Login name: unixrock
Directory: /home/unixrock               Shell: /bin/sh
Never logged in.
No unread mail
No Plan.
bash-3.00#

12. Describe about SETUID/SETGID/StickyBIT ?
SETUID/SETGID/StickyBIT

13. How to check Primary and Secondary Group of One User ?
"id -a username" will show the user's Primary and Secondary groups.
FYI, One User can be added in 15 no; of Secondary groups, But Only one Primary Group.
bash-3.00# id -a unixrock
uid=100(unixrock) gid=1(other) groups=1(other)
bash-3.00#
gid - Primary Group
groups - Secondary Group

14. How to rename the existing User ID ?
# usermod -l <newname> <oldname>
bash-3.00# usermod -l unixrock_new unixrock
UX: usermod: unixrock name too long.
bash-3.00# grep -i unixrock /etc/passwd
unixrock_new:x:100:1::/home/unixrock:/bin/sh
bash-3.00#

15. How to lock the User Account ?
# passwd -l UserID
bash-3.00# passwd -s unixrock
unixrock  PS
bash-3.00# passwd -l unixrock
passwd: password information changed for unixrock
bash-3.00# passwd -s unixrock
unixrock  LK
bash-3.00#

16. How to unlock the User Account?
# passwd -u <UserID>
bash-3.00# passwd -s unixrock
unixrock  LK
bash-3.00# passwd -u unixrock
passwd: password information changed for unixrock
bash-3.00# passwd -s unixrock
unixrock  PS
bash-3.00#

17. How to make the user account as non-expriry ?
# passwd -x -1 <userID>
bash-3.00# passwd -s unixrock
unixrock  PS    12/11/13     7    91     7
bash-3.00#
bash-3.00# passwd -x -1 unixrock
passwd: password information changed for unixrock
bash-3.00#
bash-3.00# passwd -s unixrock
unixrock  PS
bash-3.00#

18. How do we set force passwd change for User's first login ?
# passwd -f  <UserID>
bash-3.00# passwd -s unixrock
unixrock  PS    12/11/13     7    91     7
bash-3.00#
bash-3.00# passwd -f unixrock
passwd: password information changed for unixrock
bash-3.00#
bash-3.00# passwd -s unixrock
unixrock  PS    00/00/00     7    91     7
bash-3.00#

19. How to delete the User ID ?
# userdel <UserID> or # userdel -r <UserID>

-r option will delete the User's Home directory too.

20. Type of SHELLs ? What is initialization file for those SHELLS ?

/bin/bash  - Bourne Again shell
/bin/csh    - C shell
/bin/ksh   - Korn shell
/bin/tcsh   - TC shell
/bin/zsh    - Z shell

Bourne   /etc/profile    $HOME/.profile   /bin/sh     /etc/skel/local.profile
Korn      /etc/profile    $HOME/.profile   /bin/ksh   /etc/skel/local.profile
                                  $HOME/.kshrc
C           /etc/.login      $HOME/.cshrc    /bin/csh   /etc/skel/local.cshrc
                                  $HOME/.login                   /etc/skell/local.login

21. How to Check the User's Crontabs ? How to allow the User to access the Cron?
# crontab -l <username>
or
# ls -ltr /var/spool/cron/crontabs/

/etc/cron.d/cron.allow  : If the file exists, the users can use crontab whoever listed in that file.

22. How to check User's Present Working Directory Path? How to check the Obsolete Path of running process ?
Find the Present Working Directory Path
# pwd

0 coment�rios:

Note: only a member of this blog may post a comment.

Q: Which Users tare not allowed to login via ftp ? Ans: Users mentioned in the file ‘/etc/vsftpd/ftpusers’ are not allowed to login via ft...

FTP interview Questions & Answers

Q: Which Users tare not allowed to login via ftp ?
Ans: Users mentioned in the file ‘/etc/vsftpd/ftpusers’ are not allowed to login via ftp.
Q: What is default directory for ftp / Anonymous user ?
Ans : ‘/var/ftp’ is the default directory for ftp or Anonymous user

Q: How to change the default directory for ftp / Anonymous user ?
Ans: Edit the file ‘/etc/vsftpd/vsftpd.conf’ and change the below directive :

anon_root=/<Path-of-New-Directory>
After making above change either restart or reload vsftpd service.

Q: How to disable Anonymous user in vsftpd ?
Ans: Edit the conf file ‘/etc/vsftpd/vsftpd.conf’ and change below directive and restart the ftp service.

anonymous_enable=NO

Q: What is chroot environment in ftp server ?
Ans: chroot environment prevents the user from leaving its home directory means jail like environment where users are limited to their home directory only. It is the addon security of ftp server.

Q: How to enable chroot environment in vsftpd server ?
Ans : To enable chroot environment edit the file ‘/etc/vsftpd/vsftpd.conf’ and enable the below directives :

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
The chroot_list_file variable specifies the file which contains users that are chroot.

Q: How to enable only limited/allowed users are able to login via ftp ?
Ans: This can be done by editing the file ‘/etc/vsftpd/vsftpd.conf’ and add the below directives :

userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
userlist_deny=NO

Q: How to set ftp banner in linux ?
Ans: Open the file ‘/etc/vsftpd/vsftpd.conf’ and set the below directive :

ftpd_banner= “Enter New Banner Here”

Q: How To limit the data transfer rate, number of clients & connections per IP for local users ?
Ans: Edit the ftp server’s config file(/etc/vsftpd/vsftpd.conf) and set the below directives :

local_max_rate=1000000 # Maximum data transfer rate in bytes per second
max_clients=50 # Maximum number of clients that may be connect

0 coment�rios:

Note: only a member of this blog may post a comment.

1. NFS is a protocol that allows a user to access files over a network; Samba is essentially a re-imaging of the Common Internet File Syste...

Difference between nfs and samba

1. NFS is a protocol that allows a user to access files over a network; Samba is essentially a re-imaging of the Common Internet File System.

2. NFS has four versions, the newest of which includes a stateful protocol; Samba has multiple versions, the latest of which allows file and print sharing between multiple computers.


SMB (Server Message Block)
0:16 – Server Message Block or SMB was originally designed by IBM back in the 80’s. After its inception, Microsoft took the protocol and added some features to it. The additions included features such as LAN Manager. Services such as this allowed Windows systems to map shared drives and have this new share act as a local drive on the computer.  For simplicity’s sake, I will skip the 3rd and 4th point but we will get back to those in a minute. With the release of Windows Vista, Microsoft also released SMB 2.0. This was a major revision of SMB which, besides adding additional features, reduced the “chattiness” of the protocol. In other words, it reduced the bandwidth used or data amount transmitted, over the network. SMB 3.0 was released with Windows 8 and Server 2008 R2. With more improvements and added functionality, SMB 3.0 was aimed towards increasing effectiveness in Datacenters. When mapping a share, Windows will automatically perform the negotiation and sort out what version of SMB to use.

Now what were the points that we skipped? In the late 90’s Microsoft had attempted to rename SMB to CIFS or Common Internet File System. Unfortunately for Microsoft, this attempt was unsuccessful so they were skipped in order to avoid confusion. CIFS had additional features, but the name simply did not catch on and Microsoft simply went back to SMB in future versions. Due to this, CIFS is referred to as a dialect of SMB though you may hear CIFS and SMB used synonymously, but they are basically referring to Windows file sharing. Moving forward however, the term CIFS should really not be used as it is a relic of the past and it should only be considered SMB.

NFS (Network File System)
2:04 – The next file system we will be examining is Network File System, or NFS. Originally developed by Sun in the late 80’s, NFS version 1 was used internally within Sun Microsystems and never released publically. It was Version 2 that was released to the public however. This provided basic file sharing capabilities and was used extensively within Unix based systems. As they released Version 3 in 1995, it was enhanced to add 64bit support and was able to handle files larger than 2 gigabytes. In 2000, Sun released version 4 of NFS with added performance along with security improvements. This allowed for security methods to be applied and utilized to authenticate users, e.g. Kerberos. These security measures made NFS version 4 much more secure when compared to previous revisions.

In The Real World
2:56 - Now I want to ask you a question. In the real world, which protocol would you use? Windows shares support both SMB and NFS, or even both at the same time. It is merely a matter of configuring which one you need or configuring both if you need to utilize both. Ideally, you’ll want to use a native protocol when possible. For example, if you are connecting two Unix systems, it will be best to utilize NFS. If you are connecting two Windows systems, SMB would be the obvious choice. Even though both achieve the goal of file sharing, there are differences in the way Windows and Unix based systems handle file systems and the users that will be using the systems. Mixing the two can lead to compatibility problems. As NFS is good for host authentication, it makes connecting two servers together rather easy. This can be placed in the boot up configuration and the data would be available to the operating system without the need for a user to be logged in. You could even connect to another server based on the IP address alone. Conversely, Windows requires user authentication in order to connect to an SMB share and generally the user is required to be logged in. It is possible to circumvent this and you would do this for some services running on the local system, but it is, unfortunately, not as simple as NFS makes it. Windows is an excellent choice for using authentication. Until NFS version 4, this was something that NFS did not handle well and was prone to more security problems. If you are using a domain, then Windows handles user authentication very well. Ultimately, the decision will be made on what operating systems you are using and your software requirements. In future videos, we will discuss how Windows file sharing (SMB) works and also how to incorporate NFS using Windows Server.  

0 coment�rios:

Note: only a member of this blog may post a comment.

FTP means File Transfer Protocol while SFTP means Secured File Transfer Protocol. FTP uses Port 21 whereas SFTP uses Port 22. SFTP shares...

FTP and SFTP contains a lot of difference between both of them .

FTP means File Transfer Protocol while SFTP means Secured File Transfer Protocol.
FTP uses Port 21 whereas SFTP uses Port 22.
SFTP shares its files with full security whereas FTP uploads or downloads its data without any security.
Filezilla is best for FTP whereas winSCP is regarded best for SFTP.
FTP sends data in plain text while SFTP provides a little bit of privacy.
FTP is used by anyone whereas SFTP is used by server owner because 22 port is not open in case of shared hosting.
SFTP is fully secured and satisfactory whereas FTP is less secured.

0 coment�rios:

Note: only a member of this blog may post a comment.

OS BOOT TIME RHEL6: 40 sec RHEL7: 20 sec MAXIMUM SIZE OF SINGLE PARTITION RHEL6: 50TB(EXT4) RHEL7: 500TB(XFS) BOOT LOADER RHEL6:...

What is Difference Between RHEL 6 & RHEL 7

OS BOOT TIME
RHEL6: 40 sec

RHEL7: 20 sec

MAXIMUM SIZE OF SINGLE PARTITION
RHEL6: 50TB(EXT4)

RHEL7: 500TB(XFS)

BOOT LOADER
RHEL6:  /boot/grub/grub.conf

RHEL7: /boot/grupb2/grub.cfg

PROCESSOR ARCHITECTURE
RHEL6: It support 32bit & 64bit both

RHEL7: It only support 64bit

HOW TO FORMAT OR ASSIGN A FILE SYSTEM IN
RHEL6:      #mkfs.ext4   /dev/hda4

RHEL7:       #mkfs.xfs   /dev/hda3

HOW TO REPAIR A FILE SYSTEM IN
RHEL6:  #fsck -y /dev/hda3

RHEL7:  #xfs_repair /dev/hda3

COMMAND TO MANAGE NETWORK IN RHEL6 AND RHEL7
RHEL6:  #setup

RHEL7:  #nmtui

HOSTNAME CONFIGURATION FILE
RHEL6:    /etc/sysconfig/network

RHEL7:    /etc/hostname

DEFAULT ISO IMAGE MOUNT PATH
RHEL6: /media

RHEL7: /run/media/root

FILE SYSTEM CHECK
RHEL6:   e2fsck

RHEL7:   xfs_repair

RESIZE A FILE SYSTEM
RHEL6:   #resize2fs -p /dev/vg00/lv1

RHEL7:    #xfs_growfs  /dev/vg00/lv1

TUNE A FILE SYSTEM
RHEL6: tune2fs

RHEL7: xfs_admin

IPTABLES AND FIREWALL
RHEL6: iptables

RHEL7: firewalld

IPtables
To see firewall status in RHEL7

#firewall-cmd   –state

To see Firewall status in RHEL6

#service iptables status

To stop firewall in RHEL7

#systemctl stop firewalld.service

To stop firewall in RHEL6

#service iptables stop

COMMUNICATION BETWEEN TCP AND UDP IN BACK END
RHEL6: netcat

RHEL7: ncat

INTERFACE NAME
RHEL6: eth0

RHEL7: ens198(N)

COMBINING NIC
RHEL6: Network Bonding

RHEL7: Team Driver

NSF Server Version
RHEL6:  NFSv2

RHEL7:  NFSV4

DATABASE USED
RHEL6: Mysql

RHEL7: mariaDB

RHEL7 also support Mysql

MANAGING SERVICES
RHEL6:

#service sshd restart

#chkconfig sshd on

RHEL7:

#systemctl restart sshd

#systemctl enable shhd

File System.
RHEL6 default file system is ext4

xfs is RHEL7 default file system.

Kernel Version
RHEL6 default kernel version is 2.6 while RHEL7 is 3.10

UID Allocation
In RHEL6 default UID assigned to users would start from 500 while in RHEL7 it’s starting from 1000.
But this can be changed if required by editing /etc/login.defs file.

Maximum supported File Size.
In RHEL6 maximum file size of an individual file can be up to 16TB while in RHEL7 it can be up to 500TB which is very large in comparison to RHEL6.

Maximum Supported File System Size.
In RHEL6 maximum file system size=16TB (for 64bit Machine) and 8TB (for 32 bit machine). While in RHEL7 maximum file system size is 500TB.

Also keep in mind that RHEL does not support XFS on 32-bit machines.

Change in file system structure.
In rhel6 /bin,/sbin,/lib and /lib64 are usually under /

In rhel7, now /bin,/sbin,/lib and /lib64 are nested under /usr.

The /tmp directory can now be used as a temporary file storage system (tmpfs)

Space Required to Installing RHEL7?

Now if you want to install RHEL7 in your machine, RedHat recommends minimum 5 GB of disk space to install this release of RHEL series for all supported architectures.

.Hostname lookup and setup
In rhel5 and rhel6 versions, we can edit file /etc/sysconfig/network to set hostname but in rhel7 we can directly change the hostname using below commands.

hostnamectl
nmtui
nmcli
Example:

in RHEL6              #hostname

in RHEL7              #hostnamectl  status   and #hostname

Few More notable changes in RHEL 7.
Netstat and ifconfig commands also disappeared from RHEL7 but it can be used by installing net-tools.
The move from sysvinit to systemd is one of most important change that has been made and which is a matter of concerned.
Command tail -n is replaced by journalctl -n
Command tail -f is replaced by journalctl -f
For displaying kernel messages instead of dmesg now in RHEL7 we use journalctl –k

0 coment�rios:

Note: only a member of this blog may post a comment.

[root@ipaserver ~]# vmstat -s [root@ipaserver ~]# free -g [root@ipaserver ~]# free -h [root@ipaserver ~]# cat /proc/meminfo 

Display memory info

[root@ipaserver ~]# vmstat -s
[root@ipaserver ~]# free -g
[root@ipaserver ~]# free -h
[root@ipaserver ~]# cat /proc/meminfo 

0 coment�rios:

Note: only a member of this blog may post a comment.

Q. WHAT IS A PORT? A port is piece of software which is used as docking point in your machine, where remote application can communicate. T...

IMPORTANT PORT NUMBERS FOR THE LINUX SYSTEM ADMINISTRATOR

Q. WHAT IS A PORT?
A port is piece of software which is used as docking point in your machine, where remote application can communicate. This is analogy to the physical ports for entering in to a country from different sea ports.

Q. WHAT IS HARDWARE PORT?
This is a physical peripheral connecting point to a machine from a physical device.

Q. WHAT IS A SOCKET?
Socket is combination of software Port and IP address.

Q. WHAT IS THE RANGE OF PORTS OR HOW MANY PORTS ARE THERE?
Port numbers can vary from 0 to 65535, so total we can get 65536 ports

Q. WHY PORT NUMBERS ARE JUST 65536?
This is because limitation in TCP/IP stack where the port number field is just 16bit size. So we get only 2^16(2 to the power of 16) ports which are equal to 65536 available ports

Q. WHAT ARE THE WELL-KNOWN PORTS OR ASSIGNED PORTS OR DEFAULT PORTS?
Well known ports are from 0 to 1023(total 2^10=1024 ports)

Q. WHAT DO YOU MEAN BY DEFAULT PORT?
Default port is a designated port for particular well-known service such as web server, mail server, ftp server etc. By default FTP uses 21 port, DNS uses 53 and Apache uses 80 port.

Q. CAN WE CHANGE DEFAULT PORT FOR A SERVICE(EXAMPLE APACHE, SQUID)?
Yes, we can change. In Apache and DNS we can change this using listen configuration entry in httpd.conf and named.conf. Squid have port entry in it’s squid.conf file to mention port number.

Q. WHAT ARE THE PROTOCOL NUMBERS FOR TCP AND UDP?
Do not confuse this one with port numbers. TCP and UDP have their own numbers in TCP/IP stack.

TCP protocol number: 6

UDP protocol number: 17

Q. IS THERE ANY WAY I CAN SEE ALL THE PORT INFORMATION IN LINUX?
Yes, you can get that from /etc/services files.

Q. HOW CAN I SEE OPEN PORTS IN LINUX?
Use nmap command.

WELL KNOWN PORTS
20 – FTP Data (For transferring FTP data)

21 – FTP Control (For starting FTP connection)

22 – SSH (For secure remote administration which uses SSL to encrypt the transmission)

23 – Telnet (For insecure remote administration)

25 – SMTP (Mail Transfer Agent for e-mail server such as SEND mail)

53 – DNS (Special service which uses both TCP and UDP)

67 – Bootp

68 – DHCP

69 – TFTP (Trivial file transfer protocol uses udp protocol for connection less transmission of data)

80 – HTTP/WWW(Apache)

88 – Kerberos

110 – POP3 (Mail delivery Agent)

123 – NTP (Network time protocol used for time syncing uses UDP protocol)

137 – NetBIOS (nmbd)

139 – SMB-Samba (smbd)

143 – IMAP

161 – SNMP (For network monitoring)

389 – LDAP (For centralized administration)

443 – HTTPS (HTTP+SSL for secure web access)

514 – Syslogd (udp port)

636 – ldaps (both ctp and udp)

873 – rsync

989 – FTPS-data

990 – FTPS

993 – IMAPS

1194 – openVPN

1812 – RADIUS

995 – POP3s

2049 – NFS (nfsd, rpc.nfsd, rpc, portmap)

2401 – CVS server

3306 – MySql

3690 – SVN

0 coment�rios:

Note: only a member of this blog may post a comment.