Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just installed Ubuntu on an old laptop and began the process of creating a user account for me and my girlfriend. Apparently Ubuntu doesn't come with a root password and ships instead with one standard account with sudo privileges.
I needed sudo privileges for my account as well so I edited /etc/group and added my username to the admin group. I fudged the line and left out the trailing colon that should be at the end of the entries - This has rendered the system useless when trying to do anything privileged because neither accounts have access to sudo anymore...lol.
Like yars said. For future use, if you use commands like usermod and visudo you don't have to edit the configuration files manually and can't mess up the system with typos.
Like yars said. For future use, if you use commands like usermod and visudo you don't have to edit the configuration files manually and can't mess up the system with typos.
+1. In addition, it is as far as I know, blocking access to files at the time of your experiences with them, that positively affects your safety.
Yah. You are right. By default, your account has not sufficient privilege to execute administrative command like that.
In first step we can activate root account by setting up a password:
Code:
sudo passwd root
If you cant do this, we can edit suduers file at "sudo vi /etc/sudoers" location:
Code:
<your_username> ALL=(ALL:ALL) ALL
after adding this line and save file,
again execute this:
Code:
sudo passwd root
after setting password up, you can use su to login as a root user to do what you would.
If not, Just add your username like up to sudoers file to be able execute any command(ALL) by sudo in your normal user.
Yah. You are right. By default, your account has not sufficient privilege to execute administrative command like that.
In first step we can activate root account by setting up a password:
Code:
sudo passwd root
If you cant do this, we can edit suduers file at "sudo vi /etc/sudoers" location:
Code:
<your_username> ALL=(ALL:ALL) ALL
If the user can't run sudo su the he will also not be able to run sudo vi, which is by the way not the recommended way to edit /etc/sudoers, the recommended way is to use visudo.
If the user can't run sudo su the he will also not be able to run sudo vi, which is by the way not the recommended way to edit /etc/sudoers, the recommended way is to use visudo.
TobiSGD, Thanks for your notation.
Yah, But sometimes just some of commands in sudoers file is restricted. I think one of them was passwd.
Ok, If Tobi is right and you dont have any access to sudo commands, use a live distro to boot up and edit sudoers file by that to add all commands to it like up.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.