Score:0

Can't use root privileges

gm flag
Fra

I recently installed ubuntu on a virtual machine using VirtualBox and whenever i need to use a sudo command(any) i can't because my only user is not in the sudoer file. I tried using the sudo -i command or visudo but it always gives me no permission to use it. How then to I go about using root privileges?

NotTheDr01ds avatar
vn flag
The default user created during the installation *should* be in `sudoers` and be able to run all `sudo` commands. However, if somehow the user didn't get in there or was removed, see - [How do I reset a lost administrative password?](https://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password)
guiverc avatar
cn flag
You've not provided any product/release details (are you asking about Ubuntu Core? Ubuntu Desktop? or Ubuntu Server?) as the user created during most product installs is granted `sudo` rights. You've also not said if you altered the `sudoers` file, as any error/mistake introduced into that file is treated as the EOF (*end of file*) marker & subsequent lines are ignored (*that's why it has a special command to edit it; that command checks for errors prior to exist to avoid making the file ~empty thru careless error*)
waltinator avatar
it flag
Is your user a member of the `sudo` group? `id` will tell. If not, Boot to single user mode (to get `root`), then `adduser your_user sudo`. Then boot back to multiuser with `sudo shutdown -r now`. Login, and test with `id;sudo id`.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.