Self-Study: Q1. How To Check Contents of A File Without Extracting It? Explain Diff
Self-Study: Q1. How To Check Contents of A File Without Extracting It? Explain Diff
Q1.
How to check contents of a file without
extracting it? Explain diff.
Ans
tar tf filename
Email-
Email-
Important: PTR records are only effective if named.conf is manually edited and the
proper zone information is added. This can only be done by a root user (the server
Admin).
Q2.
Q3.
Command to know that how long system was on?
Ans uptime
Q4.
What is the difference between cp and rsync.?
Ans
Ans
Owner-Shubham Pandey
[email protected]
Email-
Q9
Ans
Defaults
Permissions
File
Directory
Root
Umask
User
Umask
644
755
133
022
664
775
113
002
Q10
Format in which permissions can be given or
revoked?
Ans Binary
Eg- chmod 777 dir or chmod 2777 dir
SymbolicEg chmod rwx dir or to add permission -> chmod u+r dir or
chmod ugo+rw dir
Q11 What is umask?
Ans Everytime a file is created it has default permissions which
depend on umask.
Q12 How to change user and group ownership in a single
command?
Ans chown Andrew.sysusers filename
Q13 How to make a file undeletable even by root?
Ans chattr +i dir_name
To disable the above command chattr -i dir_name
To list the attributes = lsattr
Owner-Shubham Pandey
[email protected]
Email-
Email-
ALL
Email-
Nginx Vs Apache
Owner-Shubham Pandey
[email protected]
Email-
In Nginx, memory consumption is very low for serving static pages. But,
Apaches nature of creating new process for each request increases the
memory consumption.
Several benchmarking results indicates that when compared to Apache,
Nginx is extremely fast for serving static pages.
Nginx development started only in 2002. But Apache initial release was in
1995.
In complex configurations situation, when compared to Nginx, Apache can
be configured easily as it comes with lot of configuration features to cover
wide range of requirements.
When compared to Nginx, Apache has excellent documentation.
In general, Nginx have less components to add more features. But Apache
has tons of features and provides lot more functionality than Nginx.
Nginx do not support Operating Systems like OpenVMS and IBMi. But
Apache supports much wider range of Operating Systems.
Since Nginx comes only with core features that are required for a web
server, it is lightweight when compared too Apache.
The performance and scalability of Nginx is not completely dependent on
hardware resources, whereas the performance and scalability of the Apache
is dependent on underlying hardware resources like memory and CPU.
Q27 What is the purpose of multi on in /etc/host.conf?
Ans The multi option determines whether a host in the /etc/hosts
file can have multiple IP addresses. It takes on or of as options.
This option has no effect on DNS or NIS queries.
Note Prompt for normal user $ while for root will be #.
Files that have a period(.) and the end of their permissons
are controlled by SELinux while in case of (+) sign are
controlled by ACL.
Owner-Shubham Pandey
[email protected]
Email-
C (cache entry).
! (reject
route)
Q30 What searches the database of man pages for
mannuals that reference to passwd command?
Ans whatis passwd arpopros
Q31 Explain nsswitch.conf file? Default port for logs?
Ans /etc/nsswitch.conf covers way more than host names: it also
covers the resolution of mail aliases, user and group names,
Owner-Shubham Pandey
[email protected]
Email-
ssh-keygen
Step 2: Copy the public key to remote-host using ssh-copy-id
(Keep pressing enter on the prompts)
Youre done!!
Q34 How to know which package needs to be installed for a particular command?
Owner-Shubham Pandey
[email protected]
Email-
Email-
ServerName localhost
Thats it , save the file and restart the service.
Q 38 Explain Anycast?
Ans In Internet Protocol Version 6 (IPv6), anycast is
communication between a single sender and the nearest of
several receivers in a group. Anycasting is designed to let one
host initiate the efficient updating of router tables for a group of
hosts. IPv6 can determine which gateway host is closest and
sends the packets to that host as though it were a unicast
communication. In turn, those hosts can anycast to another host
in the group until all routing tables are updated.
Q38 Explain .htaccess file?
Ans .htaccess is a configuration file for use on web servers
running the Apache Web Server software. When a .htaccess file is
placed in a directory which is in turn 'loaded via the Apache Web
Server', then the .htaccess file is detected and executed by the
Apache Web Server software. These .htaccess files can be used to
alter the configuration of the Apache Web Server software to
enable/disable additional functionality and features that the
Apache Web Server software has to offer. These facilities include
basic redirect functionality, for instance if a 404 file not found
error occurs, or for more advanced functions such as content
password protection or image hot link prevention .
Q39 Describe configuration of https ?
Ans File to be configured - /etc/httpd/conf.d/ssl.conf (If ssl.conf is not present over
there install mod_ssl package)
************************TO BE CONTINUED***************************
Q40 Describe iscsi configuration?
Ans iscsi- Internet small computer system interface
iscsiadm m discoverydb t st p 192.168.1.122 -D
Q41 Describe the configuration of VNC?
Owner-Shubham Pandey
[email protected]
Email-
Email-
C - to create an archive.
X - to de-compress or extract an archive.
V Verbose mode
F Perform an action Forcefully
STAR is used to archive a file in a SELinux system. To create an archive with STAR
star xattr H=exustar c f=home.star /home/
-xattr = saves the extended attributes associated with SELinux.
H=exustar = records the header associated with ACLs.
-c = creates a new archive file.
-f = specifies the name of the archive file.
To extract the above file.
star x f=home.star
Q44 Explain cron and at command in detail.
Ans Deamon for cron is crond so make sure it is running.
To block a user from creating cron jobs , make an entry in /etc/cron.deny
Config file- /etc/crontab
MAILTO cron daemon sends output by email. Just add a line such as
MAILTO = [email protected] to route all the cron messages associated with
that file to that email address.
Type
/etc/cron.deny exists
/etc/cron.allow exists
Only Users in
etc/cron.allow are allowed
for crontab e
/etc/cron.deny is ignored
Users in /etc/cron.deny are
not allowed to use crontab
e , everyon else is
allowed
Owner-Shubham Pandey
[email protected]
Email-
nice -10 <command name> Will set a process with the priority of "10".
You can only use nice command to change the process priority
when you launch it. You cannot use nice command to change the
priority of an already running process.
In order to change the priority of an already running process you
can use "renice" command.
Some examples of renice command is as follows:
Owner-Shubham Pandey
[email protected]
Email-
renice -4 -p 3423 (this will set the priority of process id no 3423 to -4, which will
in turn increase its priority over others)
renice 13 -p 3564 -u sarath (this will set the priority of the process id 3564 to 13,
and all the process owned by user "sarath" to the priority of 13)
renice 14 -u sarath,satish -g custom (this will set all process owned by
"sarath","satish" and also the group "custom" to 14)
Q47 What is the difference between single quotes and double quotes in shell
scripting?
Ans In case of single quotes , it will echo the same thing that was entered in them
while in case of double quotes , it will echo the value of the particular variable.
Eg- a=6
echo $a
O/P- $a
echo $a
O/P - 6
Email-
Owner-Shubham Pandey
[email protected]
Email-