{"id":6063,"date":"2019-07-21T13:31:27","date_gmt":"2019-07-21T13:31:27","guid":{"rendered":"https:\/\/www.nemra-1.com\/?p=6063"},"modified":"2019-07-21T13:59:22","modified_gmt":"2019-07-21T13:59:22","slug":"how-to-create-a-sudo-admin-on-centos","status":"publish","type":"post","link":"https:\/\/www.nemra-1.com\/ar\/how-to-create-a-sudo-admin-on-centos.html","title":{"rendered":"How To Create a Sudo Admin on CentOS"},"content":{"rendered":"

The sudo<\/strong> command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create a new user with sudo access on CentOS<\/span><\/strong>, without having to modify your server’s sudoers<\/span> <\/strong>file. If you want to configure sudo<\/span> for an existing user, simply skip to step 3.<\/p>\n

Steps to Create a New Sudo User
\nLog in to your server as the root user.<\/p>\n

ssh root@server_ip_address<\/p><\/blockquote>\n

Use the adduser command to add a new user to your system.<\/p>\n

Be sure to replace username with the user that you want to create.<\/p>\n

adduser username
\nUse the passwd command to update the new user’s password.<\/p>\n

passwd username<\/p><\/blockquote>\n

Set and confirm the new user’s password at the prompt. A strong password is highly recommended!<\/p>\n

Set password prompts:
\nChanging password for user username.
\nNew password:
\nRetype new password:
\npasswd: all authentication tokens updated successfully.<\/p><\/blockquote>\n

Use the usermod command to add the user to the wheel group.<\/p>\n

usermod -aG wheel username
\nBy default, on CentOS, members of the wheel group have sudo privileges.<\/p><\/blockquote>\n

Test sudo access on new user account<\/p>\n

Use the su command to switch to the new user account.<\/p>\n

su – username<\/p><\/blockquote>\n

As the new user, verify that you can use sudo by prepending “sudo” to the command that you want to run with superuser privileges.<\/p>\n

sudo command_to_run<\/p><\/blockquote>\n

For example, you can list the contents of the \/root directory, which is normally only accessible to the root user.<\/p>\n

sudo ls -la \/root<\/p><\/blockquote>\n

The first time you use sudo in a session, you will be prompted for the password of the user account. Enter the password to proceed.<\/p>\n

Output:
\n[sudo] password for username:
\nIf your user is in the proper group and you entered the password correctly, the command that you issued with sudo should run with root privileges.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"

The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create…<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1233],"tags":[2135,2136,2134],"yoast_head":"\nHow To Create a Sudo Admin on CentOS<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.nemra-1.com\/ar\/how-to-create-a-sudo-admin-on-centos.html\/\" \/>\n<meta property=\"og:locale\" content=\"ar_AR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Create a Sudo Admin on CentOS\" \/>\n<meta property=\"og:description\" content=\"The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.nemra-1.com\/ar\/how-to-create-a-sudo-admin-on-centos.html\/\" \/>\n<meta property=\"og:site_name\" content=\"FUSE Software\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Ahmed.ElSheikh.17\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-21T13:31:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-21T13:59:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.nemra-1.com\/wp-content\/uploads\/2022\/10\/jitsi.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"730\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nemra1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ahmedElsheikh36\" \/>\n<meta name=\"twitter:site\" content=\"@ahmedElsheikh36\" \/>\n<meta name=\"twitter:label1\" content=\"\u0643\u064f\u062a\u0628 \u0628\u0648\u0627\u0633\u0637\u0629\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nemra1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u0648\u0642\u062a \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u064f\u0642\u062f\u0651\u0631\" \/>\n\t<meta name=\"twitter:data2\" content=\"\u062f\u0642\u064a\u0642\u062a\u0627\u0646\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html\"},\"author\":{\"name\":\"Nemra1\",\"@id\":\"https:\/\/www.nemra-1.com\/#\/schema\/person\/0af80329914b38b798124c6437c3fc1e\"},\"headline\":\"How To Create a Sudo Admin on CentOS\",\"datePublished\":\"2019-07-21T13:31:27+00:00\",\"dateModified\":\"2019-07-21T13:59:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html\"},\"wordCount\":320,\"publisher\":{\"@id\":\"https:\/\/www.nemra-1.com\/#organization\"},\"keywords\":[\"admin\",\"centos\",\"create\"],\"articleSection\":[\"\u062a\u0637\u0648\u064a\u0631 \u0627\u0644\u0645\u0648\u0627\u0642\u0639\"],\"inLanguage\":\"ar\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html\",\"url\":\"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html\",\"name\":\"How To Create a Sudo Admin on CentOS\",\"isPartOf\":{\"@id\":\"https:\/\/www.nemra-1.com\/#website\"},\"datePublished\":\"2019-07-21T13:31:27+00:00\",\"dateModified\":\"2019-07-21T13:59:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html#breadcrumb\"},\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.nemra-1.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Create a Sudo Admin on CentOS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.nemra-1.com\/#website\",\"url\":\"https:\/\/www.nemra-1.com\/\",\"name\":\"FUSE Software\",\"description\":\"The next generation of Chatting Networks\",\"publisher\":{\"@id\":\"https:\/\/www.nemra-1.com\/#organization\"},\"alternateName\":\"Chat Nemra1\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.nemra-1.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ar\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.nemra-1.com\/#organization\",\"name\":\"FUSE Software's\",\"url\":\"https:\/\/www.nemra-1.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\/\/www.nemra-1.com\/#\/schema\/logo\/image\/\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"FUSE Software's\"},\"image\":{\"@id\":\"https:\/\/www.nemra-1.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Ahmed.ElSheikh.17\",\"https:\/\/twitter.com\/ahmedElsheikh36\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.nemra-1.com\/#\/schema\/person\/0af80329914b38b798124c6437c3fc1e\",\"name\":\"Nemra1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\/\/www.nemra-1.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e51fbc893d9f4f4eac3c66a9cf883b66?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e51fbc893d9f4f4eac3c66a9cf883b66?s=96&d=mm&r=g\",\"caption\":\"Nemra1\"},\"description\":\"Nemra1 Adminstrator\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Create a Sudo Admin on CentOS","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.nemra-1.com\/ar\/how-to-create-a-sudo-admin-on-centos.html\/","og_locale":"ar_AR","og_type":"article","og_title":"How To Create a Sudo Admin on CentOS","og_description":"The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create...","og_url":"https:\/\/www.nemra-1.com\/ar\/how-to-create-a-sudo-admin-on-centos.html\/","og_site_name":"FUSE Software","article_publisher":"https:\/\/www.facebook.com\/Ahmed.ElSheikh.17","article_published_time":"2019-07-21T13:31:27+00:00","article_modified_time":"2019-07-21T13:59:22+00:00","og_image":[{"width":1024,"height":730,"url":"https:\/\/www.nemra-1.com\/wp-content\/uploads\/2022\/10\/jitsi.png","type":"image\/png"}],"author":"Nemra1","twitter_card":"summary_large_image","twitter_creator":"@ahmedElsheikh36","twitter_site":"@ahmedElsheikh36","twitter_misc":{"\u0643\u064f\u062a\u0628 \u0628\u0648\u0627\u0633\u0637\u0629":"Nemra1","\u0648\u0642\u062a \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u064f\u0642\u062f\u0651\u0631":"\u062f\u0642\u064a\u0642\u062a\u0627\u0646"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html#article","isPartOf":{"@id":"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html"},"author":{"name":"Nemra1","@id":"https:\/\/www.nemra-1.com\/#\/schema\/person\/0af80329914b38b798124c6437c3fc1e"},"headline":"How To Create a Sudo Admin on CentOS","datePublished":"2019-07-21T13:31:27+00:00","dateModified":"2019-07-21T13:59:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html"},"wordCount":320,"publisher":{"@id":"https:\/\/www.nemra-1.com\/#organization"},"keywords":["admin","centos","create"],"articleSection":["\u062a\u0637\u0648\u064a\u0631 \u0627\u0644\u0645\u0648\u0627\u0642\u0639"],"inLanguage":"ar"},{"@type":"WebPage","@id":"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html","url":"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html","name":"How To Create a Sudo Admin on CentOS","isPartOf":{"@id":"https:\/\/www.nemra-1.com\/#website"},"datePublished":"2019-07-21T13:31:27+00:00","dateModified":"2019-07-21T13:59:22+00:00","breadcrumb":{"@id":"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html#breadcrumb"},"inLanguage":"ar","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.nemra-1.com\/how-to-create-a-sudo-admin-on-centos.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.nemra-1.com\/"},{"@type":"ListItem","position":2,"name":"How To Create a Sudo Admin on CentOS"}]},{"@type":"WebSite","@id":"https:\/\/www.nemra-1.com\/#website","url":"https:\/\/www.nemra-1.com\/","name":"FUSE Software","description":"The next generation of Chatting Networks","publisher":{"@id":"https:\/\/www.nemra-1.com\/#organization"},"alternateName":"Chat Nemra1","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.nemra-1.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ar"},{"@type":"Organization","@id":"https:\/\/www.nemra-1.com\/#organization","name":"FUSE Software's","url":"https:\/\/www.nemra-1.com\/","logo":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/www.nemra-1.com\/#\/schema\/logo\/image\/","url":"","contentUrl":"","caption":"FUSE Software's"},"image":{"@id":"https:\/\/www.nemra-1.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Ahmed.ElSheikh.17","https:\/\/twitter.com\/ahmedElsheikh36"]},{"@type":"Person","@id":"https:\/\/www.nemra-1.com\/#\/schema\/person\/0af80329914b38b798124c6437c3fc1e","name":"Nemra1","image":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/www.nemra-1.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e51fbc893d9f4f4eac3c66a9cf883b66?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e51fbc893d9f4f4eac3c66a9cf883b66?s=96&d=mm&r=g","caption":"Nemra1"},"description":"Nemra1 Adminstrator"}]}},"_links":{"self":[{"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/posts\/6063"}],"collection":[{"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/comments?post=6063"}],"version-history":[{"count":0,"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/posts\/6063\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/media?parent=6063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/categories?post=6063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nemra-1.com\/ar\/wp-json\/wp\/v2\/tags?post=6063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}