Important Veritas Cluster (VCS) Interview Questions In Linux

List of important Veritas Cluster (VCS) Interview Questions

Q 1: How to verify the syntax of the main.cf file
Ans: To verify the syntax of the main.cf file just mention the absolute directory path to the main.cf file:  # hacf -verify /etc/VRTSvcs/conf/config

Q 2: How to add a node in an existing cluster?
Ans:    Adding a node into an existing cluster is a multi steps process.

Most Important Interview questions on Nagios in Linux

Most Important Interview questions on Nagios in Linux

Q 1. What is Nagios and how it Works ?.

Ans: Nagios is an open source System and Network Monitoring application.Nagios runs on a server, usually as a daemon or service. Nagios periodically run plugins residing (usually) on the same server, they contact (PING etc.) hosts and servers on your network or on the Internet. You can also have information sent to Nagios. You then view the status information using the web interface. You can also receive email or SMS notifications if something happens. Event Handlers can also be configured to "act" if something happens.
The Nagios daemon behaves like a scheduler that runs certain scripts at certain moments. It stores the results of those scripts and will run other scripts if these results change. All these scripts are, of course, the scripts from the Nagios plug-in project or are scripts that you have created.

IPTABLES Interview Questions and Answer in Linux system administrator Interview questions


IPTABLES  Interview Questions in Linux

Here are some Linux system administrator Interview questions on Iptables.

Q1: – What is iptables ?
Ans: iptables is a user space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores. Different kernel modules and programs are currently used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames.

Sendmail Server Interview Questions Answers

Interview Questions And Answers on Sendmail Server 
Sendmail Server Interview questions and answers

Here is a list of all Mostly Asked sendmail server Interview Questions :

Q 1: - What is Sendmail ?
Ans: Sendmail is an MTA, meaning it accepts email messages sent to it using the SMTP proto-col and transports them to another MTA email server until the messages reach their destinations. It also accepts email for the local network and delivers them to local mail spools, one for each user.

linux apache server interview questions and answers for Linux Admin

linux apache server interview questions and answers
Interview questions and answers on Apache server

Here is a list of 30 important Apache web Server Interview Questions.

Q1. Briefly explain Apache Web Server?

Ans: Apache Web Server is one of the most secure, powerful and popular open source HTTP Servers. It can be used to host anything from personal web sites to corporate domains.

Mostly Asked NFS Interview questions and answers

NFS Interview questions and answers
NFS interview questions and answers

Here is a list of mostly asked 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.

DNS Interview Questions and Answers

DNS Server Interview Questions and Answers
interview questions and answers on DNS server

Active directory interview questions

Q1. What is the main purpose of a DNS server?
Ans: DNS servers are used to resolve FQDN hostnames into IP addresses and vice versa.

Q2. What is the port no of dns ?
Ans: 53.

Q3. What is a Forward Lookup?
Ans: Resolving Host Names to IP Addresses.

Mostly asked SAMBA Server Interview Questions

SAMBA Server Interview Questions


List of important Samba server Interview Question, frequently asked by interviewer. 


Q. what is samba?

Ans: “Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients." Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients.

Q:  On which ports SAMBA server works ?

 Ans: UDP port 137 for netbiosns, the NETBIOS Name Service
 UDP port 138 for netbiosdgm, the NETBIOS Datagram Service
 TCP port 139 for netbiosssn, the NETBIOS session service
 TCP port 445 for microsoftds, the Microsoft Domain Service


Q:  What are the Security or Authentication Mode for SAMBA server?

Ans: ADS
DOMAIN
SERVER
USER
SHARE

Q. What is CIFS?

Ans: The Common Internet File System (CIFS), also known as Server Message Block (SMB), is a network protocol whose most common use is sharing files on a Local Area Network (LAN).  The protocol allows a client to manipulate files just as if they were on the local computer.  Operations such as read, write, create, delete, and rename are all supported – the only difference being that the files are not on the local computer and are actually on a remote server.

Q. Configuration file for samba?

Ans:  /etc/samba/smb.conf

Q: Which SELinux security context used for SAMBA ?
Ans: Chcon –t samba_share_t  <shared directory name>

