In: Computer Science
In worm, what will happen if the ssh.connect(...) line fails? What code should be added in order to properly handle such scenarios?
Solution for ssh.connect() refused on Ubuntu
If ssh.connect() fails in a machine we need to install ssh
server using below command
sudo apt install ssh
Then it will ask for the permission
Do you want to continue [y/n]
Press y
Now it will install ssh server and wait for the process to
complete.
Now again open ssh.connect() , and this time it will run on your
machine.
Solution on Mac system
Here we are going to install couple of softwares first:
sudo apt-get install tasksel
then sudo tasksel and choose OpenSSH server
After the installation is finished then try to connect it again and this will run as a service now.