Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Assign a user sudo privs?

Hello community,

I have been informed and done some research that staying logged in as root is damaging or can cause damage to your system. This being said I have attempted to create a new user. However using this method k4linux.com/2015/09/kali-linux-20-tutorials-add-non-root-user.html I had no success. When I enter that command all that happens is I remain in terminal on the next line down as root@kali #

However somehow I did manage to create an account called " yourusername " however the problem is when I log into this account ( which works fine ) when I for example run " sudo user " and then enter my password. It informs me I do not have Sudo Privs and that this event has been reported. How is it possible to assign this account the correct privs?

Thank you,

Liam
edit /etc/sudoers

you should see 1 user that has sudo right already wich is root
copy and paste that line and replace root with your username
=============================================
Nothing yet
=============================================
Thank you very much. That's worked a treat. Ir's probably clear that I am still getting used to Linux. Sorry if the questions seem a little basic.
(May 4, 2017 06:10 AM)SSYN-UDP Wrote:  Thank you very much. That's worked a treat. Ir's probably clear that I am still getting used to Linux. Sorry if the questions seem a little basic.

Nah no problem we all gotta start somewhere right
=============================================
Nothing yet
=============================================
Just adding this for others to see if they ever have the same question, never edit your sudoers file directly with vi, nano or any other text editor, because if the syntax is wrong in your sudoers file, you will get a lot of problems logging in again for those users.

If you run
Code
sudo visudo
instead (no need on Kali as you are already root), and do your changes there before saving, it will always check if all syntax is correct before saving, hindering you in fucking it up :)
[Random signature]
(May 4, 2017 12:34 PM)Pillus Wrote:  Just adding this for others to see if they ever have the same question, never edit your sudoers file directly with vi, nano or any other text editor, because if the syntax is wrong in your sudoers file, you will get a lot of problems logging in again for those users.

If you run
Code
sudo visudo
instead (no need on Kali as you are already root), and do your changes there before saving, it will always check if all syntax is correct before saving, hindering you in fucking it up :)

that wouldnt be a problem in particullar since you could just delete the user or change what you did since it is 2 lines that you added
you could also just make a copy of the sudoers files beforehand

But still nice thinking
=============================================
Nothing yet
=============================================


Possibly Related Threads...
Thread / Author Replies Views Last Post
by FiendFeb 17, 2021 12:00 PM 8 238 Feb 17, 2021 12:00 PM
Last Post: Marxist
by skyte98Jan 8, 2017 09:45 AM 2 144 Jan 8, 2017 09:45 AM
Last Post: skyte98
[Ubuntu] by iCyberJan 1, 2016 01:32 PM 11 311 Jan 1, 2016 01:32 PM
Last Post: muttaqun