{"id":538,"date":"2016-08-25T20:54:36","date_gmt":"2016-08-25T17:54:36","guid":{"rendered":"https:\/\/community.virtono.com\/?p=538"},"modified":"2016-08-25T20:54:36","modified_gmt":"2016-08-25T17:54:36","slug":"how-to-setup-a-new-user-and-privileges-on-centos","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-setup-a-new-user-and-privileges-on-centos\/","title":{"rendered":"How To Setup A New User And Privileges on CentOS"},"content":{"rendered":"<p>More often than not, you are not the only one working on your server, sometime it may be a team, or a partner that needs to login to your server, or just someone you hired to help you out, its always better to create another user login for that person, its not mandatory, but is always useful, the guide below will help you to create a new user, and also set up the restrictions on that account as you see fit.<\/p>\n<p>So, click on the video down below to follow along, or go to the steps right below it.<\/p>\n<p><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"750\" height=\"422\" src=\"https:\/\/www.youtube.com\/embed\/f-tFtAzojvs?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/p>\n<p><strong>Step 1<\/strong>\u00a0\u2013\u00a0<strong>Create new user<\/strong>.<\/p>\n<p>This new user will be used for you to login to your server. Use command below to create new username:<\/p>\n<table width=\"605\">\n<tbody>\n<tr>\n<td>1<\/td>\n<td width=\"573\">\/usr\/sbin\/adduser newuser<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Note: *change \u201cnewuser\u201d above with your own new username. In this example I use my name \u201cshreyash\u201d.<\/p>\n<p>Then issue this command to setup password for that user:<\/p>\n<table width=\"605\">\n<tbody>\n<tr>\n<td>1<\/td>\n<td width=\"573\">passwd newuser<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Upon hitting Enter on your keyboard your server will ask you to type the password for that user.<\/p>\n<p><strong>Step 2<\/strong>\u00a0\u2013\u00a0<strong>Setup root privileges to that user<\/strong><\/p>\n<p>In this example I will create a clone of the root user, that is, another user who can work as a root user.<\/p>\n<p>To do that simply issue this command:<\/p>\n<table width=\"605\">\n<tbody>\n<tr>\n<td>1<\/td>\n<td width=\"573\">vi \/usr\/sbin\/visudo<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>then look for the line \/ section called:<\/p>\n<table width=\"605\">\n<tbody>\n<tr>\n<td>\n<p>1<\/p>\n<p>2<\/td>\n<td width=\"573\">\n<p># User privilege specification<\/p>\n<p>root\u00a0\u00a0\u00a0 ALL=(ALL)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ALL<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>or in different CentOS release it may also like this:<\/p>\n<table width=\"605\">\n<tbody>\n<tr>\n<td>\n<p>1<\/p>\n<p>2<\/td>\n<td width=\"573\">\n<p>## Allow root to run any commands anywhere<\/p>\n<p>root\u00a0\u00a0\u00a0 ALL=(ALL)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ALL<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Then add this line right after the root line:<\/p>\n<p>How to edit? Press \u201ci\u201d, to go into insert mode, then make the appropriate changes, press \u201cEsc\u201d to get out of insert mode, then write \u201c:wq\u201d and hit enter to write the changes and exit.<\/p>\n<p>## Allow root to run any commands anywhere<\/p>\n<p>root\u00a0\u00a0\u00a0\u00a0\u00a0 ALL=(ALL)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ALL<\/p>\n<p>newuser\u00a0\u00a0 ALL=(ALL)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ALL<\/p>\n<p>it should look like this:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>More often than not, you are not the only one working on your server, sometime it may be a team, or a partner that needs to login to your server, or just someone you hired to help you out, its always better to create another user login for that person,<\/p>\n","protected":false},"author":3,"featured_media":539,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[],"class_list":["post-538","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/Centos-logo-light.svg.png?fit=2000%2C675&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-8G","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1157,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/ssh-key-login\/","url_meta":{"origin":538,"position":0},"title":"SSH Key Login","author":"Shreyash Sharma","date":"October 24, 2017","format":false,"excerpt":"Note:\u00a0This article applies to older SSH versions (SSH version 1).\u00a0For the latest information on SSH key logins, see\u00a0OpenSSH Public Key Authentication under Ubuntu\u00a0. SSH Config for SSH Key customize On the remote server, the \/ Etc \/ ssh \/ sshd_config to be edited.\u00a0Change the following values: current: RSAAuthentification yes New:\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/public-key-auth-workflow.png?fit=632%2C696&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/public-key-auth-workflow.png?fit=632%2C696&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/public-key-auth-workflow.png?fit=632%2C696&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":450,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-setup-config-openvpn-on-centos-6-4\/","url_meta":{"origin":538,"position":1},"title":"How to Install, Setup, Config OpenVPN on CentOS 6.4 .","author":"Daniel Draga","date":"August 13, 2016","format":false,"excerpt":"A brief introduction to CentOS, or if you are a restless soul, just go straight to the process. CentOS stands for Community ENTerprise Operating System. CentOS is an Enterprise-class Linux Distribution derived from sources freely provided to the public by a prominent North American Enterprise Linux vendor.\u00a0 CentOS conforms fully\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/vpn.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/vpn.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/vpn.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/vpn.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/vpn.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3595,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/how-to-protect-your-server-against-brute-force-attacks\/","url_meta":{"origin":538,"position":2},"title":"How to Protect Your Server Against Brute Force Attacks","author":"George B.","date":"June 23, 2023","format":false,"excerpt":"Introduction Brute force attacks are one of the most common threats that server administrators face. This guide is designed to provide you with the knowledge and strategies you need to protect your server from brute force attacks. What is a Server Brute Force Attack A server brute force attack is\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Protect-Your-Server-Against-Brute-Force-Attacks.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Protect-Your-Server-Against-Brute-Force-Attacks.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Protect-Your-Server-Against-Brute-Force-Attacks.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2821,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-cpanel-whm-on-ubuntu-20-04\/","url_meta":{"origin":538,"position":3},"title":"How to Install cPanel\/WHM on Ubuntu 20.04","author":"George B.","date":"July 16, 2022","format":false,"excerpt":"Before the installation, we need to know if we meet the minimum requirements to install cPanel & WHM. Your hostname must meet the following requirements: Registered and fully-qualified domain name.Does not match any of your server\u2019s domains.Be a maximum of 60 characters in length.Resolve to a valid IPv4 or IPv6\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/maxresdefault.jpeg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/maxresdefault.jpeg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/maxresdefault.jpeg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/maxresdefault.jpeg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/maxresdefault.jpeg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3191,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-postfix-on-linux\/","url_meta":{"origin":538,"position":4},"title":"How to install Postfix on Linux","author":"George B.","date":"April 8, 2023","format":false,"excerpt":"Install Postfix on CentOS 7 To install Postfix on CentOS 7, follow these steps: Open a terminal or login to your server via SSH as a root user. Update your system packages by running the following command: yum update Install Postfix using the following command: yum install postfix Start the\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-install-Postfix-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-install-Postfix-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-install-Postfix-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2877,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-cwp-centos-web-panel-on-centos-8\/","url_meta":{"origin":538,"position":5},"title":"How to install CWP (CentOS Web Panel) on Centos 8","author":"George B.","date":"July 28, 2022","format":false,"excerpt":"What Is CWP? CentOS Web Panel (CWP) is a web hosting control panel. It's a no-cost alternative to cPanel. It has an easy-to-use interface and a variety of other features for beginners who want to set up and manage hosting servers. Using CWP is simple and convenient because you don't\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-21-at-16.19.14.png?fit=1057%2C704&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-21-at-16.19.14.png?fit=1057%2C704&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-21-at-16.19.14.png?fit=1057%2C704&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-21-at-16.19.14.png?fit=1057%2C704&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-21-at-16.19.14.png?fit=1057%2C704&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=538"}],"version-history":[{"count":1,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/538\/revisions"}],"predecessor-version":[{"id":540,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/538\/revisions\/540"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/539"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}