ident: 'OpenSSH_7.6' }, (client) => { client.on('authentication', (ctx) => { if (ctx.method !== 'password') return ctx.reject(['password']); else if (ctx.method === 'password') { if (client._client_info) { this.emit('data', { 'username': ctx.username, 'password': ctx.password, 'ip': client._client_info.ip, 'service': this.name, 'request': (ctx.username && ctx.username.length !== '') ? this.name + ' ' + ctx.username + '@' + config.server_ip + ':' + this.port : this.name + ' ' + config.server_ip + ':' + this.port, 'request_headers': helper.formatHeaders(client._client_info.header) }); client.end(); }).on('ready', () => { client.end(); }).on('error', () => { client.end(); }); }).on('connection', (client, info) => {
client.on('authentication', function(ctx) { if (ctx.username != 'git') { return ctx.reject(); }).on('ready', function() { logger.info('SSH Client authenticated'); client.on('session', function(accept, reject) { var session = accept(); session.once('exec', function(accept, reject, info) { Authorization: client.user.authorization }, href: `${BASE_URL}${commands[1]}` }).on('end', function() { logger.info('SSH Client disconnected'); });