{"id":1606,"date":"2022-12-08T01:30:00","date_gmt":"2022-12-08T01:30:00","guid":{"rendered":"https:\/\/myvlcsys.com\/?p=1606"},"modified":"2023-06-01T18:30:49","modified_gmt":"2023-06-01T18:30:49","slug":"cambiar-el-hostname-usando-hostnamectl","status":"publish","type":"post","link":"https:\/\/myvlcsys.com\/?p=1606","title":{"rendered":"LINUX: Cambiar el hostname usando hostnamectl"},"content":{"rendered":"\n<p>Hola, hoy vamos a mostrar como cambiar el hostname  desde la terminal, en nuestro caso usaremos SSH para acceder a nuestro Servidor Linux Debian que hemos montado en nuestro laboratorio de pruebas. <br>Con el comando hostnamectl nos motrar\u00e1 toda la informaci\u00f3n del sistema, como mostramos en la siguiente imagen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img fetchpriority=\"high\" decoding=\"async\" width=\"693\" height=\"349\" src=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-1.png\" alt=\"\" class=\"wp-image-1607\" srcset=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-1.png 693w, https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-1-300x151.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p>En el resultado podemos observar que el nombre que tiene nuestra m\u00e1quina es el que corresponde al campo <mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">Static hostname : portatil-debian<\/mark>. Nos indica por el atributo Static que es un nombre permanente.<\/p>\n\n\n\n<p>Para realizar el cambio de hostname ejecutaremos en la terminal el comando <mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">hostnamectl set-hostname \u00abnombre_pc_deseado\u00bb<\/mark>, en nuestro caso ser\u00eda el siguiente:<\/p>\n\n\n\n<p><mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\"> hostnamectl set-hostname lab-server<\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"693\" height=\"349\" src=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-2.png\" alt=\"\" class=\"wp-image-1609\" srcset=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-2.png 693w, https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-2-300x151.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p>con los siguientes pasos<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"693\" height=\"349\" src=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-4.png\" alt=\"\" class=\"wp-image-1611\" srcset=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-4.png 693w, https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-4-300x151.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p>S\u00ed volvermos a ejecutar el comando hostnamectl podremos observar el cambio.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"693\" height=\"353\" src=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-5.png\" alt=\"\" class=\"wp-image-1612\" srcset=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-5.png 693w, https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-5-300x153.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p>Para finalizar realizaremos un reinicio de la m\u00e1quina con el <mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">shutdown -h<\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"693\" height=\"349\" src=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-6.png\" alt=\"\" class=\"wp-image-1613\" srcset=\"https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-6.png 693w, https:\/\/myvlcsys.com\/wp-content\/uploads\/2022\/12\/image-6-300x151.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hola, hoy vamos a mostrar como cambiar el hostname desde la terminal, en nuestro caso usaremos SSH para acceder a nuestro Servidor Linux Debian que hemos montado en nuestro laboratorio&hellip; <\/p>\n","protected":false},"author":3,"featured_media":2066,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[30,10,17],"tags":[31,26,25,27,24],"class_list":["post-1606","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-comandos","category-linux","category-sistemas","tag-comandos","tag-debian","tag-linux","tag-sistemas","tag-terminal"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/posts\/1606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1606"}],"version-history":[{"count":3,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/posts\/1606\/revisions"}],"predecessor-version":[{"id":2134,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/posts\/1606\/revisions\/2134"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/media\/2066"}],"wp:attachment":[{"href":"https:\/\/myvlcsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}