private void _tcpServer_ClientConnected(object sender, ClientEventArgs e)
        {
            e.Client.KeyExchangeInitialized += new EventHandler <SshKeyExchangeInitializedEventArgs>(
                client_KeyExchangeCompleted);

            // Initialize authentication service.
            var authService = e.Client.AuthenticationService;

            authService.BannerMessage = GetProductName() + "\r\n";
            authService.AuthenticationMethodRequested += new EventHandler <AuthMethodRequestedEventArgs>(
                authService_AuthenticationMethodRequested);
            authService.AuthenticateUserPublicKey += new EventHandler <AuthUserPublicKeyEventArgs>(
                authService_AuthenticateUserPublicKey);
            authService.AuthenticateUserPassword += new EventHandler <AuthUserPasswordEventArgs>(
                authService_AuthenticateUserPassword);
            authService.AuthenticateUserHostBased += new EventHandler <AuthUserHostBasedEventArgs>(
                authService_AuthenticateUserHostBased);
            authService.AuthenticateUserKeyboardInteractive += new EventHandler <
                AuthUserKeyboardInteractiveEventArgs>(authService_AuthenticateUserKeyboardInteractive);
            authService.ChangePassword += new EventHandler <ChangePasswordEventArgs>(
                authService_ChangePassword);
            authService.PromptInfoRequested += new EventHandler <PromptInfoRequestedEventArgs>(
                authService_PromptInfoRequested);

            // Initialize connection service.
            var connService = e.Client.ConnectionService;

            connService.ChannelOpenRequest += new EventHandler <ChannelOpenRequestEventArgs>(
                connService_ChannelOpenRequest);
            connService.ChannelOpened  += new EventHandler <ChannelEventArgs>(connService_ChannelOpened);
            connService.ChannelClosed  += new EventHandler <ChannelEventArgs>(connService_ChannelClosed);
            connService.ChannelUpdated += new EventHandler <ChannelEventArgs>(connService_ChannelUpdated);

            // Write to event log.
            LogClientEvent(e.Client, "Connected from server.", EventLogEntryType.Information);
        }
Example #2
0
 private void tcpServer_ClientDisconnected(object sender, ClientEventArgs e)
 {
     //
 }
Example #3
0
 private void tcpServer_ClientConnected(object sender, ClientEventArgs e)
 {
     e.Client.ConnectionService.ChannelOpened += new EventHandler<ChannelEventArgs>(
         connService_ChannelOpened);
 }
 private void _tcpServer_ClientDisconnected(object sender, ClientEventArgs e)
 {
     // Write to event log.
     LogClientEvent(e.Client, "Disconnected from server.", EventLogEntryType.Information);
 }
        private void _tcpServer_ClientConnected(object sender, ClientEventArgs e)
        {
            e.Client.KeyExchangeInitialized += new EventHandler<SshKeyExchangeInitializedEventArgs>(
                client_KeyExchangeCompleted);

            // Initialize authentication service.
            var authService = e.Client.AuthenticationService;

            authService.BannerMessage = GetProductName() + "\r\n";
            authService.AuthenticationMethodRequested += new EventHandler<AuthMethodRequestedEventArgs>(
                authService_AuthenticationMethodRequested);
            authService.AuthenticateUserPublicKey += new EventHandler<AuthUserPublicKeyEventArgs>(
                authService_AuthenticateUserPublicKey);
            authService.AuthenticateUserPassword += new EventHandler<AuthUserPasswordEventArgs>(
                authService_AuthenticateUserPassword);
            authService.AuthenticateUserHostBased += new EventHandler<AuthUserHostBasedEventArgs>(
                authService_AuthenticateUserHostBased);
            authService.AuthenticateUserKeyboardInteractive += new EventHandler<
                AuthUserKeyboardInteractiveEventArgs>(authService_AuthenticateUserKeyboardInteractive);
            authService.ChangePassword += new EventHandler<ChangePasswordEventArgs>(
                authService_ChangePassword);
            authService.PromptInfoRequested += new EventHandler<PromptInfoRequestedEventArgs>(
                authService_PromptInfoRequested);

            // Initialize connection service.
            var connService = e.Client.ConnectionService;

            connService.ChannelOpenRequest += new EventHandler<ChannelOpenRequestEventArgs>(
                connService_ChannelOpenRequest);
            connService.ChannelOpened += new EventHandler<ChannelEventArgs>(connService_ChannelOpened);
            connService.ChannelClosed += new EventHandler<ChannelEventArgs>(connService_ChannelClosed);
            connService.ChannelUpdated += new EventHandler<ChannelEventArgs>(connService_ChannelUpdated);

            // Write to event log.
            LogClientEvent(e.Client, "Connected from server.", EventLogEntryType.Information);
        }
 private void _tcpServer_ClientDisconnected(object sender, ClientEventArgs e)
 {
     // Write to event log.
     LogClientEvent(e.Client, "Disconnected from server.", EventLogEntryType.Information);
 }
 private void tcpServer_ClientDisconnected(object sender, ClientEventArgs e)
 {
     //
 }
 private void tcpServer_ClientConnected(object sender, ClientEventArgs e)
 {
     e.Client.ConnectionService.ChannelOpened += new EventHandler <ChannelEventArgs>(
         connService_ChannelOpened);
 }