--- remote.php-orig	2013-09-19 17:49:16.000000000 +0200
+++ remote.php	2013-09-19 22:02:58.000000000 +0200
@@ -273,6 +273,7 @@
 			break;
 		case 'ssh':
 			$params_from_settings['sudo-user'] = 'sudo_user';
+			$params_from_settings['sp'] = 'password';
 			$params_from_settings[] = '--';
 			$params_from_settings['p'] = 'port';
 			$params_from_settings['l'] = 'username';
@@ -297,6 +298,8 @@
 			$params_from_settings[] = '-oCheckHostIP=no';
 			$params_from_settings[] = '-oLogLevel=ERROR';
 			$params_from_settings[] = $settings['hostname'];
+			# leave the shell, not break it <g>
+			$commands .= "logout\n";
 			break;
 		case 'ucssdk': # remote XML through a Python backend
 			# UCS in its current implementation besides the terminal_settings() provides
@@ -517,7 +520,7 @@
 	$except_fd = array();
 	$out = '';
 	$errors = '';
-	while ((! empty ($read_fd) || ! empty ($write_fd)) && stream_select ($read_fd, $write_fd, $except_fd, NULL))
+	while ((! empty ($read_fd) || ! empty ($write_fd)) && stream_select ($read_fd, $write_fd, $except_fd, 5))
 	{
 		foreach ($write_fd as $fd)
 		{
