{"id":2295,"date":"2019-10-04T15:11:35","date_gmt":"2019-10-04T13:11:35","guid":{"rendered":"http:\/\/les-fougs.com\/wordpress\/?p=2295"},"modified":"2022-05-05T09:05:27","modified_gmt":"2022-05-05T07:05:27","slug":"cle-dauthentification-entre-wctsrv0011-et-wctsrv0012","status":"publish","type":"post","link":"http:\/\/les-fougs.com\/wordpress\/2019\/10\/04\/cle-dauthentification-entre-wctsrv0011-et-wctsrv0012\/","title":{"rendered":"Cl\u00e9 d&rsquo;authentification entre wctsrv0134 et wctsrv0135"},"content":{"rendered":"\n<p class=\"has-bright-red-background-color has-background\">Laisser les valeurs par d\u00e9faut<\/p>\n\n\n\n<p>Sur wctsrv0134<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/root\/.ssh\/\n root@wctsrv0134:\/exploit\/scripts# <strong>ssh-keygen -t rsa<\/strong>\n Generating public\/private rsa key pair.\n Enter file in which to save the key (\/root\/.ssh\/id_rsa):  \n<strong>[entr\u00e9e]<\/strong>  <strong><em>LAISSER LA VALEUR PAR DEFAUT<\/em><\/strong>\n Enter passphrase (empty for no passphrase): <strong>[entr\u00e9e]<\/strong> \n Enter same passphrase again: <strong>[entr\u00e9e]<\/strong> \n Your identification has been saved in \/root\/.ssh\/id_rsa_vtom_main.\n Your public key has been saved in \/root\/.ssh\/id_rsa_vtom_main.pub.\n The key fingerprint is:\n SHA256:c29bbI+32cezIzf97+W75tGjinKSBOjpEW3W1rPRF68 root@wctsrv0011\n The key's randomart image is:\n +---[RSA 2048]----+\n |                 |\n |             .   |\n |    o . . .   o  |\n |   o = o + . . . |\n |  . = o S = . .  |\n |   +   . + . E  .|\n |  . . . .   o +++|\n |   .   + \u2026 =.X@|\n |        +. .o.*X^|\n +----[SHA256]-----+<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">root@wctsrv0134:\/exploit\/scripts# <strong>cd \/root\/.ssh\/<\/strong>\nroot@wctsrv0134:~\/.ssh# <strong>ll<\/strong>\ntotal 32\ndrwx------ 2 root root 4096 Oct  4 14:00 .\/\ndrwx------ 8 root root 4096 Oct  4 11:33 ..\/\n-rw------- 1 root root    0 Feb 12  2019 authorized_keys\n-rw------- 1 root root  668 Oct  4 11:39 id_dsa\n-rw------- 1 root root  605 Oct  4 11:39 id_dsa.pub\n-rw------- 1 root root 1675 Oct  4 14:00 id_rsa\n-rw-r----- 1 root root  397 Oct  4 14:00 id_rsa.pub\n-rw-r--r-- 1 root root 5096 May 15 13:31 known_hosts\nroot@wctsrv0134:~\/.ssh# <strong>cp id_rsa.pub \/home\/vtom\/.ssh\/<\/strong>\nroot@wctsrv0134:~\/.ssh#<strong> cd \/home\/vtom\/.ssh\/<\/strong>\nroot@wctsrv0134:\/home\/vtom\/.ssh#<strong> ll<\/strong>\ntotal 32\ndrwx------  2 vtom vtom 4096 Oct  4 14:19 .\/\ndrwxr-x--x 11 vtom vtom 4096 Sep 10 16:47 ..\/\nrw-------  1 vtom vtom  397 May 15 16:08 authorized_keys\n-rw-------  1 vtom vtom  668 Oct  4 14:02 id_dsa\n-rw-------  1 vtom vtom 1679 May 15 16:01 id_rsa\n-rw-r-----  1 vtom vtom  397 May 15 16:01 id_rsa.pub\n-rw-r-----  1 root root  397 Oct  4 14:19 id_rsa.pub\n-rw-r--r--  1 vtom vtom 3540 May 17 07:53 known_hosts<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">root@wctsrv0134:\/home\/vtom\/.ssh# <strong>chown vtom:vtom id_rsa.pub<\/strong>\nroot@wctsrv0134:\/home\/vtom\/.ssh# <strong>chmod 600 id_rsa.pub<\/strong>\nroot@wctsrv0134:\/home\/vtom\/.ssh# <strong>ll<\/strong>\ntotal 32\ndrwx------  2 vtom vtom 4096 Oct  4 14:19 .\/\ndrwxr-x--x 11 vtom vtom 4096 Sep 10 16:47 ..\/\n-rw-------  1 vtom vtom  397 May 15 16:08 authorized_keys\n-rw-------  1 vtom vtom  668 Oct  4 14:02 id_dsa\n-rw-------  1 vtom vtom 1679 May 15 16:01 id_rsa\n-rw-r-----  1 vtom vtom  397 May 15 16:01 id_rsa.pub\n-rw-------  1 vtom vtom  397 Oct  4 14:19 id_rsa.pub\n-rw-r--r--  1 vtom vtom 3540 May 17 07:53 known_hosts<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">root@wctsrv0134:~\/.ssh# <strong>su - vtom<\/strong>\nvtom@wctsrv0134:~\/.ssh# <strong>cd \/home\/vtom\/.ssh\/<\/strong>\nvtom@wctsrv0134~$ <strong>ssh-copy-id -f -i id_rsa.pub wctsrv0135<\/strong>\n \/usr\/bin\/ssh-copy-id: INFO: Source of key(s) to be installed: \".ssh\/id_rsa.pub\"\nWARNING:  Unauthorized access to this system is forbidden and will be\nprosecuted by law. By accessing this system, you agree that your actions\nmay be monitored if unauthorized usage is suspected.\n Ubuntu 18.04.1 LTS\n\n\nNumber of key(s) added: 1\n\nNow try logging into the machine, with:   \"ssh 'wctsrv0135'\"\nand check to make sure that only the key(s) you wanted were added.<\/pre>\n\n\n\n<p class=\"has-bright-red-color has-text-color\">vtom@wctsrv0134:~$<strong> ssh wctsrv0135<\/strong><br><\/p>\n\n\n\n<p>WARNING:  Unauthorized access to this system is forbidden and will be<br> prosecuted by law. By accessing this system, you agree that your actions<br> may be monitored if unauthorized usage is suspected.<br>  Ubuntu 18.04.1 LTS<br><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p> vtom@wctsrv0135:~$ <\/p>\n\n\n\n<p><br>  &#8212;&#8211;&gt; OK<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sources :  <a href=\"https:\/\/www.microlinux.fr\/cle-ssh\/\">https:\/\/www.microlinux.fr\/cle-ssh\/<\/a> <\/pre>\n\n\n\n<p>Copier le fichier  <strong> id_rsa.pub<\/strong> sur les autres serveurs pour une authentification sans pwd.<br><br>cd \/home\/vtom\/.ssh<br><strong>ssh-copy-id -f -i id_rsa.pub wctsrv0055<\/strong><br><strong>ssh-copy-id -f -i id_rsa.pub wctsrv0056 <br>ssh-copy-id -f -i id_rsa.pub wctsrv0060<\/strong><br>&#8230; etc&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laisser les valeurs par d\u00e9faut Sur wctsrv0134 cd \/root\/.ssh\/ root@wctsrv0134:\/exploit\/scripts# ssh-keygen -t rsa Generating public\/private rsa key pair. Enter file in which to save the key (\/root\/.ssh\/id_rsa): [entr\u00e9e] LAISSER LA VALEUR PAR DEFAUT Enter passphrase (empty for no passphrase): [entr\u00e9e] Enter same passphrase again: [entr\u00e9e] Your identification has been saved in \/root\/.ssh\/id_rsa_vtom_main. Your public key &hellip; <a href=\"http:\/\/les-fougs.com\/wordpress\/2019\/10\/04\/cle-dauthentification-entre-wctsrv0011-et-wctsrv0012\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Cl\u00e9 d&rsquo;authentification entre wctsrv0134 et wctsrv0135&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[51],"tags":[],"_links":{"self":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/2295"}],"collection":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2295"}],"version-history":[{"count":7,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/2295\/revisions"}],"predecessor-version":[{"id":2504,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/2295\/revisions\/2504"}],"wp:attachment":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2295"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}