Showing posts with label Interview Q. Show all posts
Showing posts with label Interview Q. Show all posts

Tuesday, June 16, 2015

NFS Interview Q




Q. What is NFS?

NFS is a network file system, which allows remote hosts to mount file system over a network and interact with those file systems as though they are mounted locally.


Q. NFS uses?

NFS is used for sharing files and directories throughout the network.


Q. What are the port numbers for nfs?

2049(nfsd), 111(port map)


Q. what are the demons for nfs?

Rpc.nfsd, rpc.lockd, rpc.quota.d, rpc.mountd


Q. NFS uses which protocol?

Nfsv4 uses TCP, nfsv3 and nfsv2 uses UDP


Q: - Explain this entry /shared 192.168.1.0/24(sync,rw)

Allows all systems with 192.168.1.* IP addresses read-write access to the /shared directory


Q: - What will happened if a space is given in between allowed hosts and (options) If a space is included, the options are applied to any and all IP addresses, which can be quite dangerous if write permission is granted.


Q: - What is the role of "sync" option for NFS server sync is used to synchronize the data from server to client. The sync option is recommended because it follows the NFS protocol.


Q: - How to retrieve a list of clients connected to the NFS server? To retrieve a list of clients connected to the NFS server, use the showmount command from a shell prompt. To also show the directories the clients are connected to, use the ex: showmount –e 192.168.0.112

Q: - Name of Configuration file for NFS Server? /etc/exports

Q: - What is meaning of "no_root_squash" option ? Treat remote root user as local root. Do not map requests from root to the anonymous user and group ID.


Q: - What is NFS ? NFS stands for Network File System. NFS was originally developed by Sun Microsystems in the 1980's. NFS allows remote hosts 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 on the network.


Q: - Which NFS versions are available ? NFS Version 2 NFS Version 3 NFS Version 4


Q: - What is different between NFS Version 2 & 3 ? nfs 2 default 8kb transfer rate,it did not check the authentication at the time connection.client wants to access unauthorized file it shows error messages like "write error","read error" nfs 3 32kb transfer rate. It check at the time connection- ACL Support


Q: - Can we grant access by Username and password for nfs share?

No, access is granted only for IP address.


Q: - What is the role of "all_squash" option?

Treat all client users as anonymous users. Map all user and group IDs to the anonymous user and group ID.


Q: - What is the role of "root_squash" option?

All requests from the user root are translated or mapped as if they came from the user anonymous (default).


Q: - Explain option "all_squash"?

The UID and GID of exported files are mapped to the user anonymous. It is good for public directories.


Q: - Explain "exportfs" command?

The exportfs command is used to maintain the current table of exported file systems for NFS.


Q: - Explain command "/usr/sbin/exportfs -f"?

It will flush everything out of the kernels export table. Any clients that are active will get new entries added by mountd when they make their next request.


Q: - Which option is used with exportfs command to display the current export list, also displays the list of export options?

exportfs –v


Q: - Which option is used with exportfs command to re-export all directories?

exportfs –r


Q: - Is rpc.mountd daemon supports TCP_WRAPPERS?

Yes, The rpc.mountd daemon is protected by the tcp_wrappers. You have to give the clients access to rpc.mountd if they should be allowed to use NFS Server.


Q: - Explain "nfsstat" command?

The nfsstat command displays the statistics about NFS client and NFS server activity.


Q: - What do you understand by "nfsstat -o all -234" command?

It will Show all information about all versions of NFS.


Q: - What do you understand by "nfsstat --nfs --server -4" command?

It will show statistics for NFS version 4 server.


Q: - Can NFS share mounted on Window XP and Justify your answer?

No, Window XP operating system doesn’t support nfs protocol.


Q: - 192.168.0.117:/data is exported by NFS Server and i want to add this NFS share to client /etc/fstab file. How you will add this entry in /etc/fstab file?

#Device name #mount-point # fs-type #options #dump #fsckorder

192.168.0.117:/data /mnt nfs defaults 0 0

Q: - Explain "Soft Mounting" option at NFS Client? if a file request fails, the NFS client will report an error to the process on the client machine requesting the file access. if it cannot be satisfied (for example, the server is down), then it quits. This is called soft mounting.


Q: - Explain "Hard Mounting" option at NFS Client?

If a file request fails, the NFS client will report an error to the process on the client machine requesting the file access. if it cannot be satisfied, then it will not quit until the request is satisfied. This is called Hard mounting.


Q: Explain "intr" option at NFS Client?

Allows nfs requests t be interrupted or killed if the server is unreachable