Q:  How to Manually Create Machine Trust Accounts ?

Ans: /usr/sbin/useradd g machines d /var/lib/nobody c "machine nickname" s /bin/false machine_name$
passwd l machine_name$

Q:  How Do I Replicate the smbpasswd File?

Ans: Replication of the smbpasswd file is sensitive. It has to be done whenever changes to the SAM are made. Every user's password change is done in the smbpasswd file and has to be replicated to the BDC. So replicating the smbpasswd file very often is necessary.As the smbpasswd file contains plaintext password equivalents, it must not be sent unencrypted over the wire. The best way to set up smbpasswd replication from the PDC to the BDC is to use the utility rsync. rsync can use ssh as a transport. ssh itself can be set up to accept only rsync transfer without requiring the user to type a password.As said a few times before, use of this method is broken and awed. Machine trust accounts will go out of sync, resulting in a broken domain. This method is not recommended. Try using LDAP instead.

Q:  What are the SAMBA server Types ?

 Ans: Primary Domain Controller (PDC)
 Backup Domain Controller (BDC)
 ADS Domain Controller


Q:  Which protocol SAMBA server uses ?

Ans: SMB, which stands for Server Message Block, is a protocol for sharing files, printers, serial ports, and communications abstractions such as named pipes and mail slots between computers.


Q:  How Does a Workstation find its Domain Controller?

Ans: There are two different mechanisms to locate a domain controller: one method is used when NetBIOS over TCP/IP is enabled and the other when it has been disabled in the TCP/IP network configuration. Where NetBIOS over TCP/IP is disabled, all name resolution involves the use of DNS, broadcast messaging over UDP, as well as Active Directory communication technologies.


Q:  Can Samba Be a Backup Domain Controller to an NT4 PDC?

Ans: No. The native NT4 SAM replication protocols have not yet been fully implemented.

Q:  Can Samba fully replace my Windows NT server that is not a Primary Domain Controller (PDC)?
Ans: Samba can completely serve files and printers to Windows, just as a Windows NT server would.

Q:  Can Samba replaces my Windows NT PDC?

 Ans: Not completely. Samba domain control capabilities for a Windows 9x client are solid and complete, and so these clients would probably never know the difference. The domain control support for Windows NT/2000 clients is still being developed. Currently, enough has been implemented to allow a Windows NT client to join a Sambacontrolled domain, but there is more to domain control than that. The most conspicuous absence is the lack of support for Windows NT trust relationships and the SAM replication protocol used between NT PDCs and Backup Domain Controllers (BDCs).

Q: What TCP and UDP ports required for NetBIOS over TCP/IP use?

Ans: The NBT name service uses port 137/udp, the NBT session service uses port 139/tcp, and the NBT datagram service uses port 138/udp.

Q:   How SMB protocol works?

Ans: There will be three stages in creating an SMB connection between a client and a specific share on a server. The first stage in connecting to an SMB share is to negotiate the SMB protocol dialect to use. In the request packet, the client sends a text listing of all the SMB dialects that it understands. The server selects the most advanced protocol that it knows and responds to the client, specifying the protocol number from the list. At this point, the client and server have agreed that SMB commands can be used for the remainder of the conversation.

The second stage is to create a session connection between the client and server. To do this, the client issues a session setup request, which includes a sername and some proof of validity, such as a password. The server attempts to validate requesting user. If successful, the server then returns a session UID to client. This UID is unique for each session and has no relation to the server internal representation of users.


The third stage before access to files on a remote share is allowed is for the client to make a successful tree connection to the shared resource. The client sends to the server a tree connect request, which includes the UID previously issued by the server. At this stage the server verifies that the authenticated user is authorized to access the requested resource. If the user has sufficient privileges to access the share, the client is issued a tree connection ID (TID). The TID is used in all requests to access files contained in the resource to which the TID refers.

In this way SMB protocol works.


Q:   What is the use of "smbclient" command?

Ans: "smbclient" is used to display the list of shares on your server. This verifies that smbd is running and functioning correctly. The L option instructs smbclient to enumerate the shares on the server rather than actually connecting to one. The   N switch instructs smbclient to use an anonymous login rather than the login name of the current user.

