{"id":397,"date":"2009-10-10T13:00:01","date_gmt":"2009-10-10T11:00:01","guid":{"rendered":"http:\/\/blog.peychev.net\/?p=397"},"modified":"2012-08-31T09:02:06","modified_gmt":"2012-08-31T07:02:06","slug":"%d1%81%d0%ba%d1%80%d0%b8%d0%bf%d1%82-%d0%b7%d0%b0-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%bd%d0%be-%d0%bb%d0%be%d0%b3%d0%b2%d0%b0%d0%bd%d0%b5-%d0%ba%d1%8a%d0%bc-ssh","status":"publish","type":"post","link":"https:\/\/blog.peychev.net\/?p=397","title":{"rendered":"\u0421\u043a\u0440\u0438\u043f\u0442 \u0437\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043b\u043e\u0433\u0432\u0430\u043d\u0435 \u043a\u044a\u043c SSH"},"content":{"rendered":"<p>\u041e\u0442 \u0434\u043e\u0441\u0442\u0430 \u0432\u0440\u0435\u043c\u0435 \u0441\u0435 \u043c\u044a\u0447\u0430 \u0441 copy\/paste \u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u0438\u0442\u0435 \u043a\u044a\u043c \u043f\u043e\u0432\u0435\u0447\u0435\u0442\u043e \u0441\u044a\u0440\u0432\u044a\u0440\u0438, \u043d\u0430 \u043a\u043e\u0438\u0442\u043e \u0441\u0435 \u043b\u043e\u0433\u0432\u0430\u043c \u043f\u043e\u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u0442\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u0430, \u0447\u0435 \u043d\u044f\u043c\u0430 \u043a\u0430\u043a \u0434\u0430 \u0431\u044a\u0434\u0430\u0442 \u0437\u0430\u043f\u043e\u043c\u043d\u0435\u043d\u0438 (-:<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435\u0442\u043e, \u043a\u043e\u0435\u0442\u043e \u043e\u0442\u043a\u0440\u0438\u0445 \u0435 <a href=\"http:\/\/expect.nist.gov\/\" target=\"_blank\">Expect<\/a>, \u0430 \u0441\u0442\u044a\u043f\u043a\u0438\u0442\u0435 \u043f\u043e \u0441\u044a\u0437\u0434\u0430\u0432\u0430\u043d\u0435\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043d\u043e \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u043d\u0438 &#8220;\u043a\u043e\u043c\u0430\u043d\u0434\u0438&#8221; \u0437\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u043d \u043b\u043e\u0433\u0438\u043d \u0441\u0430 \u0441\u043b\u0435\u0434\u043d\u0438\u0442\u0435:<\/p>\n<p>!) \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043e \u0441\u0438 \u0438\u043d\u0441\u0442\u0430\u043b\u0438\u0440\u0430\u0442\u0435 Expect, \u0430\u043a\u043e \u0433\u043e \u043d\u044f\u043c\u0430\u0442\u0435.<br \/>\n&#8211; <a href=\"http:\/\/expect.nist.gov\/#unix\" target=\"_blank\">http:\/\/expect.nist.gov\/#unix<\/a> &#8211; \u043f\u0430\u043a\u0435\u0442 \u0437\u0430 \u0441\u0430\u043c\u043e\u0440\u044a\u0447\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0430\u043d\u0435<br \/>\n&#8211; <strong>apt-get install expect<\/strong> &#8211; \u0438\u043c\u0430 \u0433\u043e \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u0442\u0430 \u043d\u0430 <a href=\"http:\/\/www.ubuntu.com\" target=\"_blank\">Ubuntu<\/a><\/p>\n<p>2) \u0421\u044a\u0437\u0434\u0430\u0432\u0430\u043c\u0435 \u0441\u0438 \u0441\u043b\u0435\u0434\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0435\u043d \u0444\u0430\u0439\u043b <strong>\/usr\/local\/bin\/ssh-server1<\/strong> \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u044a\u0434\u044a\u0440\u0436\u0430\u043d\u0438\u0435:<\/p>\n<p><strong><em>#!\/usr\/bin\/expect<br \/>\nspawn ssh user@hostname-of-server1.com<br \/>\nexpect &#8220;password:&#8221;<br \/>\nsend &#8220;moiataparola123\\n&#8221;<br \/>\ninteract<\/em><\/strong><\/p>\n<p>3) <strong>chmod +x \/usr\/local\/bin\/ssh-server1<\/strong><\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u0442\u0430\u0442\u0430 \u043f\u0440\u0438 \u0438\u0437\u043f\u044a\u043b\u043d\u0435\u043d\u0438\u0435\u0442\u043e \u043d\u0430 \u043d\u043e\u0432\u043e\u0441\u044a\u0437\u0434\u0430\u0434\u0435\u043d\u0430\u0442\u0430 &#8220;\u043a\u043e\u043c\u0430\u043d\u0434\u0430&#8221; \u0449\u0435 \u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043d\u0430 \u0442\u043e\u0437\u0438:<\/p>\n<p><strong>$ ssh-server1<br \/>\nspawn ssh user@hostname-of-server1.com<br \/>\nuser@hostname-of-server1.com&#8217;s password:<br \/>\nLinux server1 2.6.*-* ********************************<br \/>\nLast login: ********** from ****************<\/strong><\/p>\n<p>\u0421\u044a\u043e\u0442\u0432\u0435\u0442\u043d\u043e \u0432 <strong>\/usr\/local\/bin\/ <\/strong>\u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0438 \u0441\u044a\u0437\u0434\u0430\u0434\u0435\u0442\u0435 \u043a\u043e\u043b\u043a\u043e\u0442\u043e \u0441\u0430 \u0432\u0438 \u043d\u0443\u0436\u043d\u0438 \u0442\u0430\u043a\u0438\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0435 \u0437\u0430 \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u043d\u0438\u0442\u0435 \u0441\u044a\u0440\u0432\u044a\u0440\u0438 \u0438 \u0437\u0430\u0431\u0440\u0430\u0432\u044f\u0442\u0435 \u0437\u0430 \u0432\u044a\u0432\u0435\u0436\u0434\u0430\u043d\u0435 \u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u0438 \u0441 copy\/paste \u0438 \u043f\u0440\u043e\u0447\u0438\u0435. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041e\u0442 \u0434\u043e\u0441\u0442\u0430 \u0432\u0440\u0435\u043c\u0435 \u0441\u0435 \u043c\u044a\u0447\u0430 \u0441 copy\/paste \u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u0438\u0442\u0435 \u043a\u044a\u043c \u043f\u043e\u0432\u0435\u0447\u0435\u0442\u043e \u0441\u044a\u0440\u0432\u044a\u0440\u0438, \u043d\u0430 \u043a\u043e\u0438\u0442\u043e \u0441\u0435 \u043b\u043e\u0433\u0432\u0430\u043c \u043f\u043e\u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u0442\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u0430, \u0447\u0435 \u043d\u044f\u043c\u0430 \u043a\u0430\u043a \u0434\u0430 \u0431\u044a\u0434\u0430\u0442 \u0437\u0430\u043f\u043e\u043c\u043d\u0435\u043d\u0438 (-: \u0420\u0435\u0448\u0435\u043d\u0438\u0435\u0442\u043e, \u043a\u043e\u0435\u0442\u043e \u043e\u0442\u043a\u0440\u0438\u0445 \u0435 Expect, \u0430 \u0441\u0442\u044a\u043f\u043a\u0438\u0442\u0435 \u043f\u043e \u0441\u044a\u0437\u0434\u0430\u0432\u0430\u043d\u0435\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043d\u043e \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u043d\u0438 &#8220;\u043a\u043e\u043c\u0430\u043d\u0434\u0438&#8221; \u0437\u0430 &hellip; <a href=\"https:\/\/blog.peychev.net\/?p=397\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[336,337,335],"class_list":["post-397","post","type-post","status-publish","format-standard","hentry","category-it","tag-autologin","tag-expect","tag-ssh"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.peychev.net\/index.php?rest_route=\/wp\/v2\/posts\/397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.peychev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.peychev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.peychev.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.peychev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=397"}],"version-history":[{"count":6,"href":"https:\/\/blog.peychev.net\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":692,"href":"https:\/\/blog.peychev.net\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions\/692"}],"wp:attachment":[{"href":"https:\/\/blog.peychev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.peychev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.peychev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}