Q: Explain "nolock" option at NFS Client?

It disables the file locking and allows the interoperation


Q: - What is "portmap"?

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: - How you will check "portmap" service is running or not?

rpcinfo –p 192.168.0.117


Q: - I am unable to mount a NFS share. How will you trace out the reason?

Firstly, check that you have permissions to mount nfs share or not. Check /etc/exports file.

Secondly you can get RPC error: Program Not Registered (or another "RPC" error)

For this check your NFS server and portmap service running or not by "rpcinfo -p"


Q: Can I modify export permissions without needing to remount clients in order to have them take effect?

Yes. The safest thing to do is edit /etc/exports and run "exportfs -r"


Q. How to restart the services for nfs?

Service nfs restart


Q. How to enable the nfs server after reboot?

Chkconfig nfs on

Interview questions on Port numbers


Q. What Is a Port Number?

 A port number is part of the addressing information used to identify the senders and receivers of messages. Port numbers are most commonly used with TCP/IP connections. Home network routers and computer software work with ports and sometimes allow you to configure port number settings. These port numbers allow different applications on the same computer to share network resources simultaneously.

-----------------------------------------------------------------------------------------------

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 field is just 16bit size. So we get only 2^16 port which is equal to 65536 ports

Port numbers have a range of 0..65535 (although often 0 has special meaning). In the original BSD TCP implementation, only root can bind to ports 1..1023, and dynamically assigned ports were assigned from the range 1024..5000; the others were available for unprivileged static assignment. These days 1024..5000 is often not enough dynamic ports, and IANA has now officially designated the range 49152..65535 for dynamic port assignment. However even that is not enough dynamic ports for some busy servers, so the range is usually configurable (by an administrator). On modern Linux and Solaris systems (often used as servers), the default dynamic range now starts at 32768. Mac OS X and Windows Vista default to 49152..65535.

-----------------------------------------------------------------------------------------------

[root@desktop12 ~]# cat /proc/sys/net/ipv4/ip_local_port_range

32768   61000

solaris$ /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port

32768

65535

macosx$ sysctl net.inet.ip.portrange.first net.inet.ip.portrange.last

net.inet.ip.portrange.first: 49152

net.inet.ip.portrange.last: 65535

vista> netsh int ipv4 show dynamicport tcp

Protocol tcp Dynamic Port Range

Start Port : 49152

Number of Ports : 16384

-----------------------------------------------------------------------------------------------
Q.What are the well-known ports?
Well known ports are from 0 to 1023(total 2^10=1024 ports)
-----------------------------------------------------------------------------------------------
Q.What are the Registered Ports, and    (Range:  1024 to 49151 )

Used by specific service upon applications such as Oracle database listener (1521), MySql (3306), Microsoft Terminal server (3389) etc.

-----------------------------------------------------------------------------------------------

Q.What are the Dynamic and/or Private Ports. (Range: 49152 to 65535 )

These ports can’t be registered by IANA. 
This is used for custom or temporary purposes and for automatic allocation of short-lived (or ephemeral ) ports which is used internally by application/processes.
 You can see these ports by running ‘netstat’ command under “Local address” column.

-----------------------------------------------------------------------------------------------
Q.What do you mean by default port?

Default port is a designated port for particular well-known server.
 -----------------------------------------------------------------------------------------------
 Q.Can we change default port for a service(example Apache, squid)?

 Yes, we can change
 -----------------------------------------------------------------------------------------------
 Q.What are the protocol numbers for TCP and UDP?

 TCP protocol number:6 UDP protocol number:17
 -----------------------------------------------------------------------------------------------
 Q.How to find which ports are open? You can find the ports in your linux server with the nmap command

#netstat -ntlp   here n ->
 display the host by numbers          
 t  ->shows tcp protocols           
 u ->to check udp protocols           
 l ->listening ports         
 p -> displays which process controls the port

-----------------------------------------------------------------------------------------------
Q.How to find printer open ports  ?

[root@desktop1 Desktop]# netstat -ntlp |grep cups tcp        0      0  127.0.0.1:631               0.0.0.0:*                   LISTEN      1525/cupsd         tcp        0      0   ::1:631                             :::*                        LISTEN      1525/cupsd   

 -----------------------------------------------------------------------------------------------


Q. How to detect remote server openports?
 [root@desktop1 Desktop]# nmap -sT 192.168.0.250
 it will show like this PORT     STATE SERVICE
 21/tcp   open  ftp
 22/tcp   open  ssh
 25/tcp   open  smtp
 80/tcp   open  http
 -----------------------------------------------------------------------------------------------
 Q. How to change SSH port number?

