2 * Author: Tatu Ylonen <ylo@cs.hut.fi>
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * Created: Sat Mar 18 16:36:11 1995 ylo
6 * Ssh client program. This program can be used to log into a remote machine.
7 * The software supports strong authentication, encryption, and forwarding
8 * of X11, TCP/IP, and authentication connections.
10 * Modified to work with SSL by Niels Provos <provos@citi.umich.edu> in Canada.
28 #ifdef HAVE___PROGNAME
29 extern char *__progname;
30 #else /* HAVE___PROGNAME */
31 const char *__progname = "ssh";
32 #endif /* HAVE___PROGNAME */
34 /* Flag indicating whether IPv4 or IPv6. This can be set on the command line.
35 Default value is AF_UNSPEC means both IPv4 and IPv6. */
37 int IPv4or6 = AF_INET;
39 int IPv4or6 = AF_UNSPEC;
42 /* Flag indicating whether debug mode is on. This can be set on the command line. */
45 /* Flag indicating whether a tty should be allocated */
48 /* don't exec a shell */
49 int no_shell_flag = 0;
53 * Flag indicating that nothing should be read from stdin. This can be set
54 * on the command line.
56 int stdin_null_flag = 0;
59 * Flag indicating that ssh should fork after authentication. This is useful
60 * so that the pasphrase can be entered manually, and then ssh goes to the
63 int fork_after_authentication_flag = 0;
66 * General data structure for command line options and options configurable
67 * in configuration files. See readconf.h.
72 * Name of the host we are connecting to. This is the name given on the
73 * command line, or the HostName specified for the user-supplied name in a
78 /* socket address the host resolves to */
79 struct sockaddr_storage hostaddr;
82 * Flag to indicate that we have received a window change signal which has
83 * not yet been processed. This will cause a message indicating the new
84 * window size to be sent to the server a little later. This is volatile
85 * because this is updated in a signal handler.
87 volatile int received_window_change_signal = 0;
89 /* Value of argv[0] (set in the main program). */
92 /* Flag indicating whether we have a valid host private key loaded. */
93 int host_private_key_loaded = 0;
95 /* Host private key. */
96 RSA *host_private_key = NULL;
98 /* Original real UID. */
99 uid_t original_real_uid;
101 /* command to be executed */
104 /* Prints a help message to the user. This function never returns. */
109 fprintf(stderr, "Usage: %s [options] host [command]\n", av0);
110 fprintf(stderr, "Options:\n");
111 fprintf(stderr, " -l user Log in using this user name.\n");
112 fprintf(stderr, " -n Redirect input from /dev/null.\n");
113 fprintf(stderr, " -a Disable authentication agent forwarding.\n");
115 fprintf(stderr, " -k Disable Kerberos ticket and AFS token forwarding.\n");
117 fprintf(stderr, " -x Disable X11 connection forwarding.\n");
118 fprintf(stderr, " -i file Identity for RSA authentication (default: ~/.ssh/identity).\n");
119 fprintf(stderr, " -t Tty; allocate a tty even if command is given.\n");
120 fprintf(stderr, " -T Do not allocate a tty.\n");
121 fprintf(stderr, " -v Verbose; display verbose debugging messages.\n");
122 fprintf(stderr, " -V Display version number only.\n");
123 fprintf(stderr, " -P Don't allocate a privileged port.\n");
124 fprintf(stderr, " -q Quiet; don't display any warning messages.\n");
125 fprintf(stderr, " -f Fork into background after authentication.\n");
126 fprintf(stderr, " -e char Set escape character; ``none'' = disable (default: ~).\n");
128 fprintf(stderr, " -c cipher Select encryption algorithm: "
131 fprintf(stderr, " -p port Connect to this port. Server must be on the same port.\n");
132 fprintf(stderr, " -L listen-port:host:port Forward local port to remote address\n");
133 fprintf(stderr, " -R listen-port:host:port Forward remote port to local address\n");
134 fprintf(stderr, " These cause %s to listen for connections on a port, and\n", av0);
135 fprintf(stderr, " forward them to the other side by connecting to host:port.\n");
136 fprintf(stderr, " -C Enable compression.\n");
137 fprintf(stderr, " -N Do not execute a shell or command.\n");
138 fprintf(stderr, " -g Allow remote hosts to connect to forwarded ports.\n");
139 fprintf(stderr, " -4 Use IPv4 only.\n");
140 fprintf(stderr, " -6 Use IPv6 only.\n");
141 fprintf(stderr, " -o 'option' Process the option as if it was read from a configuration file.\n");
146 * Connects to the given host using rsh (or prints an error message and exits
147 * if rsh is not available). This function never returns.
150 rsh_connect(char *host, char *user, Buffer * command)
155 log("Using rsh. WARNING: Connection will not be encrypted.");
156 /* Build argument list for rsh. */
158 args[i++] = _PATH_RSH;
159 /* host may have to come after user on some systems */
165 if (buffer_len(command) > 0) {
166 buffer_append(command, "\0", 1);
167 args[i++] = buffer_ptr(command);
171 for (i = 0; args[i]; i++) {
173 fprintf(stderr, " ");
174 fprintf(stderr, "%s", args[i]);
176 fprintf(stderr, "\n");
178 execv(_PATH_RSH, args);
183 int ssh_session(void);
184 int ssh_session2(void);
187 * Main program for the ssh client.
190 main(int ac, char **av)
192 int i, opt, optind, exit_status, ok;
193 u_short fwd_port, fwd_host_port;
194 char *optarg, *cp, buf[256];
196 struct passwd *pw, pwcopy;
198 uid_t original_effective_uid;
201 * Save the original real uid. It will be needed later (uid-swapping
202 * may clobber the real uid).
204 original_real_uid = getuid();
205 original_effective_uid = geteuid();
207 /* If we are installed setuid root be careful to not drop core. */
208 if (original_real_uid != original_effective_uid) {
210 rlim.rlim_cur = rlim.rlim_max = 0;
211 if (setrlimit(RLIMIT_CORE, &rlim) < 0)
212 fatal("setrlimit failed: %.100s", strerror(errno));
215 * Use uid-swapping to give up root privileges for the duration of
216 * option processing. We will re-instantiate the rights when we are
217 * ready to create the privileged port, and will permanently drop
218 * them when the port has been created (actually, when the connection
219 * has been made, as we may need to create the port several times).
221 temporarily_use_uid(original_real_uid);
224 * Set our umask to something reasonable, as some files are created
225 * with the default umask. This will make them world-readable but
226 * writable only by the owner, which is ok for all files for which we
227 * don't set the modes explicitly.
231 /* Save our own name. */
234 /* Initialize option structure to indicate that no values have been set. */
235 initialize_options(&options);
237 /* Parse command-line arguments. */
240 /* If program name is not one of the standard names, use it as host name. */
241 if (strchr(av0, '/'))
242 cp = strrchr(av0, '/') + 1;
245 if (strcmp(cp, "rsh") != 0 && strcmp(cp, "ssh") != 0 &&
246 strcmp(cp, "rlogin") != 0 && strcmp(cp, "slogin") != 0)
249 for (optind = 1; optind < ac; optind++) {
250 if (av[optind][0] != '-') {
253 if ((cp = strchr(av[optind], '@'))) {
256 options.user = av[optind];
266 if (strchr("eilcpLRo", opt)) { /* options with arguments */
267 optarg = av[optind] + 2;
268 if (strcmp(optarg, "") == 0) {
269 if (optind >= ac - 1)
271 optarg = av[++optind];
292 fork_after_authentication_flag = 1;
297 options.forward_x11 = 0;
301 options.forward_x11 = 1;
305 options.gateway_ports = 1;
309 options.use_privileged_port = 0;
313 options.forward_agent = 0;
317 options.kerberos_tgt_passing = 0;
318 options.afs_token_passing = 0;
322 if (stat(optarg, &st) < 0) {
323 fprintf(stderr, "Warning: Identity file %s does not exist.\n",
327 if (options.num_identity_files >= SSH_MAX_IDENTITY_FILES)
328 fatal("Too many identity files specified (max %d)",
329 SSH_MAX_IDENTITY_FILES);
330 options.identity_files[options.num_identity_files++] =
340 fprintf(stderr, "SSH Version %s, protocol versions %d.%d/%d.%d.\n",
342 PROTOCOL_MAJOR_1, PROTOCOL_MINOR_1,
343 PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2);
344 fprintf(stderr, "Compiled with SSL (0x%8.8lx).\n", SSLeay());
348 options.log_level = SYSLOG_LEVEL_DEBUG;
352 options.log_level = SYSLOG_LEVEL_QUIET;
356 if (optarg[0] == '^' && optarg[2] == 0 &&
357 (unsigned char) optarg[1] >= 64 && (unsigned char) optarg[1] < 128)
358 options.escape_char = (unsigned char) optarg[1] & 31;
359 else if (strlen(optarg) == 1)
360 options.escape_char = (unsigned char) optarg[0];
361 else if (strcmp(optarg, "none") == 0)
362 options.escape_char = -2;
364 fprintf(stderr, "Bad escape character '%s'.\n", optarg);
370 options.cipher = cipher_number(optarg);
371 if (options.cipher == -1) {
372 fprintf(stderr, "Unknown cipher type '%s'\n", optarg);
378 options.port = atoi(optarg);
382 options.user = optarg;
386 if (sscanf(optarg, "%hu/%255[^/]/%hu", &fwd_port, buf,
387 &fwd_host_port) != 3 &&
388 sscanf(optarg, "%hu:%255[^:]:%hu", &fwd_port, buf,
389 &fwd_host_port) != 3) {
390 fprintf(stderr, "Bad forwarding specification '%s'.\n", optarg);
394 add_remote_forward(&options, fwd_port, buf, fwd_host_port);
398 if (sscanf(optarg, "%hu/%255[^/]/%hu", &fwd_port, buf,
399 &fwd_host_port) != 3 &&
400 sscanf(optarg, "%hu:%255[^:]:%hu", &fwd_port, buf,
401 &fwd_host_port) != 3) {
402 fprintf(stderr, "Bad forwarding specification '%s'.\n", optarg);
406 add_local_forward(&options, fwd_port, buf, fwd_host_port);
410 options.compression = 1;
424 if (process_config_line(&options, host ? host : "", optarg,
425 "command-line", 0, &dummy) != 0)
434 /* Check that we got a host name. */
438 /* check if RSA support exists */
439 if (rsa_alive() == 0) {
441 "%s: no RSA support in libssl and libcrypto. See ssl(8).\n",
445 /* Initialize the command to execute on remote host. */
446 buffer_init(&command);
449 * Save the command to execute on the remote host in a buffer. There
450 * is no limit on the length of the command, except by the maximum
451 * packet size. Also sets the tty flag if there is no command.
454 /* No command specified - execute shell on a tty. */
457 /* A command has been specified. Store it into the
459 for (i = optind; i < ac; i++) {
461 buffer_append(&command, " ", 1);
462 buffer_append(&command, av[i], strlen(av[i]));
466 /* Cannot fork to background if no command. */
467 if (fork_after_authentication_flag && buffer_len(&command) == 0)
468 fatal("Cannot fork into background without a command to execute.");
470 /* Allocate a tty by default if no command specified. */
471 if (buffer_len(&command) == 0)
474 /* Do not allocate a tty if stdin is not a tty. */
475 if (!isatty(fileno(stdin))) {
477 fprintf(stderr, "Pseudo-terminal will not be allocated because stdin is not a terminal.\n");
485 pw = getpwuid(original_real_uid);
487 fprintf(stderr, "You don't exist, go away!\n");
490 /* Take a copy of the returned structure. */
491 memset(&pwcopy, 0, sizeof(pwcopy));
492 pwcopy.pw_name = xstrdup(pw->pw_name);
493 pwcopy.pw_passwd = xstrdup(pw->pw_passwd);
494 pwcopy.pw_uid = pw->pw_uid;
495 pwcopy.pw_gid = pw->pw_gid;
496 pwcopy.pw_dir = xstrdup(pw->pw_dir);
497 pwcopy.pw_shell = xstrdup(pw->pw_shell);
500 /* Initialize "log" output. Since we are the client all output
501 actually goes to the terminal. */
502 log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 0);
504 /* Read per-user configuration file. */
505 snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, SSH_USER_CONFFILE);
506 read_config_file(buf, host, &options);
508 /* Read systemwide configuration file. */
509 read_config_file(HOST_CONFIG_FILE, host, &options);
511 /* Fill configuration defaults. */
512 fill_default_options(&options);
515 log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 0);
517 if (options.user == NULL)
518 options.user = xstrdup(pw->pw_name);
520 if (options.hostname != NULL)
521 host = options.hostname;
523 /* Find canonic host name. */
524 if (strchr(host, '.') == 0) {
525 struct addrinfo hints;
526 struct addrinfo *ai = NULL;
528 memset(&hints, 0, sizeof(hints));
529 hints.ai_family = IPv4or6;
530 hints.ai_flags = AI_CANONNAME;
531 hints.ai_socktype = SOCK_STREAM;
532 errgai = getaddrinfo(host, NULL, &hints, &ai);
534 if (ai->ai_canonname != NULL)
535 host = xstrdup(ai->ai_canonname);
539 /* Disable rhosts authentication if not running as root. */
540 if (original_effective_uid != 0 || !options.use_privileged_port) {
541 options.rhosts_authentication = 0;
542 options.rhosts_rsa_authentication = 0;
545 * If using rsh has been selected, exec it now (without trying
546 * anything else). Note that we must release privileges first.
548 if (options.use_rsh) {
550 * Restore our superuser privileges. This must be done
551 * before permanently setting the uid.
555 /* Switch to the original uid permanently. */
556 permanently_set_uid(original_real_uid);
559 rsh_connect(host, options.user, &command);
560 fatal("rsh_connect returned");
562 /* Restore our superuser privileges. */
566 * Open a connection to the remote host. This needs root privileges
567 * if rhosts_{rsa_}authentication is enabled.
570 ok = ssh_connect(host, &hostaddr, options.port,
571 options.connection_attempts,
572 !options.rhosts_authentication &&
573 !options.rhosts_rsa_authentication,
575 options.proxy_command);
578 * If we successfully made the connection, load the host private key
579 * in case we will need it later for combined rsa-rhosts
580 * authentication. This must be done before releasing extra
581 * privileges, because the file is only readable by root.
584 host_private_key = RSA_new();
585 if (load_private_key(HOST_KEY_FILE, "", host_private_key, NULL))
586 host_private_key_loaded = 1;
589 * Get rid of any extra privileges that we may have. We will no
590 * longer need them. Also, extra privileges could make it very hard
591 * to read identity files and other non-world-readable files from the
592 * user's home directory if it happens to be on a NFS volume where
593 * root is mapped to nobody.
597 * Note that some legacy systems need to postpone the following call
598 * to permanently_set_uid() until the private hostkey is destroyed
599 * with RSA_free(). Otherwise the calling user could ptrace() the
600 * process, read the private hostkey and impersonate the host.
601 * OpenBSD does not allow ptracing of setuid processes.
603 permanently_set_uid(original_real_uid);
606 * Now that we are back to our own permissions, create ~/.ssh
607 * directory if it doesn\'t already exist.
609 snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, SSH_USER_DIR);
610 if (stat(buf, &st) < 0)
611 if (mkdir(buf, 0755) < 0)
612 error("Could not create directory '%.200s'.", buf);
614 /* Check if the connection failed, and try "rsh" if appropriate. */
616 if (options.port != 0)
617 log("Secure connection to %.100s on port %hu refused%.100s.",
619 options.fallback_to_rsh ? "; reverting to insecure method" : "");
621 log("Secure connection to %.100s refused%.100s.", host,
622 options.fallback_to_rsh ? "; reverting to insecure method" : "");
624 if (options.fallback_to_rsh) {
625 rsh_connect(host, options.user, &command);
626 fatal("rsh_connect returned");
630 /* Expand ~ in options.identity_files. */
631 for (i = 0; i < options.num_identity_files; i++)
632 options.identity_files[i] =
633 tilde_expand_filename(options.identity_files[i], original_real_uid);
635 /* Expand ~ in known host file names. */
636 options.system_hostfile = tilde_expand_filename(options.system_hostfile,
638 options.user_hostfile = tilde_expand_filename(options.user_hostfile,
641 /* Log into the remote system. This never returns if the login fails. */
642 ssh_login(host_private_key_loaded, host_private_key,
643 host, (struct sockaddr *)&hostaddr, original_real_uid);
645 /* We no longer need the host private key. Clear it now. */
646 if (host_private_key_loaded)
647 RSA_free(host_private_key); /* Destroys contents safely */
649 exit_status = compat20 ? ssh_session2() : ssh_session();
666 /* Enable compression if requested. */
667 if (options.compression) {
668 debug("Requesting compression at level %d.", options.compression_level);
670 if (options.compression_level < 1 || options.compression_level > 9)
671 fatal("Compression level must be from 1 (fast) to 9 (slow, best).");
673 /* Send the request. */
674 packet_start(SSH_CMSG_REQUEST_COMPRESSION);
675 packet_put_int(options.compression_level);
678 type = packet_read(&plen);
679 if (type == SSH_SMSG_SUCCESS)
680 packet_start_compression(options.compression_level);
681 else if (type == SSH_SMSG_FAILURE)
682 log("Warning: Remote host refused compression.");
684 packet_disconnect("Protocol error waiting for compression response.");
686 /* Allocate a pseudo tty if appropriate. */
688 debug("Requesting pty.");
690 /* Start the packet. */
691 packet_start(SSH_CMSG_REQUEST_PTY);
693 /* Store TERM in the packet. There is no limit on the
694 length of the string. */
698 packet_put_string(cp, strlen(cp));
700 /* Store window size in the packet. */
701 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) < 0)
702 memset(&ws, 0, sizeof(ws));
703 packet_put_int(ws.ws_row);
704 packet_put_int(ws.ws_col);
705 packet_put_int(ws.ws_xpixel);
706 packet_put_int(ws.ws_ypixel);
708 /* Store tty modes in the packet. */
709 tty_make_modes(fileno(stdin));
711 /* Send the packet, and wait for it to leave. */
715 /* Read response from the server. */
716 type = packet_read(&plen);
717 if (type == SSH_SMSG_SUCCESS) {
720 } else if (type == SSH_SMSG_FAILURE)
721 log("Warning: Remote host failed or refused to allocate a pseudo tty.");
723 packet_disconnect("Protocol error waiting for pty request response.");
725 /* Request X11 forwarding if enabled and DISPLAY is set. */
726 if (options.forward_x11 && getenv("DISPLAY") != NULL) {
727 char line[512], proto[512], data[512];
729 int forwarded = 0, got_data = 0, i;
732 /* Try to get Xauthority information for the display. */
733 snprintf(line, sizeof line, "%.100s list %.200s 2>/dev/null",
734 XAUTH_PATH, getenv("DISPLAY"));
735 f = popen(line, "r");
736 if (f && fgets(line, sizeof(line), f) &&
737 sscanf(line, "%*s %s %s", proto, data) == 2)
741 #endif /* XAUTH_PATH */
743 * If we didn't get authentication data, just make up some
744 * data. The forwarding code will check the validity of the
745 * response anyway, and substitute this data. The X11
746 * server, however, will ignore this fake data and use
747 * whatever authentication mechanisms it was using otherwise
748 * for the local connection.
753 strlcpy(proto, "MIT-MAGIC-COOKIE-1", sizeof proto);
754 for (i = 0; i < 16; i++) {
757 snprintf(data + 2 * i, sizeof data - 2 * i, "%02x", rand & 0xff);
762 * Got local authentication reasonable information. Request
763 * forwarding with authentication spoofing.
765 debug("Requesting X11 forwarding with authentication spoofing.");
766 x11_request_forwarding_with_spoofing(proto, data);
768 /* Read response from the server. */
769 type = packet_read(&plen);
770 if (type == SSH_SMSG_SUCCESS) {
773 } else if (type == SSH_SMSG_FAILURE)
774 log("Warning: Remote host denied X11 forwarding.");
776 packet_disconnect("Protocol error waiting for X11 forwarding");
778 /* Tell the packet module whether this is an interactive session. */
779 packet_set_interactive(interactive, options.keepalives);
781 /* Clear agent forwarding if we don\'t have an agent. */
782 authfd = ssh_get_authentication_socket();
784 options.forward_agent = 0;
786 ssh_close_authentication_socket(authfd);
788 /* Request authentication agent forwarding if appropriate. */
789 if (options.forward_agent) {
790 debug("Requesting authentication agent forwarding.");
791 auth_request_forwarding();
793 /* Read response from the server. */
794 type = packet_read(&plen);
795 packet_integrity_check(plen, 0, type);
796 if (type != SSH_SMSG_SUCCESS)
797 log("Warning: Remote host denied authentication agent forwarding.");
799 /* Initiate local TCP/IP port forwardings. */
800 for (i = 0; i < options.num_local_forwards; i++) {
801 debug("Connections to local port %d forwarded to remote address %.200s:%d",
802 options.local_forwards[i].port,
803 options.local_forwards[i].host,
804 options.local_forwards[i].host_port);
805 channel_request_local_forwarding(options.local_forwards[i].port,
806 options.local_forwards[i].host,
807 options.local_forwards[i].host_port,
808 options.gateway_ports);
811 /* Initiate remote TCP/IP port forwardings. */
812 for (i = 0; i < options.num_remote_forwards; i++) {
813 debug("Connections to remote port %d forwarded to local address %.200s:%d",
814 options.remote_forwards[i].port,
815 options.remote_forwards[i].host,
816 options.remote_forwards[i].host_port);
817 channel_request_remote_forwarding(options.remote_forwards[i].port,
818 options.remote_forwards[i].host,
819 options.remote_forwards[i].host_port);
822 /* If requested, let ssh continue in the background. */
823 if (fork_after_authentication_flag)
824 if (daemon(1, 1) < 0)
825 fatal("daemon() failed: %.200s", strerror(errno));
828 * If a command was specified on the command line, execute the
829 * command now. Otherwise request the server to start a shell.
831 if (buffer_len(&command) > 0) {
832 int len = buffer_len(&command);
835 debug("Sending command: %.*s", len, buffer_ptr(&command));
836 packet_start(SSH_CMSG_EXEC_CMD);
837 packet_put_string(buffer_ptr(&command), buffer_len(&command));
841 debug("Requesting shell.");
842 packet_start(SSH_CMSG_EXEC_SHELL);
847 /* Enter the interactive session. */
848 return client_loop(have_tty, tty_flag ? options.escape_char : -1);
855 /* Initiate local TCP/IP port forwardings. */
856 for (i = 0; i < options.num_local_forwards; i++) {
857 debug("Connections to local port %d forwarded to remote address %.200s:%d",
858 options.local_forwards[i].port,
859 options.local_forwards[i].host,
860 options.local_forwards[i].host_port);
861 channel_request_local_forwarding(options.local_forwards[i].port,
862 options.local_forwards[i].host,
863 options.local_forwards[i].host_port,
864 options.gateway_ports);
868 extern void client_set_session_ident(int id);
871 client_init(int id, void *arg)
874 debug("client_init id %d arg %d", id, (int)arg);
885 /* Store window size in the packet. */
886 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) < 0)
887 memset(&ws, 0, sizeof(ws));
889 channel_request_start(id, "pty-req", 0);
890 packet_put_cstring(cp);
891 packet_put_int(ws.ws_col);
892 packet_put_int(ws.ws_row);
893 packet_put_int(ws.ws_xpixel);
894 packet_put_int(ws.ws_ypixel);
895 packet_put_cstring(""); /* XXX: encode terminal modes */
897 /* XXX wait for reply */
899 len = buffer_len(&command);
903 debug("Sending command: %.*s", len, buffer_ptr(&command));
904 channel_request_start(id, "exec", 0);
905 packet_put_string(buffer_ptr(&command), len);
908 channel_request(id, "shell", 0);
910 /* channel_callback(id, SSH2_MSG_OPEN_CONFIGMATION, client_init, 0); */
912 /* register different callback, etc. XXX */
913 client_set_session_ident(id);
919 int window, packetmax, id;
920 int in = dup(STDIN_FILENO);
921 int out = dup(STDOUT_FILENO);
922 int err = dup(STDERR_FILENO);
924 if (in < 0 || out < 0 || err < 0)
925 fatal("dump in/out/err failed");
927 /* should be pre-session */
932 packetmax = window/8;
935 packetmax = window/2;
939 "session", SSH_CHANNEL_OPENING, in, out, err,
940 window, packetmax, CHAN_EXTENDED_WRITE, xstrdup("client-session"));
944 channel_register_callback(id, SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, client_init, (void *)0);
946 return client_loop(tty_flag, tty_flag ? options.escape_char : -1);