Professional Documents
Culture Documents
Redhat: Enterprise Linux
Redhat: Enterprise Linux
Redhat: Enterprise Linux
Dig
(domain information groper) query DNS related information like A Record, CNAME, MX
Record etc. This command mainly use to troubleshoot DNS related query.
nslookup
command also use to find out DNS related query. The following examples shows A
Record (IP Address) of tecmint.com. e.g nslookup www.tecmint.com
host
command to find name to IP or IP to name in IPv4 or IPv6 and also
query DNS records. e.g host -t CNAME www.redhat.com
NETWORK CONFIGURATIONS
OTHER IMPORTANT NETWORK COMMANDS
hostname
Execute hostname command to see the hostname of your box. You can set hostname
permanently in /etc/sysconfig/network.
telnet
connect destination host:port via a telnet protocol if connection establishes means
connectivity between two hosts is working fine.
netstat
command allows you a simple way to review each of your network connections and open
sockets.
NETWORK CONFIGURATIONS
OTHER IMPORTANT NETWORK COMMANDS
scp
allows you to secure copy files to and from another host in the network.
Ex: scp $filename user@targethost:/$path
w
w prints a summary of the current activity on the system, including what each user is doing,
and their processes. Also list the logged in users and system load average for the past 1, 5,
and 15 minutes.
nmap
is a one of the powerful commands, which checks the opened port on the server.
Usage example:nmap $server_name
USERS/GROUPS MANAGMENT
IMPORTANT USER MANAGEMENT COMMANDS
adduser/useradd
• It edits /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow files for the newly created
User account.
• Creates and populate a home directory for the new user.
• Sets permissions and ownerships to home directory.
• Examples:
• [root@tecmint ~]# useradd tecmint
• [root@tecmint ~]# passwd tecmint
USERS/GROUPS MANAGMENT
IMPORTANT USER MANAGEMENT EXAMPLES
[root@tecmint ~]# useradd -d /data/projects anusha //assign home directory
[root@tecmint ~]# useradd -u 999 navin //user-id
[root@tecmint ~]# useradd -u 1000 -g 500 tarunika //user-id and group-id
[root@tecmint ~]# useradd -e 2014-03-27 aparna //account expiry
[root@tecmint ~]# useradd -e 2014-04-27 -f 45 tecmint //password expiry
[root@tecmint ~]# chage -l aparna //varify acount age details
[root@tecmint ~]# useradd -c "Manis Khurana" mansi //with comments
[root@tecmint ~]# useradd -G admins,webadmin,developers tecmint
//assign multiple groups
[root@tecmint ~]# useradd -m -d /var/www/ravi -s /bin/bash -c "TecMint Owner" -U ravi
//Add a User with Specific Home Directory, Default Shell and Custom Comment
[root@tecmint ~]# cat /etc/passwd | grep anusha //user details
USERS/GROUPS MANAGMENT
USERMOD EXAMPLES
the command ‘usermod‘ is used to modify or change any attributes of a already created user account via command line. The command
‘usermod‘ is similar to that ‘useradd‘ or ‘adduser‘ but the login granted to an existing user.
Options of Usermod
The ‘usermod‘ command is simple to use with lots of options to make changes to an existing user.
0 No Permission ---
1 Execute --x
2 Write -w-
4 Read r--
0 No Permission ---
1 Execute --x
2 Write -w-
4 Read r--