smbclient L localhost N

Antother use of "smbclient" command to connect the samba share.
smbclient //<server>/<share> -U <username>

Q:   Explain "smbstatus" command?

Ans: The smbstatus utility displays information about connected users and currently locked files.

Q:  Is it possible for Samba to share file systems that have been mounted using NFS?

Ans: Yes. However, this can be problematic if the NFS server that provides the file system fails, causing the Samba server to hang. It is always safer to use Samba to share a local file system.

Q:  How many simultaneous connections can a Samba server support?

Ans: In theory, there is no limit. In practice, the limit is determined by the server’s hardware, specifically the total amount of available RAM and the CPU power. It might also depend on the amount of activity from the smbd processes.

Q:  Can Samba be a member of more than one workgroup at the same time?

Ans: No, Samba can be a member of only one workgroup.

Q:  What is SWAT?

Ans: SWAT is GUI Based administration tool for samba server.

Q:  I am trying to use SWAT, but I keep getting the message There was no response. The server could be down or not responding. What is the problem?

Ans:
The most likely cause is that SWAT is not listening to connections, or you have used the wrong URL in trying to connect to SWAT. SWAT usually lives behind port 901, so the URL you should use is http://ID_ADDRESS_OF_SERVER:901/

Q:  How man sections samba configuration file (smb.conf) contains?

Ans: smb.conf file contains three sections.
1.   [global] Contains settings that determine Samba overall behavior.
2. [homes] A default share for providing a home directory for all users.
3. [printers] A default share for exporting all printers on the host via CIFS.

Q:  If a netbios name is not defined in smb.conf, than what will be netbios name?

Ans: If a netbios name is not defined, Samba will use the IP hostname of the server by default.

Q: I want to use User level security for my samba server than what i have to add in smb.conf file?

Ans:
security = user

Q:   How you will verify that your smb.conf file doesn’t have any mistakes and misspellings?

Ans: "testparm " tool that verifies the syntax of a configuration file(smb.conf).
testparm s smb.conf

Q: Can i set empty password for samba user?

Ans: yes, If you want to set the value to an empty password, you must change
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
to

NOPASSWORDXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

in your smbpasswd file.

Note:  if you have edited the smbpasswd file by hand, make sure that the LAN Manager and NT password fields contain exactly 32 characters, no more and no fewer. If these fields do not have exactly 32 characters, Samba will not be able to correctly read the entry.
or You can modify by "smbpasswd" command.

smbpasswd n USER_NAME

Also you have to set the null passwords parameter to yes in the [global] section of smb.conf:
null passwords = yes

Q:  Does Samba support PAM?

Ans: Yes

Q:  What is role of "NTLM"?

Ans: The challenge/response authentication protocol available to Windows clients and servers for validating connection requests.

Q:  Explain "force group" parameter used in smb.conf?

Ans: It will define the group id to be used for all file access in the place of the user’s primary group.

Q:  Explain "force user" parameter used in smb.conf?

Ans: It will define the user id to be used for all file access.

Q:  Explain "write list" parameter used in smb.conf?

Ans: A list of users and/or groups that should be given write access even if the read only parameter has been enabled.

Q:  Explain the parameter "wins support = Yes" used in smb.conf?

Ans: If the Samba server was configured to provide WINS support ("wins support = Yes"), then the WINS server is able to provide name resolution for all of the hosts that are not listed in the /etc/hosts file or within the DNS. Making this adjustment in the Name Service Switch configuration file (/etc/nsswitch.conf) allows the Linux system to query the WINS server for local name resolution. This saves manual adjustments to host files.

Q:  How to automate SMB share mounting during system startup?

Ans: Add smb share entry in /etc/fstab file.
//IP_ADDRESS_OF_SERVER/Shared   /shared    smbfs    noauto,defaults  0  0

Q:  how to start and stop samba server?

Ans: /etc/init.d/smb  restart
Or service smb restart


Q:  My clients are getting the error message that the Disk is Full when trying to print to my Samba server, but there is plenty of space. What is the problem?

