{"id":299,"date":"2016-12-26T22:59:18","date_gmt":"2016-12-26T22:59:18","guid":{"rendered":"http:\/\/elmig.debianpt.org\/blog\/?p=299"},"modified":"2016-12-26T22:59:18","modified_gmt":"2016-12-26T22:59:18","slug":"create-root-user-on-gitlab-when-you-cant-define-roots-password","status":"publish","type":"post","link":"https:\/\/elmig.debianpt.org\/blog\/?p=299","title":{"rendered":"Create root user on Gitlab, when you can&#8217;t define root&#8217;s password"},"content":{"rendered":"<p>When Gitlab it&#8217;s installed, the first access to the site allows you to define the password for the root (administrative) account.<\/p>\n<p>But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root.<\/p>\n<p>Googling, i found i was not the only one bitten by the bug\/error.<\/p>\n<p>I was decided to test it on a Debian VM so here it&#8217;s what I have did:<\/p>\n<ul>\n<li>Enter the rails console:<\/li>\n<\/ul>\n<pre>sudo -u gitlab -H bundle exec rails console production<\/pre>\n<ul>\n<li>Create root user on rails:<\/li>\n<\/ul>\n<p><code>user = User.create!(:email=&gt;'root@gitlab.home',:username=&gt;'root',:password=&gt;'x',\u00a0:password_confirmation=&gt;'x',\u00a0:name=&gt;'root')<\/code><\/p>\n<p><code>user = User.where(name: 'root').first<\/code><\/p>\n<p><code>user.update_attribute\u00a0:admin, true <\/code><\/p>\n<p><code>user.save<\/code><\/p>\n<ul>\n<li>Restart gitlab<\/li>\n<\/ul>\n<p><code>service gitlab restart<\/code><\/p>\n<p>And it&#8217;s done. Now login in Gitlab and you can access as root.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When Gitlab it&#8217;s installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[44],"tags":[45,46,47,42],"class_list":["post-299","post","type-post","status-publish","format-standard","hentry","category-sysadmin","tag-git","tag-gitlab","tag-rails","tag-sysadmin"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"When Gitlab it&#039;s installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"elmig\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/elmig.debianpt.org\/blog\/?p=299\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"elmig&#039;s blog - O meu post-it\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Create root user on Gitlab, when you can\u2019t define root\u2019s password - elmig&#039;s blog\" \/>\n\t\t<meta property=\"og:description\" content=\"When Gitlab it&#039;s installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/elmig.debianpt.org\/blog\/?p=299\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2016-12-26T22:59:18+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2016-12-26T22:59:18+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Create root user on Gitlab, when you can\u2019t define root\u2019s password - elmig&#039;s blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"When Gitlab it&#039;s installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#blogposting\",\"name\":\"Create root user on Gitlab, when you can\\u2019t define root\\u2019s password - elmig's blog\",\"headline\":\"Create root user on Gitlab, when you can&#8217;t define root&#8217;s password\",\"author\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?author=2#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ff56752a6b6f67f9ee535bba8020dcd21838d95934a1c141acff6fd45e2a5d7?s=96&d=robohash&r=pg\",\"width\":96,\"height\":96,\"caption\":\"elmig\"},\"datePublished\":\"2016-12-26T22:59:18+00:00\",\"dateModified\":\"2016-12-26T22:59:18+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#webpage\"},\"articleSection\":\"sysadmin, git, gitlab, rails, sysadmin\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?cat=44#listItem\",\"name\":\"sysadmin\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?cat=44#listItem\",\"position\":2,\"name\":\"sysadmin\",\"item\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?cat=44\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#listItem\",\"name\":\"Create root user on Gitlab, when you can&#8217;t define root&#8217;s password\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#listItem\",\"position\":3,\"name\":\"Create root user on Gitlab, when you can&#8217;t define root&#8217;s password\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?cat=44#listItem\",\"name\":\"sysadmin\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/#person\",\"name\":\"elmig\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ff56752a6b6f67f9ee535bba8020dcd21838d95934a1c141acff6fd45e2a5d7?s=96&d=robohash&r=pg\",\"width\":96,\"height\":96,\"caption\":\"elmig\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?author=2#author\",\"url\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?author=2\",\"name\":\"elmig\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ff56752a6b6f67f9ee535bba8020dcd21838d95934a1c141acff6fd45e2a5d7?s=96&d=robohash&r=pg\",\"width\":96,\"height\":96,\"caption\":\"elmig\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#webpage\",\"url\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299\",\"name\":\"Create root user on Gitlab, when you can\\u2019t define root\\u2019s password - elmig's blog\",\"description\":\"When Gitlab it's installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\\\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?p=299#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?author=2#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/?author=2#author\"},\"datePublished\":\"2016-12-26T22:59:18+00:00\",\"dateModified\":\"2016-12-26T22:59:18+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/\",\"name\":\"elmig's blog\",\"description\":\"O meu post-it\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/elmig.debianpt.org\\\/blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Create root user on Gitlab, when you can\u2019t define root\u2019s password - elmig's blog","description":"When Gitlab it's installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by","canonical_url":"https:\/\/elmig.debianpt.org\/blog\/?p=299","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#blogposting","name":"Create root user on Gitlab, when you can\u2019t define root\u2019s password - elmig's blog","headline":"Create root user on Gitlab, when you can&#8217;t define root&#8217;s password","author":{"@id":"https:\/\/elmig.debianpt.org\/blog\/?author=2#author"},"publisher":{"@id":"https:\/\/elmig.debianpt.org\/blog\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/9ff56752a6b6f67f9ee535bba8020dcd21838d95934a1c141acff6fd45e2a5d7?s=96&d=robohash&r=pg","width":96,"height":96,"caption":"elmig"},"datePublished":"2016-12-26T22:59:18+00:00","dateModified":"2016-12-26T22:59:18+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#webpage"},"isPartOf":{"@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#webpage"},"articleSection":"sysadmin, git, gitlab, rails, sysadmin"},{"@type":"BreadcrumbList","@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/elmig.debianpt.org\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/elmig.debianpt.org\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/elmig.debianpt.org\/blog\/?cat=44#listItem","name":"sysadmin"}},{"@type":"ListItem","@id":"https:\/\/elmig.debianpt.org\/blog\/?cat=44#listItem","position":2,"name":"sysadmin","item":"https:\/\/elmig.debianpt.org\/blog\/?cat=44","nextItem":{"@type":"ListItem","@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#listItem","name":"Create root user on Gitlab, when you can&#8217;t define root&#8217;s password"},"previousItem":{"@type":"ListItem","@id":"https:\/\/elmig.debianpt.org\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#listItem","position":3,"name":"Create root user on Gitlab, when you can&#8217;t define root&#8217;s password","previousItem":{"@type":"ListItem","@id":"https:\/\/elmig.debianpt.org\/blog\/?cat=44#listItem","name":"sysadmin"}}]},{"@type":"Person","@id":"https:\/\/elmig.debianpt.org\/blog\/#person","name":"elmig","image":{"@type":"ImageObject","@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/9ff56752a6b6f67f9ee535bba8020dcd21838d95934a1c141acff6fd45e2a5d7?s=96&d=robohash&r=pg","width":96,"height":96,"caption":"elmig"}},{"@type":"Person","@id":"https:\/\/elmig.debianpt.org\/blog\/?author=2#author","url":"https:\/\/elmig.debianpt.org\/blog\/?author=2","name":"elmig","image":{"@type":"ImageObject","@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/9ff56752a6b6f67f9ee535bba8020dcd21838d95934a1c141acff6fd45e2a5d7?s=96&d=robohash&r=pg","width":96,"height":96,"caption":"elmig"}},{"@type":"WebPage","@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#webpage","url":"https:\/\/elmig.debianpt.org\/blog\/?p=299","name":"Create root user on Gitlab, when you can\u2019t define root\u2019s password - elmig's blog","description":"When Gitlab it's installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/elmig.debianpt.org\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/elmig.debianpt.org\/blog\/?p=299#breadcrumblist"},"author":{"@id":"https:\/\/elmig.debianpt.org\/blog\/?author=2#author"},"creator":{"@id":"https:\/\/elmig.debianpt.org\/blog\/?author=2#author"},"datePublished":"2016-12-26T22:59:18+00:00","dateModified":"2016-12-26T22:59:18+00:00"},{"@type":"WebSite","@id":"https:\/\/elmig.debianpt.org\/blog\/#website","url":"https:\/\/elmig.debianpt.org\/blog\/","name":"elmig's blog","description":"O meu post-it","inLanguage":"en-US","publisher":{"@id":"https:\/\/elmig.debianpt.org\/blog\/#person"}}]},"og:locale":"en_US","og:site_name":"elmig's blog - O meu post-it","og:type":"article","og:title":"Create root user on Gitlab, when you can\u2019t define root\u2019s password - elmig's blog","og:description":"When Gitlab it's installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by","og:url":"https:\/\/elmig.debianpt.org\/blog\/?p=299","article:published_time":"2016-12-26T22:59:18+00:00","article:modified_time":"2016-12-26T22:59:18+00:00","twitter:card":"summary_large_image","twitter:title":"Create root user on Gitlab, when you can\u2019t define root\u2019s password - elmig's blog","twitter:description":"When Gitlab it's installed, the first access to the site allows you to define the password for the root (administrative) account. But due to a bug\/error when I installed it on Debian testing (Stretch) i always git the standard registration box, not for root. Googling, i found i was not the only one bitten by"},"aioseo_meta_data":{"post_id":"299","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-09-09 21:25:39","updated":"2025-06-04 18:25:39","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/elmig.debianpt.org\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/elmig.debianpt.org\/blog\/?cat=44\" title=\"sysadmin\">sysadmin<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCreate root user on Gitlab, when you can\u2019t define root\u2019s password\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/elmig.debianpt.org\/blog\/"},{"label":"sysadmin","link":"https:\/\/elmig.debianpt.org\/blog\/?cat=44"},{"label":"Create root user on Gitlab, when you can&#8217;t define root&#8217;s password","link":"https:\/\/elmig.debianpt.org\/blog\/?p=299"}],"_links":{"self":[{"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299"}],"version-history":[{"count":2,"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/299\/revisions"}],"predecessor-version":[{"id":301,"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/299\/revisions\/301"}],"wp:attachment":[{"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elmig.debianpt.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}