{"id":294405,"date":"2019-09-08T15:00:09","date_gmt":"2019-09-08T15:00:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=294405"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=294405","title":{"rendered":"Ssh-chat"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. Console chat \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0432\u0435\u0449\u044c, \u043d\u043e \u0434\u043b\u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435\u0440\u043e\u0432, \u0430 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043d\u043e \u0434\u043b\u044f \u0431\u044d\u043a\u044d\u043d\u0434\u0430. \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441. \u041d\u043e \u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u0431\u044d\u043a\u0435\u043d\u0434\u0435? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e ssh, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e sshchat<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"kak-eto-budet-vyglyadet\">\u041a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c<\/h2>\n<p>  <\/p>\n<p>\u0413\u0434\u0435-\u0442\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 \u043d\u043e\u0434\u0435.<br \/>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0442\u043e-\u0442\u043e \u0445\u043e\u0447\u0435\u0442, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u0447\u0430\u0442\u0443 \u043e\u043d \u0432\u0432\u043e\u0434\u0438\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">ssh server -p 8022<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u0441\u0432\u0435\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0441\u043e\u0432\u043f\u0430\u043b, \u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a \u0447\u0430\u0442\u0443(\u044e\u0437\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 100 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0438\u0434\u044f\u0442 \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f)<br \/>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445, \u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0451.<br \/>  \u0412\u043e\u0442 \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">@box{@color(red){Red text in box}}<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0432 \u043a\u043e\u0440\u043e\u0431\u043a\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"pristupim\">\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ssh \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.npmjs.com\/package\/ssh2\">https:\/\/www.npmjs.com\/package\/ssh2<\/a><br \/>  \u0414\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c chalk \u0438 boxen<br \/>  \u0422\u0430\u043a \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0438\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npm i ssh2 chalk boxen<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c \u043a\u043e\u0434 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u044d\u0442\u043e \u043f\u0430\u0440\u0441\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<br \/>  <a href=\"https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/parserExec.js\">https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/parserExec.js<\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c chalk \u0438 boxen const chalk = require('chalk'); const boxen = require('boxen');  \/\/ \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 @ \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 2 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0442\u043e \u0447\u0442\u043e \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0438 \u0442\u0435\u043a\u0441 \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 let methods = {   color: function(args, text) {     return chalk.keyword(args)(text);   },    bold: function(args, text) {     return chalk.bold(text);   },    underline: function(args, text) {     return chalk.underline(text);   },    hex: function(args, text) {     return chalk.hex(args)(text);   },    box: function(args, text) {     return boxen(text, {       borderStyle: 'round',       padding: 1,       borderColor: 'blueBright'     });   } };  \/\/ \u0421\u0430\u043c \u043f\u0430\u0440\u0441\u0435\u0440  function parseAndExecute(str) {   let pos = 0;   let stage = 0;   let nS = '';   let bufs = ['', '', '', ''];   let level = 0;    while (pos &lt; str.length) {     let symbol = str[pos];     pos++;      if (symbol == '\\\\' &amp;&amp; '(){}@'.indexOf(str[pos]) !== -1) {       bufs[stage] += str[pos];       pos++;       continue;     }      if (stage == 0 &amp;&amp; symbol == '@') {       stage++;       nS += bufs[0];       bufs[0] = '';       continue;     } else if (stage &gt;= 1) {       if (symbol == '(')         if (stage &lt; 2) {           stage = 2;         } else {           level++;         }        if (symbol == ')' &amp;&amp; stage &gt;= 2 &amp;&amp; level &gt; 0) level--;        if (symbol == '{')         if (stage != 3) {           stage = 3;         } else {           level++;         }        if (symbol == '}') {         if (level == 0) {           bufs[3] += '}';            nS += methods[bufs[1]](bufs[2].slice(1, -1), parseAndExecute(bufs[3].slice(1, -1)));            bufs = ['', '', '', ''];           stage = 0;           continue;         } else {           level--;         }       }     }     bufs[stage] += symbol;   }   return nS + bufs[0]; }  module.exports.parseAndExecute = parseAndExecute;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<br \/>  <a href=\"https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/format.js\">https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/format.js<\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const chalk = require('chalk'); const { parseAndExecute } = require('.\/parserExec')  \/\/ \u0421\u0442\u0438\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u0438\u043a(\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0446\u0432\u0435\u0442 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0436\u0438\u0440\u043d\u044b\u043c) function getNick(nick) {   let hash = 0;   for (var i = 0; i &lt; nick.length; i++) hash += nick.charCodeAt(i) - 32;    return chalk.hsv((hash + 160) % 360, 90, 90)(chalk.bold(nick)); }  module.exports.format = function(nick, message) {   const nickSpace = '\\r  ' + ' '.repeat(nick.length);   nick = getNick(nick) + ': ';    message = message.replace(\/\\\\n\/gm, '\\n'); \/\/ \u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c \\n \u043d\u043e\u0432\u044b\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438   message = parseAndExecute(message) \/\/ \u041f\u0430\u0440\u0441\u0438\u043c    \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u043c \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043e\u0442\u0441\u0442\u0443\u043f   message = message     .split('\\n')     .map((e, i) =&gt; '' + (i !== 0 ? nickSpace : '') + e)     .join('\\n');    return nick + message; };<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f 100 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<br \/>  <a href=\"https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/broadcaster.js\">https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/broadcaster.js<\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">let listeners = []; \/\/ \u0412\u0441\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 let cache = new Array(100).fill('') \/\/ \u041a\u044d\u0448   \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432 module.exports.addListener = write =&gt; listeners.push(write) - 1; module.exports.delListener = id =&gt; listeners.splice(id, 1);  \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 module.exports.broadcast = msg =&gt; {    cache.shift()   cache.push(msg)   process.stdout.write(msg)   listeners.forEach(wr =&gt; wr(msg)); }  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u044d\u0448 module.exports.getCache = ()=&gt;cache.join('\\r\\033[1K')<\/code><\/pre>\n<p>  <\/p>\n<p>\u041b\u043e\u0431\u0431\u0438, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<br \/>  <a href=\"https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/lobby.js\">https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/lobby.js<\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const { Server } = require('ssh2'); const { readFileSync } = require('fs');  const hostKey = readFileSync('.\/ssh'); \/\/ \u0427\u0438\u0442\u0430\u0435\u043c \u043a\u043b\u044e\u0447 const users = JSON.parse(readFileSync('.\/users.json')); \/\/ \u042e\u0437\u0435\u0440\u044b  let connectionCallback = () =&gt; {};  module.exports.createServer = function createServer({ lobby }) {   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0435\u0440\u0432\u0435\u0440   const server = new Server(     {       banner: lobby, \/\/ \u0411\u0430\u043d\u043d\u0435\u0440 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442 \u0434\u043e \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f       hostKeys: [hostKey]     },     function(client) {       nick = '';       client         .on('authentication', ctx =&gt; {  \/\/ \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f           if (ctx.method !== 'password') return ctx.reject();           if (ctx.password !== users[ctx.username]) ctx.reject();           nick = ctx.username;           ctx.accept();         })         .on('ready', function() {           connectionCallback(client, nick);         });     }   );    return server };  module.exports.setConnectCallback = callback =&gt; { \/\/ \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0431\u044d\u043a \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438   connectionCallback = callback; };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<br \/>  <a href=\"https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/utils.js\">https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/utils.js<\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const { createInterface } = require('readline');  module.exports.getStream = function(client, onStream, onEnd){   client  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0442\u0440\u0438\u043c \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430     .on('session', function(accept, reject) {       accept()         .on('pty', accept =&gt; accept &amp; accept())         .on('shell', accept =&gt; onStream(accept()));     })     .on('end', () =&gt; onEnd()); }  \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0442\u043e\u0440  module.exports.getCommunicator = function(stream, onMessage, onEnd){    let readline = createInterface({ \/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a     input: stream,     output: stream,     prompt: '&gt; ',     historySize: 0,     terminal: true   })   readline.prompt()    readline.on('close', ()=&gt;{     radline = null;     onEnd()     stream.end()   })    readline.on('line', (msg)=&gt;{     stream.write('\\033[s\\033[1A\\033[1K\\r')     onMessage(msg)     readline.prompt()   })    \/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f   return msg=&gt;{     stream.write('\\033[1K\\r' + msg)     readline.prompt()   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c<br \/>  <a href=\"https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/index.js\">https:\/\/github.com\/maximmasterr\/ssh-server\/blob\/master\/index.js<\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const { createServer, setConnectCallback } = require('.\/lobby'); const { getStream, getCommunicator } = require('.\/utils'); const { addListener, delListener, broadcast, getCache } = require('.\/broadcaster'); const { format, getNick } = require('.\/format');  \/\/  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430  module.exports = function({ lobby = 'Hi' } = {}) {   const server = createServer({     lobby   });    setConnectCallback((client, nick) =&gt; { \/\/ \u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f     console.log('Client authenticated!');     let id = null;     getStream( \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u0438\u043c       client,       stream =&gt; {         const write = getCommunicator( \/\/ \u0418 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441           stream,           msg =&gt; {             if (msg == '') return;             try {               broadcast(format(nick, msg) + '\\n'); \/\/ \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432\u0441\u0435\u043c             } catch (e) {}           },           () =&gt; {}         );          id = addListener(write); \/\/ \u0421\u043b\u0443\u0448\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f         write('\\033c' + getCache()); \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u044d\u0448         broadcast(getNick(nick) + ' connected\\n'); \/\/ \u0421\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438       },       () =&gt; {          delListener(id);         broadcast(getNick(nick) + ' disconnected\\n') \/\/ \u0421\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e\u0431 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438       }     );   });    server.listen(8022); };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const chat = require('.')  chat({})<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 users.json \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u044e\u0437\u0435\u0440\u044b \u0438 \u0438\u0445 \u043f\u0430\u0440\u043e\u043b\u0438<\/p>\n<p>  <\/p>\n<h2 id=\"vyvody\">\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0447\u0430\u0442 \u0432 ssh<br \/>  \u0414\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0447\u0430\u0442\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442, \u043e\u043d \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0439<br \/>  \u0427\u0442\u043e \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 markdown <\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u043e\u0442\u043e\u0432<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e scp<\/p>\n<p>  <\/p>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: <a href=\"https:\/\/github.com\/maximmasterr\/ssh-server\">https:\/\/github.com\/maximmasterr\/ssh-server<\/a><\/p>\n<p>  <\/li>\n<\/ul>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/466633\/\"> https:\/\/habr.com\/ru\/post\/466633\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. Console chat \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0432\u0435\u0449\u044c, \u043d\u043e \u0434\u043b\u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435\u0440\u043e\u0432, \u0430 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043d\u043e \u0434\u043b\u044f \u0431\u044d\u043a\u044d\u043d\u0434\u0430. \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441. \u041d\u043e \u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u0431\u044d\u043a\u0435\u043d\u0434\u0435? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e ssh, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e sshchat<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-294405","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=294405"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294405\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=294405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=294405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=294405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}