Ans: If smbd is unable to write the spooled file to the directory defined by the path parameter for a printer if the write permission were denied, for example it would respond to the client with the message, Disk is Full. Samba will also return this error message if the amount of free disk space in the spool directory has fallen below the value specified by the min print space parameter.

Q:  When I click on my Samba server in the network neighborhood, I am continually prompted for a password to the IPC$ share no matter what I enter.

Ans: The Windows client is attempting to use encrypted passwords. However, the Samba server is configured to support only cleartext passwords. You should either enable encrypted passwords on the server or enable cleartext passwords on the Windows client.

Q:  Why is security = domain better than security = server?

Ans: There are three reasons why security = domain is better. The first is because this method enables the Samba server to participate in domain trust relationships. This is impossible with serverlevel security. The second reason is that, under serverlevel security, each smbd process must keep an open connection with the authentication server. This can drain a Windows NT PDC quickly. Under domainlevel security, this connection is maintained only long enough to perform the validation, thus conserving valuable resources. The final reason is that, as a domain member, the Samba server has access to much more information about user accounts, which can be used to automate the creation and deletion of user accounts upon demand.

Q:  what is nmbd daemon?

Ans: This daemon handles all name registration and resolution requests. It is the primary vehicle involved in network browsing. It handles all UDPbased protocols. The nmbd daemon should be the first command started as part of the Samba startup process.

Q:  What is smdb daemon?

Ans: This daemon handles all TCP/IPbased connection services for file and printbased operations. It also manages local authentication. It should be started immediately following the startup of nmbd.

Q:  What is winbindd daemon?

Ans: This daemon should be started when Samba is a member of a Windows NT4 or ADS domain. It is also needed when Samba has trust relationships with another domain. The winbindd daemon will check the smb.conf file for the presence of the idmap uid and idmap gid  parameters. If they are found, winbindd will use the values specified for UID and GID allocation. If these parameters are not specified, winbindd  will start but it will not be able to allocate UIDs or GIDs.




.....Best Of Luck.....



Linux FTP (vsftpd) Interview Questions & Answers

Linux FTP (vsftpd) Interview Questions & Answers


In Linux Like operating system vsftpd(Very Secure FTP Daemon) is ftp server , which provides the features of downloading and uploading files to the ftp space. Now we will discuss most common ftp server interview questions along with the Answers.


Q:1 What does VSFTPD Stands for ?
Ans: VSFTPD stands for Very Secure FTP Daemon.

Q:2 What are the defaults ports used in linux ftp server ?
Ans: Port 20 – This is the data transfer port. All the all subsequent data transfers between the client and server are done using this port.
Port 21 – On this port control connection is established. All commands we send and the ftp server’s responses to those commands will go over the control connection, but any data sent back (such as “ls” directory lists or actual file data in either direction) will go over the data connection.

Q:3 What are most common features of vsftpd ?
Ans: some of the Common Features are listed below :
·         Virtual IP configurations
·         Virtual users
·         Standalone or inetd operation
·         Powerful per-user configurability
·         Bandwidth throttling
·         Per-source-IP configurability
·         Per-source-IP limits
·         IPv6
·         Encryption support through SSL integration

Q:4 What is the configuration file of vsftpd ?
Ans: ‘/etc/vsftpd/vsftpd.conf’

Q:5 How to restart the service of ftp server in linux ?
Ans: Service vsftpd restart or /etc/init.d/vsftpd restart

Q:6 What is Passive mode?
Ans: Passive mode, like active mode, is initiated by the FTP client application. When requesting data from the server, the FTP client indicates it wants to access the data in passive mode and the server provides the IP address and a random, unprivileged port (greater than 1024) on the server. The client then connects to that port on the server to download the requested information.

Q:7 How to allow Anonymous FTP ?
Ans: Anonymous FTP is enabled by default by setting the anonymous_enable directive in /etc/vsftpd/vsftpd.conf to YES.

Q:8 Which Users are not allowed to login via ftp ? or How to deny specific users access to the FTP server?
Ans: Users mentioned in the file ‘/etc/vsftpd/ftpusers’ are not allowed to login via ftp.

