Question 1. What Is Ssh Protocol?
SSH, or secure shell, is a secure protocol and the most common way of safely administering remote servers. Because it encrypt data while transferring from one host to another host throughout network.
Question 2. What Is The Default Port & Configuration File Of Ssh Server ?
22 is default port for ssh and ‘/etc/ssh/sshd_config’ is the configuration file.
Question 3. How To Change The Default Ssh Port In Linux ?
To change the port , first edit the file ‘ /etc/ssh/sshd_config ‘ , change the value of parameter ‘ port 22 ‘, now restart the ssh service.
Question 4. What Is The Configuration File Of Ssh Client ?
‘ /etc/ssh/ssh_config ‘ is configuration file for ssh client.
Question 5. What Is Ssh Port Forwarding?
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
-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.
Question 6. How To Disable The Root Login In Linux Server ?
Open the file ‘ /etc/ssh/sshd_config ‘ and change the parameter ‘PermitRootLogin yes’ to ‘PermitRootLogin no’ & restart the ssh service.
Question 7. How To Allow Only Specific Users To Ssh Your Linux Server ?
Open the file ‘/etc/ssh/sshd_config’ and add the parameter ‘AllowUsers user1 user2′ & then restart the ssh server.
Question 8. What Is The Difference Between Ssh & Telnet ?
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.
Question 9. What Is Use Of Sshpass Command In Linux ?
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.
Question 10. What Is The Use Of Scp Command ?
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.
Question 11. What Is The Use Of Blowfish Options In Scp Command ?
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 email@example.com:/opt/
Question 12. How To Limit The Bandwidth Used By Scp Command ?
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.
Question 13. How To Enable Passwordless Ssh Authentication In Linux ?
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.
Question 14. How To Check Ssh Server’s Version ?
Using the command ‘ ssh -V ‘ we can find the ssh server’s version.
Question 15. Please Explain The Different Protocols For Ssh Communication?
SSH has two protocols, Protocol 1 and Protocol 2. Protocol 1 is less secure and old. We use Protocol 2 now-a-days! You can set/change it from the SSH configuration file.
Question 16. How To Check Ssh Server’s Version Details From Linux Commandline?
You can find the SSH server version by executing the following command:
# ssh -V
# ssh -V
OpenSSH_6.6.1p1, OpenSSL 1.0.1e-fips 11 Feb 2013.
Question 17. What Is Abbreviated As Scp?
SCP stands for Secure Copy.
Question 18. Did You Hear About Blowfish?
Blowfish is used with SCP command. It uses to increase the transfer speed. By default scp uses the Triple-DES cipher to encrypt the data being copied.
Syntax: scp -c blowfish root@host:/home/crybit/* /home/crybit.
Question 19. Can You Briefly Explain The Working Of Scp?
SCP stands for Secure Copy. It transfer files over n/w securely. SCP is based on SSH protocol and it uses the SSH port by default.
- Client initiates an SSH connection to the remote host, and requests an SCP process to be started on the remote host.
- Remote SCP process can operate in two modes.
2.1 Source mode
In this mode, SCP on remote host read files from HDD and send them back to the client machine.
2.3 Sink mode
Which accept the files sent by the client and write them to the disk on the remote host.
Syntax is same as the base Linux copy command.
Question 20. What Purpose Is Assigned For “maxauthtries?”
Which defines the maximum number of allowed failed login attempt from a n/w.
Question 21. How Do You Access Gui Using Ssh Connection?
SSH will also support of transferring X11 forwarding, we have to use options called -XY to open server GUI app from client.
Samba Server Interview Questions
Samba Server Interview Questions