Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
You can have more than one user. And you don't have to have easy passwords on any of them.
Root's password should always be as hard or harder to crack than any user password. If it's not, then the person who set it up did it wrong.
Quote:
Originally Posted by Shadow_7
The root password is sometimes easier to guess than users passwords.
Then the person who set up it up did it wrong.
Quote:
Originally Posted by Shadow_7
Since it's likely the same across multiple machines.
1) Then they're doing it wrong
2) And a user's password isn't?
Quote:
Originally Posted by Shadow_7
Plus comes with a default password in many distros
Since when? I have never seen that, and I would be extremely shocked if that was the case with any mainstream distro.
Quote:
Originally Posted by Shadow_7
And you already know that the username is root.
And since remote access is disabled for root by default on most distros (and should be immediately disabled by the admin on the rest of them), that doesn't really matter.
Quote:
Originally Posted by astrogeek
NOT if it is PROPERLY configured and used, as opposed to being wounded and left to bleed as is done by some distros.
Agreed, sudo can be a very useful tool when it's configured correctly. Ubuntu's approach is a joke.
sudo can be a very useful tool when it's configured correctly. Ubuntu's approach is a joke.
Agreed, and a somewhat cruel joke in that it ultimately cripples new user's ability to understand related concepts.
Hammer and nail analogies usually apply here, so let's contrive a new one...
Faced with confusion and awkward use of hammers by some users, the Ubuntu Kit Home Company decided to include pneumatic nailers with its kits instead. Unfortunately, they failed to properly document the new tool and its uses, so the most common complaint now goes something like this...
Quote:
" Dragging that hose around the jobsite was hazardous, so we have now removed it from our nailers.
It is not very clear what it was there for in the first place and removal does not seem to otherwise affect
operation of the nailer.
It is also much more difficult to hit the head of some nails with this tool and it does not seem to hold
up to frequent use as well as might be expected, the plastic parts being easily shattered within the
first few hits."
You're right, which is why Ubuntu's security policy is so ridiculous. It simply disables the real root account, and forces the first created user to become "root" instead. So now instead of having a real root account with a strong password that you can't log into graphically and can't ssh into (most distros disable root ssh access by default), you have an account that for all intents and purposes is root, yet it uses a traditionally weak user password AND it has full ssh functionality AND you log into it graphically every day.
I don't know where you got this from, but the last time I checked the first created user is in the "sudo" group. This is different from being root. And by default Ubuntu doesn't have openssh-server installed.
I don't know where you got this from, but the last time I checked the first created user is in the "sudo" group. This is different from being root.
Sure, it puts them in the sudo group, and if you look at /etc/sudoers you have this little gem:
Code:
# Allow members of group sudo to execute any command
sudo ALL=(ALL:ALL) ALL
The end result is that the first configured user (and anybody else placed in the sudo group) is granted full, unrestricted sudo access. This essentially turns that user account into root, because it's now allowed to do anything, without limits or restrictions, just like root can.
Quote:
Originally Posted by hortageno
And by default Ubuntu doesn't have openssh-server installed.
Most distros don't...the point was that once the ssh server is enabled, you now have essentially opened up root ssh access. Similarly once X is installed, you now have essentially opened up root GUI logins. Both of which are security problems, but Ubuntu forces you into it.
Last edited by suicidaleggroll; 08-24-2015 at 04:34 PM.
Sure, it puts them in the sudo group, and if you look at /etc/sudoers you have this little gem:
Code:
%sudo ALL=(ALL:ALL) ALL
The end result is that the first configured user (and anybody else placed in the sudo group) is granted full, unrestricted sudo access. This essentially turns that user account into root, because it's now allowed to do anything, without limits or restrictions, just like root.
...after typing in his password. This tiny detail makes the difference. He is NOT root. And if his password is weak, than THAT is the problem, not the fact that he is in sudoers.
...after typing in his password. This tiny detail makes the difference. He is NOT root. And if his password is weak, than THAT is the problem, not the fact that he is in sudoers.
Sigh...
We should call it the Ubuntu-sudo syndrome - a powerful mental block to all further understanding.
...after typing in his password. This tiny detail makes the difference. He is NOT root. And if his password is weak, than THAT is the problem, not the fact that he is in sudoers.
It IS a problem...security is all about barriers. Only open up what needs to be opened up and leave the rest closed off. If one barrier gets compromised, you have another right behind it that will limit the fallout. If you don't need ssh access, don't run ssh. If you do need ssh access, shut off root ssh access so script kiddies can't break in no matter how many passwords they guess. Even if they're able to break into a user account, the worst thing they can do is wipe out that account, they STILL need to break ANOTHER password in order to do any real damage. And no matter what you do, don't log in to the GUI as root, as it opens up the entire system to vulnerabilities.
Disabling the root account and giving a regular user account unlimited sudo access removes a huge barrier. It sacrifices security for convenience, and it's just one step away from Windows' laughable "are you sure you want to do that" security prompts.
Yes if the user uses an incredibly secure password that isn't re-used anywhere else, on any other machines or any online accounts, Ubuntu's approach is nearly as secure (but still not as secure) as the traditional root approach, but that's not realistic. Under realistic conditions, Ubuntu's approach is significantly less secure, and for what? What is the advantage? So the user can be lazy?
Even if they're able to break into a user account, the worst thing they can do is wipe out that account, they STILL need to break ANOTHER password in order to do any real damage.
Laptops are a bit of a different beast. It's not that sudo/root access doesn't matter on them, but there are other things that matter far more. Encrypted filesystems (or at least an encrypted container where you can put your sensitive documents), screen locking, etc. are much more important.
One trick I use regularly is to have scripts that reinvoke themselves via sudo if they're running as the wrong user for doing whatever it is they're meant to do.
e.g.
Code:
#!/bin/bash
#######################################################################
if [ "$( id -un )" != 'build' ]; then
exec sudo -u build "$(readlink -e "$0")" "$@"
fi
#######################################################################
### Do stuff here....
Obviously you still need to setup the sudoers rules to allow it, but you don't need to remember about prefixing them with sudo or specifying the correct user when you need to run them.
It is a security problem to have an "active" root account (specifically, one that can be logged onto graphically or remotely). It's a bad idea. I had issues with it too, when first transitioning from Mandrake (yes, Mandrake, before Mandriva, or any of the multitude of financial issues that distro faced)... But, I got used to it...
It is often useful to log into the system in GUI mode with root privileges. Particularly if there is to be some drag and drop activities and some selective deletes of files.
Most definitely, we do not use the web during this GUI session.
Sometimes though I need to do copy/paste and selective deletes of files. I have two choices.
sudo nautilus (which gives me root privileges with nautilus) along with terminal mode to do sudo su -i,
or
When the number of files is large, and the redistribution and ownership changes are required, root with GUI is best to use.
Well that surely stirred the pot. None of the responses answered my question. Even if I don't, I pretend to known what I am doing. So if I need to run a command as root, I do it. I am just trying to limit my error prone typing. When I call a command that needs root, I just hit command recall and prefix the command with sudo. Extra typing! I am the only one using my systems and don't need the extra security.
I guess what I am looking for is a way to prefix the last command line with sudo, like a keyboard shortcut, maybe "CTRL-Enter"?
I run Ubuntu, Fedora, Raspbian and would like universal fix.
I guess what I am looking for is a way to prefix the last command line with sudo, like a keyboard shortcut, maybe "CTRL-Enter"?
Add the following to ~/.inputrc:
Code:
# CTRL-P to get previous line, CTRL-A to move cursor to beginning
"\C-t": "\C-p\C-asudo "
That works with CTRL-t, I think CTRL-Enter can't be distinguished from Enter unless you do something special to your terminal. The above should work with any system using bash.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.