Q:9 I want to copy multiple files without prompting for any info, how can I do that one?
Ans: ftp -i ftpserver

Q:10 How to disable standard ftpd xferlog log format and enable default vsftpd log ?
Ans : Edit the file ‘ /etc/vsftpd/vsftpd.conf’ & make the below changes:
·         xferlog_std_format=NO
·         log_ftp_protocol=YES
The default vsftpd log file is /var/log/vsftpd.log

Q:11 Local users cannot log in. How to resolve this issue?
Ans: Check "local_enable=YES" in your /etc/vsftpd/vsftpd.conf to allow local users to log in.

Q:12 What is default directory for ftp / Anonymous user ?
Ans : ‘/var/ftp’ is the default directory for ftp or Anonymous user

Q:13 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:14 How to disable Anonymous user in vsftpd ?
Ans: Edit the conf file ‘/etc/vsftpd/vsftpd.conf’ and chnage below directive and restart the ftp service.
·         anonymous_enable=NO

Q:15 How to enable Anonymous downloads, but disable permission to write?
Ans: In the above said scenario, we need to edit the parameter ‘anon_world_readable_only’. The parameter should be enabled and set to ‘YES’. The default value is YES.

Q:16 How to CHMOD all Anonymous uploads automatically. How would you do?
Ans: To chmod all anonymous uploads automatically, we need to edit the parameter ‘chmod_enable’ and set it to ‘YES’. Anonymous users never get to use SITE CHMOD. The default value is YES.

 Q:17 How to disable directory listing in a FTP server?
Ans: The parameter ‘dirlist_enable’ comes to rescue at this point. The value of ‘dirlist_enable’ should be set to NO. The default value is YES.

Q:18 How to maintain sessions for logins of VSFTP. How will you do?
Ans: The parameter ‘session_support’ needs to be modified. This parameter controls and manages vsftp attempts to maintain session for logins. The default value is NO.

Q:19 How will you limit the maximum transfer rate from VSFTP server?
Ans: To limit the maximum transfer rate of VSFTP server we need the parameter ‘anon_max_rate’ in bytes per second, for anonymous client. The default value is 0 which means unlimited.

Q:20 How will you timeout the idle session of VSFTP?
Ans: The parameter ‘idle_session_timeout’ needs to be modified here. The timeout in second, which is the maximum time an anonymous user can spend in a session between his client machine and VSFTP server. As soon as the the timeout triggers, the client is logged out. The default time is 300.

Q:21 Explain directive "session_support”?
Ans: When enabled, vsftpd attempts to maintain login sessions for each user through Pluggable Authentication Modules (PAM).

Q:22 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:23 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:24 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
The file specified by userlist_file will now contain users that are able to login.

Q:25 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:26 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 connected
·         max_per_ip=2 # Maximum connections per IP

Q:27 What is meaning of max_clients parameter ?

Ans: Maximum number of clients that can connect at one time. If set to 0, the number of clients is unlimited.

.....Best Of Luck.....





SSH Interview Questions and answers

SSH Interview Questions and answers

Here are some SSH interview Questions

1. What is the default port & configuration file of SSH Server ?
Ans: 22 is default port  for ssh and  ‘/etc/ssh/sshd_config’ is the configuration file.

2. How to change the default ssh port in linux ?
Ans: To change the port , first edit the file ‘ /etc/ssh/sshd_config ‘ , change the  vaule of parameter ‘ port 22 ‘, now restart the ssh service.

3. What is the configuration file of ssh client ?
Ans: ‘ /etc/ssh/ssh_config ‘ is configuration file for ssh client.

4.What is SSH port forwarding ?
Ans: SSH Port Forwarding, sometimes called SSH Tunneling, which allows you to establish a secure SSH session and then tunnel arbitrary TCP connections through it. Tunnels can be created at any time, with almost no effort and no programming.

Syntax : ssh -L localport:host:hostport user@ssh_server -N

