{"id":9230,"date":"2020-09-10T09:10:09","date_gmt":"2020-09-10T06:10:09","guid":{"rendered":"https:\/\/unihost.com\/help\/?p=9230"},"modified":"2023-01-19T13:48:56","modified_gmt":"2023-01-19T10:48:56","slug":"how-to-add-user-to-sudoers","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/","title":{"rendered":"How to Add User to Sudoers"},"content":{"rendered":"<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">On Linux, the sudo command is used to grant root privileges to regular user accounts to perform administrative tasks. <!--more-->In this tutorial, we&#8217;ll walk through adding a user to the sudoers file for Linux distributions such as Ubuntu and CentOS.<\/span><\/p>\n<h4 lang=\"ru-RU\" style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Ubuntu<\/span><\/h4>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Let&#8217;s look at two ways to give a user sudo rights.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">The first is to add the user to the sudoers file. This file contains information that controls which users and groups are granted sudo privileges and the level of those privileges.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">The second option is to add the user to the sudo group specified in the sudoers file. By default, on Debian-based distributions such as Ubuntu and Linux Mint, members of the &#8220;sudo&#8221; group are given sudo access.<\/span><\/p>\n<h5><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Adding user to the sudoers file.<\/span><\/h5>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">The sudo rights of users and groups are defined in the \/etc\/sudoers file. Adding a user to this file allows you to provide custom command access and customize custom security policies.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">You can configure sudo user access by modifying the sudoers file or by creating a new configuration file in the \/etc\/sudoers.d directory. The files inside this directory are included in the sudoers file.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Always use visudo to edit the \/etc\/sudoers file. This command checks the file for syntax errors when it is saved. If there are errors, the file is not saved. If you open the file in a text editor, a syntax error can result in loss of sudo access.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Visudo usually uses vim to open the \/etc\/sudoers file.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Let&#8217;s say you want to allow the user to run sudo commands without prompting for a password. To do this, open the \/etc\/sudoers file as root:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">visudo<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Scroll down to the bottom of the file and add the following line:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\">username ALL=(ALL) NOPASSWD:ALL<\/span><\/span><\/pre>\n<p lang=\"ru-RU\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9247 aligncenter\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_140920_Rq0SaGYJ.png\" alt=\"How to Add User to Sudoers - Image 1\" width=\"926\" height=\"636\" \/ title=\"How to Add User to Sudoers - Image 1\"><\/p>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To save the file and exit the editor at the same time, press Esc to switch to normal mode, type :wq! and press Enter. Remember to change &#8220;username&#8221; to the name of the user you want to grant access to.<\/span><\/p>\n<p lang=\"ru-RU\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9249 aligncenter\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_140920_YkGnWDgO.png\" alt=\"How to Add User to Sudoers - Image 2\" width=\"506\" height=\"93\" \/ title=\"How to Add User to Sudoers - Image 2\"><\/p>\n<h5 lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Adding a user to a sudo group<\/span><\/h5>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">On Ubuntu, the easiest way to grant a user sudo privileges is to add the user to the &#8220;sudo&#8221; group. Users of this group can run any command as root using sudo and be prompted to authenticate with their password when using sudo.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">We assume that the user already exists.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To add a user to the group, run the command below as root or another sudo user. Make sure you change &#8220;username&#8221; to the name of the user you want to grant permissions to.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">usermod -aG sudo username<\/span><\/pre>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Granting sudo access using this method is sufficient for most use cases.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To verify that the user has sudo privileges, relog in and run whoami:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">sudo whoami<\/span><\/pre>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Y<\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">ou will be prompted for a password. If the user has sudo access, the command will print &#8220;root&#8221;. <\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">If you get the error &#8220;user is not in sudoers file&#8221;, it means that the user does not have sudo privileges.<\/span><\/p>\n<p lang=\"ru-RU\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9245 aligncenter\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_140920_KQXC3HJc.png\" alt=\"How to Add User to Sudoers - Image 3\" width=\"691\" height=\"630\" \/ title=\"How to Add User to Sudoers - Image 3\"><\/p>\n<h4 lang=\"ru-RU\" style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">CentOS<\/span><\/h4>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Log in with administrator credentials.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">By default, CentOS 7 has a user group called &#8220;wheel&#8221;. Members of the wheel group are automatically given sudo privileges. Adding a user to this group is a quick and easy way to grant the user sudo rights.<\/span><br \/><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Open the configuration file by entering the command<\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">visudo<\/span><\/pre>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Scroll through the config file until you see the following entry<\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\">## Allows people in group wheel to run all commands<\/span><\/span><br \/><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\"># %wheel ALL=(ALL) ALL<\/span><\/span><\/span><\/pre>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: inherit;\">If the second line starts with a # sign, it is disabled and marked as a comment. Just remove the # sign at the beginning of the second line so it looks like this<\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\">%wheel ALL=(ALL) ALL<\/span><\/span><\/span><\/pre>\n<p lang=\"ru-RU\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9243 aligncenter\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_140920_cyBNXAAf.png\" alt=\"How to Add User to Sudoers - Image 4\" width=\"878\" height=\"247\" \/ title=\"How to Add User to Sudoers - Image 4\"><\/p>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Then save the file and exit the editor.<\/span><\/p>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To add a user to the wheel group, use the command<\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\">usermod \u2013aG wheel username<\/span><\/span><\/span><\/pre>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Remember to change &#8220;username&#8221; to the name of the user you want to grant access to.<\/span><\/p>\n<p lang=\"ru-RU\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9251 aligncenter\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_200920_4tDsUv1B.png\" alt=\"How to Add User to Sudoers - Image 5\" width=\"544\" height=\"121\" \/ title=\"How to Add User to Sudoers - Image 5\"><\/p>\n<h5><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Adding user to the sudoers file.<\/span><\/h5>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Run the following command in terminal<\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\"><span style=\"font-family: Ubuntu; font-size: 12pt;\">visudo<\/span><\/span><\/span><\/span><\/pre>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">This will open the <em>\/etc \/sudoers<\/em> file in a text editor.<br \/>Scroll down to find the following section<\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\">## Allow root to run any commands anywhere<br \/><\/span><\/span><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\">root ALL=(ALL) ALL<\/span><\/span><\/pre>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Add the following text immediately after this entry<\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu;\"><span style=\"font-size: medium;\">username ALL=(ALL) ALL<\/span><\/span><\/pre>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Remember to change &#8220;username&#8221; to the name of the user you want to grant access to.<\/span><\/p>\n<p lang=\"ru-RU\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9255 aligncenter\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_200920_tqPbWw7q.png\" alt=\"How to Add User to Sudoers - Image 6\" width=\"961\" height=\"203\" \/ title=\"How to Add User to Sudoers - Image 6\"><\/p>\n<p lang=\"ru-RU\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To save the file and exit the editor at the same time, press Esc to switch to normal mode, type :wq! and press Enter.<\/span><\/p>\n<p lang=\"ru-RU\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9253 aligncenter\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_200920_PPGNLCZu.png\" alt=\"How to Add User to Sudoers - Image 7\" width=\"583\" height=\"106\" \/ title=\"How to Add User to Sudoers - Image 7\"><\/p>\n<p lang=\"ru-RU\">\u00a0<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Linux, the sudo command is used to grant root privileges to regular user accounts to perform administrative tasks.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[158],"tags":[641,640,642],"class_list":["post-9230","post","type-post","status-publish","format-standard","hentry","category-dedicated-servers","tag-root-2","tag-sudo","tag-sudoers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Add User to Sudoers - Unihost.FAQ<\/title>\n<meta name=\"description\" content=\"On Linux, the sudo command is used to grant root privileges to regular user accounts to perform administrative tasks.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Add User to Sudoers - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"On Linux, the sudo command is used to grant root privileges to regular user accounts to perform administrative tasks.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-10T06:10:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-19T10:48:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/unihost.com\/help\/wp-content\/uploads\/AGa_140920_Rq0SaGYJ.png\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"How to Add User to Sudoers\",\"datePublished\":\"2020-09-10T06:10:09+00:00\",\"dateModified\":\"2023-01-19T10:48:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/\"},\"wordCount\":704,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/unihost.com\/help\/wp-content\/uploads\/AGa_140920_Rq0SaGYJ.png\",\"keywords\":[\"root\",\"sudo\",\"sudoers\"],\"articleSection\":[\"02. Dedicated servers\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/\",\"url\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/\",\"name\":\"How to Add User to Sudoers - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/unihost.com\/help\/wp-content\/uploads\/AGa_140920_Rq0SaGYJ.png\",\"datePublished\":\"2020-09-10T06:10:09+00:00\",\"dateModified\":\"2023-01-19T10:48:56+00:00\",\"description\":\"On Linux, the sudo command is used to grant root privileges to regular user accounts to perform administrative tasks.\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#primaryimage\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_140920_Rq0SaGYJ.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?.\/AGa_140920_Rq0SaGYJ.png\",\"width\":926,\"height\":636},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Add User to Sudoers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/#website\",\"url\":\"https:\/\/unihost.com\/help\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Add User to Sudoers - Unihost.FAQ","description":"On Linux, the sudo command is used to grant root privileges to regular user accounts to perform administrative tasks.","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:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/","og_locale":"en_US","og_type":"article","og_title":"How to Add User to Sudoers - Unihost.FAQ","og_description":"On Linux, the sudo command is used to grant root privileges to regular user accounts to perform administrative tasks.","og_url":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2020-09-10T06:10:09+00:00","article_modified_time":"2023-01-19T10:48:56+00:00","og_image":[{"url":"https:\/\/unihost.com\/help\/wp-content\/uploads\/AGa_140920_Rq0SaGYJ.png","type":"","width":"","height":""}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"How to Add User to Sudoers","datePublished":"2020-09-10T06:10:09+00:00","dateModified":"2023-01-19T10:48:56+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/"},"wordCount":704,"publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"image":{"@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#primaryimage"},"thumbnailUrl":"https:\/\/unihost.com\/help\/wp-content\/uploads\/AGa_140920_Rq0SaGYJ.png","keywords":["root","sudo","sudoers"],"articleSection":["02. Dedicated servers"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/","url":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/","name":"How to Add User to Sudoers - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#primaryimage"},"image":{"@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#primaryimage"},"thumbnailUrl":"https:\/\/unihost.com\/help\/wp-content\/uploads\/AGa_140920_Rq0SaGYJ.png","datePublished":"2020-09-10T06:10:09+00:00","dateModified":"2023-01-19T10:48:56+00:00","description":"On Linux, the sudo command is used to grant root privileges to regular user accounts to perform administrative tasks.","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#primaryimage","url":"https:\/\/unihost.com\/help\/minio.php?.\/AGa_140920_Rq0SaGYJ.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?.\/AGa_140920_Rq0SaGYJ.png","width":926,"height":636},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/how-to-add-user-to-sudoers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/"},{"@type":"ListItem","position":3,"name":"How to Add User to Sudoers"}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/#website","url":"https:\/\/unihost.com\/help\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/9230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/comments?post=9230"}],"version-history":[{"count":61,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/9230\/revisions"}],"predecessor-version":[{"id":11440,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/9230\/revisions\/11440"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/media?parent=9230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/categories?post=9230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/tags?post=9230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}