{"id":1522,"date":"2014-11-19T21:21:27","date_gmt":"2014-11-19T19:21:27","guid":{"rendered":"https:\/\/www.hostking.host\/blog\/?p=1522"},"modified":"2014-11-19T21:21:27","modified_gmt":"2014-11-19T19:21:27","slug":"create-secondary-root-user-centos","status":"publish","type":"post","link":"https:\/\/www.hostking.host\/blog\/create-secondary-root-user-centos\/","title":{"rendered":"How to create a secondary root user on CentOS"},"content":{"rendered":"<div>Lets show you how to create a secondary root user.<\/div>\n<div><\/div>\n<div>To&nbsp;add a user and allow him the root privileges by editing the \/etc\/passwd file. Add a user as root<\/div>\n<div><\/div>\n<div>\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"6\">\n<tbody>\n<tr>\n<td class=\"alt2\"># useradd newuser<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>set a password for the new user<\/p>\n<div>\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"6\">\n<tbody>\n<tr>\n<td class=\"alt2\"># passwd newuser<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Once done, edit the &#8216;passwd&#8217; file<\/p>\n<div>\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"6\">\n<tbody>\n<tr>\n<td class=\"alt2\"># vi \/etc\/passwd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>set the UID:GUD bits to 0:0. Say for example the new user is &#8216;admin&#8217;, the line should look like<\/p>\n<div>\n<div class=\"smallfont\">Quote:<\/div>\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"6\">\n<tbody>\n<tr>\n<td class=\"alt2\">admin:x:0:0::\/home\/admin:\/sbin\/nologin<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><b>Note:<\/b> This method increases the security risk on the server and the best method is to add the new user in the sudoers list. You can also allow a list of commands for the new user beyond which he won&#8217;t be able to execute any commands as root.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lets show you how to create a secondary root user. To&nbsp;add a user and allow him the root privileges by editing the \/etc\/passwd file. Add a user as root #&hellip;<\/p>\n","protected":false},"author":2,"featured_media":1523,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[77,78,79],"class_list":["post-1522","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website-and-web-hosting","tag-administrator","tag-root","tag-root-user","entry"],"_links":{"self":[{"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/posts\/1522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/comments?post=1522"}],"version-history":[{"count":0,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/posts\/1522\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/media\/1523"}],"wp:attachment":[{"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/media?parent=1522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/categories?post=1522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/tags?post=1522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}