where:
-L – port forwarding parameters
localport – local port (chose a port that is not in use by other service)
host – server that has the port (hostport) that you want to forward
hostport – remote port
-N – do not execute a remote command, (you will not have the shell, see below)
user – user that have ssh access to the ssh server (computer)
ssh_server – the ssh server that will be used for forwarding/tunneling

Without the -N option you will have not only the forwarding port but also the remote shell.

5. How to disable the root login in linux server ?
Ans: Open the file ‘ /etc/ssh/sshd_config ‘ and chnage the paramenter ‘PermitRootLogin yes’ to ‘PermitRootLogin no’ & restart the ssh service.

6. How to allow only specific users to ssh your linux server ?
Ans: Open the file ‘/etc/ssh/sshd_config’ and add the parameter ‘AllowUsers user1 user2′ & then restart the ssh server.

7. How to enable debugging in ssh command ?
Ans: To enable debugging in ssh command use ‘-v’ option like ‘ssh root@www.linuxelearn.blogspot.in -v’. To increase the debugging level just increase the number of v’s.

8. What is the difference between ssh & Telnet ?
Ans: In ssh communication between client & server is encrypted but in telnet communication between the client & server is in plain text . We can also say SSH uses a public key for authentication while Telnet does not use any authentication.SSH adds a bit more overhead to the bandwidth compared to Telnet.Default port of ssh is 22 and for telnet 23.

9. What is use of sshpass command in linux ?
Ans: sshpass is a command which allows us to automatically supply password to the command prompt so that automated scripts can be run as desired by users. sshpass supplies password to ssh prompt using a dedicated tty , fooling ssh to believe that a interactive user is supplying password.

10. What is the use of scp command ?
Ans: SCP stands for Secure Copy ,it copies files between hosts over a  network.  It uses ssh for data transfer &  uses the same authentication and provides the same security as ssh. Unlike rcp, scp will ask for passwords or passphrases if they are needed for authentication.

11. What is the use of blowfish options in scp command ?
Ans: Using blowfish options in scp command , we can increase the speed, by default scp uses the Triple-DES cipher to encrypt the data being copied.
Example : scp -c blowfish /home/itstuff.txt root@mail.rjchavan.in:/opt/

12. How to limit the bandwidth used by scp command ?
Ans: We can limit the bandwidth used by the scp command using the -l option as shown in the syntax.’#scp -l bandwidth_limit filename username@remote-host:/folder-name’ , where bandwidth_limit is numeric to be specified in kilobits per second.

13. How to enable passwordless ssh authentication in Linux ?
Ans: To Implement passwordless or Keys based authentication we have to generate Public and Private keys , Copy the Pubic keys to remote Linux servers either manually or by ssh-copy-id command.ssh-copy-id command will automatically copy the contents of id_rsa.pub file to ‘~/.ssh/authorized_keys’ file of remote linux server.

14. How to check SSH server’s Version ?
Ans: Using the command ‘ ssh -V ‘ we can find the ssh server’s version.

15. How to Copy the file “server.txt” from the local machine to a remote host using port 2751 in /opt folder.
Ans:  scp -P 2751 /home/server.txt root@mail.rjchavan.in:/opt 

16. SSH or Telnet? Why?
Ans: Both SSH and Telnet are network Protocol. Both the services are used in order to connect and communicate to another machine over Network. SSH uses Port 22 and Telnet uses port 23 by default. Telnet send data in plain text and non-encrypted format everyone can understand whereas SSH sends data in encrypted format. Not to mention SSH is more secure than Telnet and hence SSH is preferred over Telnet.

17. How to add welcome/warning message as soon as a user login to SSH Server?
Ans: In order to add a welcome/warning message as soon as a user logged into SSH server, we need to edit file called ‘/etc/issue’ and add message there.

18. Is it possible to copy files over SSH? How?
Ans: Yes! We can copy files over SSH using command SCP, stands for ‘Secure CopY’. SCP copies file using SSH and is very secure in functioning.

19. Is it possible to pass input to SSH from a local file? If Yes! How?
Ans: Yes! We can pass input to SSH from a local file. We can do this simply as we do in scripting Language. Here is a simple one liner command, which will pass input from local files to SSH.