[root@desktop1 Desktop]# netstat -ntlp | grep ssh tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1646/sshd          tcp        0      0 :::22                               :::*                        LISTEN      1646/sshd   

go to the configuration file

[root@desktop1 Desktop]# vim /etc/ssh/sshd_config

port=2200

save and quit
[root@desktop1 Desktop]# service sshd restart

Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]

[root@desktop1 Desktop]# netstat -ntlp | grep ssh tcp   
0      0 0.0.0.0:2200                0.0.0.0:*                   LISTEN      11904/sshd         tcp        0      0 :::2200                          :::*                        LISTEN      11904/sshd      

now port num changed successfully

-----------------------------------------------------------------------------------------------
Q. rempte loggin with port number?


ssh -p 22 root@192.168.0.1


Some important port numbers:

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)


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,138,445-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)


995-POP3s


3260-ISCSI


3128-squid proxy


631-Printers(cups)


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


*If protocol is not mention then the above port are solely for TCP. Some service use UDP as mention in above list.


Tuesday, May 17, 2011

Question from Apache


1. In which folder are Java Applications stored in Apache?
Java applications are not stored in Apache, it can be only
connected to a other Java webapp hosting webserver using the
mod_jk connector
2.Is running apache as a root is a security risk?
No.root process opens port 80, but never listens to it, so
no user will actually enter the site with root rights. If
you kill the root process, you will see the other kids
disappear as well.
3.If you specify both deny from all and allow from all, what will be the default action of Apache?
deny will be taken first.
4.What does htpasswd do?
The htpasswd protects a file with a password
5.What is mod_vhost_alias?
This module creates dynamically configured virtual hosts, by allowing the IP address and/or the Host: header of the HTTP request to be used as part of the pathname to determine what files to serve. This allows for easy use of a huge number of virtual hosts with similar configurations.
6.What is ServerType directive?
It defines whether Apache should spawn itself as a child process (standalone) or keep everything in a single process (inetd). Keeping it inetd conserves resources. This is deprecated, however.
7.How do you set up a virtual host in Apache?
ServerAdmin admin@test.com
DocumentRoot /home/apache/share/htdocs/hostedsites
ServerName www.test.com
ErrorLog /home/apache/logs/error/hostedsites/error_log
TransferLog /home/apache/logs/access/hostedsites/access_log
8.How do you check for the httpd.conf consistency and any errors in it?
apachectl configtest
9.What does apachectl graceful do?
Gracefully  restarts  the  Apache httpd daemon. If the daemon is not running, it is started. This differs from a normal  restart in  that  currently  open  connections  are not aborted. A side effect is that old log files will  not be  closed  immediately. This  means that if used in a log rotation script, a substantial delay may be necessary to ensure that  the  old  log  files  are closed before processing them. This command automatically checks
the configuration files as in configtest before initiating  the restart  to  make sure Apache doesn?t die.
This is equivalent to apachectl -k graceful.
Actually it sends a SIGUSR1 for a restart. The USR1 or graceful signal causes the parent process to advise the children to exit after their current request (or to exit immediately if they’re not serving anything). The parent re-reads its configuration files and re-opens its log files. As each child dies off the parent replaces it with a child from the new generation of the configuration, which begins serving new requests immediately.
10.What is the command to stop Apache?
service httpd stop & apachectl stop
11.On a fresh install, why does Apache have three config files – srm.conf, access.conf and httpd.conf?
The first two are remnants from the NCSA times, and
generally you should be ok if you delete the first two, and
stick with httpd.conf.
12.Hi, When i’m starting startup.bat file of Tomcat server it isn’t started. DOS window appears for a Second only. What should I do?
Your set up might have been not done well. Make sure you have added tomcat root directory path in the CATALINA_HOME environment variable and added the bin path in the path variable
13.What is the difference between Tomcat 4.1 and Tomcat 5.0?
Web server (for development) that supports servlets 2.3 and JSP 1.2 (Tomcat 4) or servlets 2.4 and JSP 2.0 (Tomcat 5).
14.please let me know the configuration or architecture how
tomcat used. give me a layman example The Architecture of Tomcat
Tomcat 4 is a complete rewrite of its ancestors. At the core of this rewrite is the Catalina servlet engine, which acts as the top-level container for all Tomcat instances.
With this rewrite of Tomcat comes an entirely new architecture composed of a grouping of application containers, each with a specific role. The sum of all of these containers makes up an instance of a Catalina engine.
The following code snippet provides an XML representation of the relationships between the different Tomcat containers:
This instance can be broken down into a set of containers including a server, a service, a connector, an engine, a host, and a context. By default, each of these containers is configured using the server.xml file, which we describe
later in more detail.
The Server
The first container element referenced in this snippet is the element. It represents the entire Catalina servlet engine and is used as a top-level element for a single Tomcat instance. The element may contain one or more containers.
The Service
The next container element is the element, which holds a collection of one or more elements that share a single element. N-number of elements may be nested inside a single element.
The Connector
The next type of element is the element, which defines the class that does the actual handling requests and responses to and from a calling client application.
The Engine
The third container element is the element. Each defined can have only one element, and this single component handles all requests received by all of the defined components defined by a parent service.
The Host
The element defines the virtual hosts that are contained in each instance of a Catalina . Each can be a parent to one or more Web applications, with each being represented by a component.
The Context
The element is the most commonly used container in a Tomcat instance. Each element represents an individual Web application that is running within a defined . There is no limit to the number of contexts that can be defined within a .
15.what is tomcat?can we deploy a servelet in tomcat?
Tomcat is a webserver, Which is support 3 -tier archeticture..
Yes we can
in web.xml


