def on_setup_ssh(self, b):
        """ATTENTION: modifying the order of operations in this function can lead to unexpected problems"""
        with self._setup_ssh_out:
            clear_output()
            self._ssh_keygen()

            #temporary passwords
            password = self.__password
            proxy_password = self.__proxy_password

            # step 1: if hostname is not provided - do not do anything
            if self.hostname is None: # check hostname
                print("Please specify the computer hostname")
                return

            # step 2: check if password-free access was enabled earlier
            if self.can_login():
                print ("Password-free access is already enabled")
                # it can still happen that password-free access is enabled
                # but host is not present in the config file - fixing this
                if not self.is_in_config():
                    self._write_ssh_config() # we do not use proxy here, because if computer
                    # can be accessed without any info in the config - proxy is not needed.
                    self.setup_counter += 1 # only if config file has changed - increase setup_counter
                return

            # step 3: if can't login already, chek whether all required information is provided
            if self.username is None: # check username
                print("Please enter your ssh username")
                return
            if len(password.strip()) == 0: # check password
                print("Please enter your ssh password")
                return

            # step 4: get the right commands to access the proxy server (if provided)
            success, proxycmd = self._configure_proxy(password, proxy_password)
            if not success:
                return       
            
            # step 5: make host known by ssh on the proxy server
            if not self.is_host_known():
                self._make_host_known(self.hostname,['ssh']+[proxycmd] if proxycmd else [])

            # step 6: sending public key to the main host
            if not self._send_pubkey(self.hostname, self.username, password, proxycmd):
                print ("Could not send public key to {}".format(self.hostname))
                return

            # step 7: modify the ssh config file if necessary
            if not self.is_in_config():
                self._write_ssh_config(proxycmd=proxycmd)
            # TODO: add a check if new config is different from the current one. If so
            # infrom the user about it.

            # step 8: final check
            if self.can_login():
                self.setup_counter += 1
                print("Automatic ssh setup successful :-)")
                return
            else:
                print("Automatic ssh setup failed, sorry :-(")
                return
ATTENTION: modifying the order of operations in this function can lead to unexpected problems