20. Is it possible to trace unauthorized login attempts to SSH Server with date of Intrusion along with their corresponding IP.

Ans: Yes! we can find the failed login attempts in the log file created at location ‘/var/log/secure’. We can make a filter using the grep command as shown below.


.....Best Of Luck.....



LVM Interview Questions and Answers

LVM Interview Questions and Answers


Here are Linux system administrator Interview questions and all Important "LVM" Interview Questions.

1.Is it possible to increase the logical volume on fly ?
Ans: Yes.We can increase the logical volume without umount it.

2.How to reduce the logical volume ? is it possible to reduce on fly ?
Ans:  No.You can’t reduce the logical volume on fly. Here is the steps to reduce the logical volume on redhat Linux.
   Un-mount the filesystem
   Run e2fsck on the volume device
   Reduce the Filesystem.(resize2fs)
   Reduce the logical Volume(lvreduce)
   Mount the filesystem back for production.

3.How to do you scan the new LUN or disk for LVM  physical volume ?
Ans: Use “pvscan” to scan existing physical volume from newly connected SAN or DISKS.

4.How to scan disks for existing volume group ?
Ans: Use “vgscan” to scan existing volume group from newly connected SAN or DISKS.
But you should use “pvscan” prior to executing this command.

5.How to scan a logical volume from exising volume group?
Ans: lvscan

6.How to stop the logical volume ? or deactivate the logical volume ?
Ans: “lvchange -an /dev/vg_name/lv_name”

7.How to activated the logical volume which in deactivated state ?
Ans: “lvchange -ay /dev/vg_name/lv_name” .

8.How to disable the volume group ? or Deactivate the volume group ?
Ans: ”vgchange -an volume_group_name” .

9.How to enable the volume group ? or Activate the volume group ?
Ans: ”vgchange -ay volume_group_name” .

10.How do you find that what are the disks are used for  logical volume mirroring ?
Ans: use “lvs -a -o +devices”

11. What are steps to perform in order to increase the logical volume on fly ?
Ans:
      Extend the logical volume
      Increase the Filesystem size
      Verify the status using df command or lvs command.

12.How to list the imported volume groups ?
Ans: Use “vgs” command to display the imported volume group.

13.How to list the available logical volumes on the system?
Ans: Use “lvs” command to list the available logical volumes on the system.

14.How to list the available physical volumes in LVM?
Ans: Use “pvs” command to list the available physical volumes.

15.How to see the detailed volume group information ?
Ans: Use “vgdisplay  vg_name”

16.How to see the detailed logical volume information ?
Ans: Use “lvdisplay  /dev/vg_name/lv_name”

17.How to see the detailed physical volume information ?
Answer: Use “pvdisplay /dev/disk_name”    Ex: pvdisplay /dev/sde

18.How to rename volume Group ? can we rename the VG on fly ?
Ans: Yes.Its possible to rename the volume group on fly.But the mounted volumes will not reflect the same unless you re-mount the volume with new VG name.
Need to update the /etc/fstab with new VG name to mount the volumes across the system reboot.

19.How to take a LVM configuration backup ?
Ans: Use “vgcfgbackup vg_name” to take the latest configuration backup of volume group.The default volume group backup location is “/etc/lvm/backup” .

20.How to re-create the device files for LVM volumes ?
Ans: Run “vgmknodes” to recreate the LVM devices files.

21.What is lvmdump ?
Ans: ”lvmdump” is tool for LVM2 to collect the various information for diagnostic purposes.By default, it creates a tarball suitable for submission along with a problem report

22.How are snapshots in LVM2 different from LVM1 in Redhat Linux?
Ans: LVM1 snapshots are  readonly by default where LVM2 snapshots were read/write.

23.What are the steps involved to create the logical volume from scratch ?
Ans:
     i.Create a physical volume using pvcreate command.
       #pvcreate /dev/sdc
    ii.Create a volume group using “vgcreate” command
       #vgcreate vg02 /dev/sdc
   iii.Create a logical volume using “lvcreate” command
       #lvcreate -L 100M -n vol1 vg02
    iv.Create a filesystem on logical volume using mkfs command.
        #mkfs -t ext4 /dev/vg02/vol1
     v.Mount the filesystem using mount command for use.
        #mount -t ext4 /dev/vg02/vol1 /vol1

