sKunKbad Posted September 24, 2014 Share Posted September 24, 2014 I've been doing a lot of studying of Linux lately. I enabled the root acount to do some work. When done, even if I logout, close the terminal, or reboot, I can still access the root account without supplying the root password. So what am I not understanding or what am I doing wrong? I don't really need to disable the root account, but this is just a learning experience, and I'm not understanding why I still have access. See below: # I needed to enable root access for something skunkbad:~$ sudo passwd root # I did what I needed to do skunkbad:~$ sudo -i root@ubuntu-Inspiron-3647:~# # I logout from root root@ubuntu-Inspiron-3647:~# logout # I disable the root access per instructions from many internet references skunkbad:~$ sudo passwd -dl root # Root access is still available, even if I close and reopen the terminal skunkbad:~$ sudo -i # I logout from root root@ubuntu-Inspiron-3647:~# logout # Trying to access root via su prompts for password, and old password is wrong skunkbad:~$ su Password: su: Authentication failure Quote Link to comment https://forums.phpfreaks.com/topic/291246-disabling-root-account-ubuntu-1404/ Share on other sites More sharing options...
jazzman1 Posted September 24, 2014 Share Posted September 24, 2014 (edited) When done, even if I logout, close the terminal, or reboot, I can still access the root account without supplying the root password. The -i (simulate initial login) option runs the shell specified by the password database entry of the target user as a login shell in that case sudo it will read the skunkbad's password. If you create another regular user account, for instance jazzman:password and grant it as root using the sudoers security policy, sudo will read his password when you're logged in to his current shell. As for the last question, running a su command, it seems that your "skunkbad" account is not permitted to use it. Su and Sudo are not the same. Edited September 24, 2014 by jazzman1 1 Quote Link to comment https://forums.phpfreaks.com/topic/291246-disabling-root-account-ubuntu-1404/#findComment-1491951 Share on other sites More sharing options...
sKunKbad Posted September 24, 2014 Author Share Posted September 24, 2014 The -i (simulate initial login) option runs the shell specified by the password database entry of the target user as a login shell in that case sudo it will read the skunkbad's password. If you create another regular user account, for instance jazzman:password and grant it as root using the sudoers security policy, sudo will read his password when you're logged in to his current shell. As for the last question, running a su command, it seems that your "skunkbad" account is not permitted to use it. Su and Sudo are not the same. Thanks for your response. It's odd to me that su and sudo -i would be different, and you are correct. I think that the differences are the PATH and some environment variables, according to this: https://help.ubuntu.com/community/RootSudo#Special_notes_on_sudo_and_shells When I specify a new password for root, I am able to use su. Is there a difference between "sudo su" and just "su"? Quote Link to comment https://forums.phpfreaks.com/topic/291246-disabling-root-account-ubuntu-1404/#findComment-1491971 Share on other sites More sharing options...
jazzman1 Posted September 24, 2014 Share Posted September 24, 2014 Hey sKunKbad, what I read this morning at Ubuntu documentation, that the root account password in Ubuntu is locked by default. I didn't know that, I am with RedHat based distros. Is there a difference between "sudo su" and just "su"? No. In both cases you will find yourself into the user's shell with root environment. I think, the alias of sudo su is just sudo -s. Quote Link to comment https://forums.phpfreaks.com/topic/291246-disabling-root-account-ubuntu-1404/#findComment-1491980 Share on other sites More sharing options...
sKunKbad Posted September 24, 2014 Author Share Posted September 24, 2014 jazzman1, there sure is a lot to learn. I've started reading the LPI Linux essentials exam preparation, thinking that I would just breeze through it, but that's certainly not the case: https://shop-download.linupfront.de/cc/lxes-en-manual-cc.pdf I've only worked on Ubuntu Desktop, Ubuntu Server, and CentOS Server. Right now I'm working as a web dev and design freelancer, and I stay busy, pay the bills, etc. I wouldn't say it's boring, but I'd like to be in a position to do something else. I was thinking to self-teach myself Linux system administration, but wow is there so much to learn. Are you self taught, or study at a school? Quote Link to comment https://forums.phpfreaks.com/topic/291246-disabling-root-account-ubuntu-1404/#findComment-1491987 Share on other sites More sharing options...
jazzman1 Posted September 24, 2014 Share Posted September 24, 2014 I learned programming and Unix systems many years ago purely out of my personal interest and have absolutely no formal education on them. If you want to teach yourself in linux system administration area. I'd advise to start learning on redhat servers and lately getting some redhat certificate. The previous programming experience will help a lot. 1 Quote Link to comment https://forums.phpfreaks.com/topic/291246-disabling-root-account-ubuntu-1404/#findComment-1491992 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.