Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
52
rated 0 times [  52] [ 0]  / answers: 1 / hits: 147846  / 3 Years ago, thu, may 20, 2021, 5:40:33

I have installed Ubuntu using the GUI, giving myself a password and everything. I do not intricately remember the process. However, what worries me is that I don't know the following password:



$ su
Password: <the only password I've ever created on this machine>
su: Authentication failure


I just don't know what to do. I'm not in trouble, but I just want to know what's going on here. I can also lock myself out of directories:



starkers@ubuntu:~/Desktop$ mkdir foobs
starkers@ubuntu:~/Desktop$ sudo chmod 777 -R foobs
sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700
[sudo] password for starkers: <the only password I've ever created on this machine>
starkers@ubuntu:~/Desktop$ cd foobs
bash: cd: foobs: Permission denied


I'm just a bit confused. How can I lock myself out like this? I think sudo is the key command here. But I'm making the foobs file as open as it can possibly be via the chmod, so why does it lock me out?


More From » sudo

 Answers
6

By default, the superuser (root) account is disabled and doesn't have any password.
You can create one by running:



$ sudo passwd root


You will then be able to login as root by running su using this password.



As for chmod, the correct command would be:



$ chmod 777 -R foobs


You can also use:



$ sudo -i


to login as root using your password (without creating a root password as described above).


[#26166] Thursday, May 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rryble

Total Points: 489
Total Questions: 121
Total Answers: 119

Location: Marshall Islands
Member since Mon, May 31, 2021
3 Years ago
;