24.How to extent the volume group ?
Ans: Using “vgextend” we can increase the volume group.

25.How to copy a LV from one VG to another?
Ans: # cplv -v <new vg name> <sourcelvname>

26.Assume Volume group “vg02″ is already exists.How do you extend the volume group with 50GB ? Provide all the steps with commands.
Ans:
      1.Get the 50GB lun from SAN team.(/dev/sdd)
      2.Create physcical volume ( # pvcreate /dev/sdd )
      2.Extend the volume group (# vgextend vg02 /dev/sdd)
27.How do I replace a disk?
Ans:    extendvg VolumeGroupName hdisk_new
migratepv hdisk_bad hdisk_new
reducevg -d VolumeGroupName hdisk_bad

28.If the vg02 has two physical volumes called /dev/sdc/ & /dev/sdd. How do you remove /dev/sdd from vg02.
Ans: “vgreduce vg02 /dev/sdd/”

29.How to decommission/remove  LVM completely from the host ?
Ans:
          1.Un-mount all the logical filesystems
          2.Remove the logical volumes using “lvremove” command.
          3.Destroy the volume group using “vgremove”  command.
          4.Use “pvremove” command remove the physical volumes from the system.

30. Why is LVM is required ?
Ans: LVM stands for Logical Volume Manager , to resize filesystem’s size online we required LVM partition in Linux. Size of LVM partition can be extended and reduced using the lvextend & lvreduce commands respectively.

31.How can I change the characteristics of a volume group?
You use the chvg command to change the characteristics of a volume group.
32.How do I create a logical volume?

Ans: #mklv -y name_of_logical_volume name_of_volume_group number_of_partition

33.How will you change a PP size?
Ans: PP size can be change using a T-factor. If not then add a partitions in VG by adding one disk.
# chvg –t3 rootvg

34.T – Factor?
Ans: T – factor means that it will change the pp size to increase the efficiency of vg
#chvg –t16 datavg
Cal-if suppose that datavg pp size is 1016 we can take t factor is 16 then it comes to 2048 and pv contains in vg is 2.
35. What is the default PP Size in AIX?
Ans: 128MB
36. How To check Memory stats and CPU stats ?
Ans:  Using ‘free’ & ‘vmstat’ command we can display the physical and virtual memory statistics respectively.With the help of ‘sar’ command we see the CPU utilization & other stats.

37. What does Sar provides and at which location Sar logs are stored ?
Ans: Sar Collect, report, or save system activity information. The default version of the sar command (CPU utilization report) might be one of the first facilities the  user  runs  to  begin system  activity investigation, because it monitors major system resources. If CPU utilization is near 100 percent (user + nice + system), the workload sampled is CPU-bound.

By  default log files of Sar command  is located at  /var/log/sa/sadd file, where the dd parameter indicates the current day.

38. How to increase the size of LVM partition ?
Ans: Below are the Logical Steps :
- Use the lvextend command (lvextend -L +100M /dev/<Name of the LVM Partition> , in this example we are extending the size by 100MB.
- resize2fs /dev/<Name of the LVM Partition>
- check the size of partition using ‘df -h’ command

39.How to reduce or shrink the size of LVM partition ?
Ans: Below are the logical Steps to reduce size of LVM partition :
-Umount the filesystem using umount command,
-use resize2fs command , e.g resiz2fs /dev/mapper/myvg-mylv 10G
-Now use the lvreduce command , e.g lvreduce -L 10G /dev/mapper/myvg-mylv
Above Command will shrink the size & will make the filesystem size 10GB.

40. How to create partition from the raw disk ?
Ans: Using fdisk utility we can create partitions from the raw disk.Below are the steps to create partition from the raw dsik :
- fdisk  /dev/hd* (IDE) or /dev/sd* (SCSI)
- Type n to create a new partition
-  After creating partition , type w command to write the changes to the partition table.




.....Best Of Luck.....