16.if i delete my java class files after the compile?but it does not goes to the recycle bin.Now i want to get the java class file
Yes  you can
17.what  is different between web server and application server?
Web server supports only http protocol
Where as application server supports any type of protocols such as tcp/ip,http etc..
18.what is webserver? why it is used ?
Transaction with HTTP request and HTTP response is called webserver.
Using the internet listening the HTTP request and providing the HTTP response is also called webserver.It gives only html output.It will not process business logic .They can provide Http server.They are static.
19. Can we use Active Server Pages (ASP) with Apache?
Apache Web Server package does not include ASP support.
However, a number of projects provide ASP or ASP-like
functionality for Apache. Some of these are:
Apache::ASP
mod_mono
Chilisoft ASP
20.Why doesn’t Apache include SSL?
SSL (Secure Socket Layer) data transport requires encryption, and many governments have restrictions upon the import, export, and use of encryption technology.
If Apache included SSL in the base package, its distribution would involve all sorts of legal and bureaucratic issues, and it would no longer be freely
available.
Also, some of the technology required to talk to current clients using SSL is patented by RSA Data Security, who restricts its use without a license.
21.Does Apache come with Java support?
The base Apache Web server package does not include support for Java
22.This is very strange.
I am running apache 2.2 (compiled with gcc and all default params) on
AIX 5.2.0.6 – 64 bit kernel.
I edit the httpd.conf file to listen on two different
ports –
Listen 8000
Listen 8001
The server will not start no errors or anything it just accepts the
command but nothing starts.
I can comment out on of the entires and everything starts up just fine
minus the commented out port.
Listen 8000
#Listen 8001
So, my problem is that I cannot get apache to listen on two ports, any
ideas? Has someone else seen this before?
Thanks,
try setting environment flag:
ac_cv_o_nonblock_inherited=no
just before running configure…
and also
apache is a server.we can run each server in unique listen port so we are unable to run same server in two different ports.but u can run on different unique ports. in apache webserver u change that  in httpd.conf listen
port to 8080 (default is 80).that listen port belongs to http port for reciving requests and send responces.so please try to understand that which port belongs to which one.
23.Does Apache include any sort of database integration?
Apache is a Web (HTTP) server, not an application server. The base package does not include any such functionality. See the PHP project and the mod_perl project
for examples of modules that allow you to work with databases from within the Apache environment.
24.What is Apache?
Apache is a freely available Web server that is distributed under an “open source” license. Version 2.0 runs on most Unix-based operating systems (such as Linux, Solaris,Digital UNIX, and AIX), on other UNIX/POSIX-derived systems(such as Rhapsody, BeOS, and BS2000/OSD), on AmigaOS, and on Windows 2000. According to the Netcraft (www.netcraft.com)
Web server survey in February, 2001, 60% of all Web sites on the Internet are using Apache (62% including Apache derivatives), making Apache more widely used than all other Web servers combined.
25.Does  Apache act as a Proxy server?
Yes, It acts as proxy also by using the mod_proxy module

Red Hat Interview Questions


