SSH (Secure Shell) is typically used to login into a remote machine and execute commands, but it also supports tunneling, forwarding TCP ports and X11 connections. It can transfer files using the associated SSH File Transfer(SFTP) or Secure Copy(SCP) Protocols.
$sudo apt-get install rsync ——- (Remote Sync)
$sudo apt-get install openssh-server ——-[Default port is 22]
After install ssh server, we have to generate SSH Key by using below command
$ssh-keygen -t rsa -P”” ———-[It will generate id-rsa.pub file]
Next you have to enable SSH access to your local machine with this newly created key.
$cat $HOME/.ssh/id-rsa.pub >> $HOME/.ssh/authorized-keys
$chmode 0600 ~/.ssh/authorized-keys
To be sure that SSH installation is went well, you can open a new terminal and try create ssh session using login user by the following command
$ssh localhost
$ssh -vvv username@localhost
-vvv ——[very,very verbose mode]
if not connected ssh properly you can add user name will all permission in “sudoers” file.In that file add the following line below “# user previlage specification ”
$sudo nano /etc/sudoers
username ALL=(ALL:ALL) ALL
While editing sudo file if any error occurs use this command to fix it
$pkexec visudo
Any edition happen sshd-config file we have to reload it by using below command
$sudo /etc/init.d/ssh reload