1.In which File is Static IP address given so that it becomes Permanent?
/etc/sysconfig/network-scripts/ifcfg-eth0
2.To Check Which Service is running at Present in System what is the Command?
service –status-all
ps –ef
3.How to trace any process background processing?
ps -aux
4.How to build new filesystem ? and what is irig file system?
mke2fs /dev/hda(sda)
mkfs
mk
5.Which command is used to see all the system configuration?
like hardware, HDD, memory etc.
lspci -vv
6.What is the difference between Telnet and SSH?
ssh is a secured shell, where telnet is not a secured
one.when you ssh to trasnfer data between a system, the data
will be send in the encrypted form, where the hacker cannot
encode or decode it. While you telnet,the data send between
the system is alphabetical format(ASCII), where every one
can understand. More over as per network security, telnet
and ftp are prohibited. Always, trust SSL based data transfer.
7.What is the difference between unix and linux…
graphics is the main difference
extra more command are in linux
userfriendly then unix
8.what is mean by raid and what are all raids available even in software and hardware?
Raid Stands for Redundant Array of Independent Disks.It is
a set of Technology standards for Teamingup DiskDrives to
improve Performence and FaultTolerance. Totally there are 6
levels in Raid
0 – stripping
1 – Mirroring
2 – Stripping and Mirroring
3 – Onfficially Not Defined
4 – Striping with Differential Parity
5 – Striping with Distributional Parity
9.why the kernel panic error was appering?
kernel panic acured when linux kernel can not communicat with any hardware or any OS related file
10.What are the main differences between RHEL4 & RHEL5?
Of course RHEL5 security is the main advantage than RHEL4
in RHEL5 it has the updates like XEN, Yum and many
additional packages which supports all the third party softwares
11. How To Hide the FTP Version?
Stop httpd service.
12.what is difference between inetd and xinetd ?
The major difference between inetd and the newer xinetd is that inetd uses a single configuration file, with one line per service, while xinetd uses a configuration directory, with one file per service
13.What is LILO?
LILO stands for Linux boot loader. It will load the MBR, master boot record, into the memory, which tell the system which partition and hard drive to boot.
14.why accounting Software does not support on linux?
Bcoz the accounting software is have .exe file. And linux doesn’t support .exe file. so accounting software does not support on linux.
15.How to give 2 different gateway IP addresses for 2 different interfaces in same system ?
route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.0.2 dev eth0
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.3 dev eth1
16.How does the boot process[init levels] work on Linux?
1. The system BIOS checks the system and launches the first
stage boot loader on the MBR of the primary hard disk.
2. The Frist stage boot loader loads itself into memory and
launches the second stage boot loader from the /boot/
partition.
3. The second stage boot loader loads the kernel into
memory, which in turn loads any necessary modules and
mounts the root
partition read-only.
4. The kernel transfers control of the boot process to the /
sbin/init program.
5. The /sbin/init program loads all services and user-space
tools, and mounts all partitions
listed in /etc/fstab.
6. The user is presented with a login screen for the
freshly booted Linux system.
17.What is the difference between an argument and an option/switch?
option specifies the command how to run
arguement specifies the command on what to run
18.How to send automated email to a set of people at fixed time ?
Just create a alias of people and create a command file and create a crond entry.
19.What is the minimum number of partitions you need to install Linux?
/
/boot
/swap
20.There are 4 network Interfaces, how can we find which one is Primary ?
When you type the command netstat -nr in your shell, youwill find a line starting with 0.0.0.0. Something like
0.0.0.0  192.168.0.4  0.0.0.0  UG  0  0  0  eth0
This line indicates if the system tries to contact a network outside its local network. It will first contact the router 192.168.0.4 and it does it with the primary interface. Hence in this case its eth0. So you can check this line for the primary interface
21.What is the difference between home directory and working directory?
Home directory is one over which user have complete control and it is its default working directory when its logs in. while the working directory is the users current directory which may or may not be his home directory.
22.How can you see all mounted drives?
we can see all mounted drives
#mount
#df -Th
23.How to check all open ports on linux machine and block unsed ports?
open ports – nmap localhost
block unsed ports -
#nmap -v localhost for tcp
#nmap -sU localhost for udp
24.What are RPM?s, what do they offer?
The full form of RPM is Redhat Package Manager. rpm is a powerful Package Manager, which can be used to build,install, query, verify, update, and erase individual software packages. A package consists of an archive of files and meta-data used to install and erase the archive files.
25.You want to create a compressed backup of the users’ home directories. What utility should you use?
tar -cvzf user.tar.gz /home/user
26.What utility can you use to automate rotation of logs?
logrotate
27.How u use the iptable firewall to restrict ssh,telnet,ftp ?
iptables -A INPUT -s -p tcp –dport -j REJECT/DROP/DENY
28.What file should you examine to determine the defined runlevels for your system?
/etc/inittab
29.What is the name and path of the main system log?
var/log/messages  -  system log messages can be seen here
/var/log/dmesg  -  Kernel boot log messages can view