Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
08-23-2015, 03:44 PM
|
#1
|
Member
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549
Rep:
|
root commands without sudo?
hi group,
I get frustrated by the need for root access on common commands like: mount
umount
gparted
apt-get
yum
etc
I currently use .alias file to provide the sudo prefix to these commands. I have my sudoers file set up with NOPASSWD.
My question is, is there an easier way other than an entry for each command in the .alias file? I get so frustrated that I often run as root which is not wise. Can I set up 'CTRL-Enter' to prefix the sudo?
Thanks for your time.
|
|
|
08-23-2015, 03:56 PM
|
#2
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Even if there is a way to do this, I wouldn't suggest it, and I would suggest removing the alias as well. The need to preface a command with sudo or perform it as root is very helpful as a reminder that you can royally screw up your system if you use that tool the wrong way. That's WHY you need root permissions in order to run it in the first place. Making root-level commands easier to use without thinking about it also has the side effect of making the user less careful/responsible with those tools.
Last edited by suicidaleggroll; 08-23-2015 at 03:57 PM.
|
|
|
08-23-2015, 04:04 PM
|
#3
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,700
|
unfortunately you are using ubuntu
there is NO root account any more so you really can not login as root
as i do with Debian8
Code:
su -
---- type in the ROOT!!!!! password when asked ----
apt-get update
apt-get upgrade
" su - " is a shortcut for " su -l root "
???
yum
???
How are you using yum on a debian bassed OS
yum is a redhat package manager
"su " and "su - " and "sudo" are the normal ways to become root
but the os has to have a root user and not the first non root user being given root power
user 500 or 1000 and not user 501 and 1001
Last edited by John VV; 08-23-2015 at 04:08 PM.
|
|
|
08-23-2015, 04:09 PM
|
#4
|
LQ Veteran
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,862
|
I used to set root password in Xubuntu. Then either su into root at Xterminal or alt-ctl-F1 and log in as root.
edit: The reason: with sudo, some commands permission denied.
Last edited by colorpurple21859; 08-23-2015 at 04:17 PM.
|
|
|
08-23-2015, 04:47 PM
|
#5
|
Senior Member
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187
|
Quote:
Originally Posted by John VV
How are you using yum on a debian bassed OS
yum is a redhat package manager
|
https://packages.debian.org/jessie/yum
Strange but true...
|
|
|
08-23-2015, 08:16 PM
|
#6
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,985
|
There is a root account in Ubuntu. Ubuntu hides it and gives it a random password.
colorpurple21859's suggestion should work just fine. Then you can use su to become root in a terminal, do your root stuff, then exit out of su.
Frankly, I find Ubuntu's weird sudo fetish annoying.
|
|
|
08-23-2015, 08:37 PM
|
#7
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,827
|
Even without setting a root password, "sudo -i" with your own password gives you a perfectly good interactive root shell.
|
|
1 members found this post helpful.
|
08-23-2015, 10:20 PM
|
#8
|
Senior Member
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802
Rep: 
|
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...
|
|
|
08-24-2015, 10:58 AM
|
#9
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by JaseP
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.
|
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. It IS a bad idea, and it's something Ubuntu forces you into with, as frankbell so elequently put it, their weird sudo fetish.
And to top it all off, if you post how to disable this asinine policy, re-enable the real root account, and strip your user of its unlimited sudo access, you'll be banned from the Ubuntu support forums. Just one of the many reasons I refuse to use Ubuntu.
Last edited by suicidaleggroll; 08-24-2015 at 11:00 AM.
|
|
1 members found this post helpful.
|
08-24-2015, 11:42 AM
|
#10
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
You can "sudo -s" to be root for a time.
You could also "sudo passwd -d root && sudo passwd root && su"
to get a normal root in ubuntu, but I wouldn't recommend it. As I haven't a clue of how to UNDO that. And there's probably reasons why ubuntu took the effort to do what they do.
I suppose you could modify the keymap and have a key that types "sudo " when you hit it. But sudo -s is okay for me as I normally have multiple xterms open and one is basically always root. Just be mindful of physical security when operating like that. And make the root xterm unique with different color schemes and/or $PS1 attributes that are more noticeable than $ vs. #.
|
|
|
08-24-2015, 12:03 PM
|
#11
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,827
|
"sudo -s" gives you an environment like you get from "su", while "sudo -i" gives an environment like "su -".
|
|
1 members found this post helpful.
|
08-24-2015, 12:31 PM
|
#12
|
Member
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 997
Rep: 
|
Quote:
Originally Posted by MrUmunhum
hi group,
I get frustrated by the need for root access on common commands like: mount
umount
gparted
apt-get
yum
etc
|
Hi, mount and umount could be solved by addin the 'user' option to the desired mount points in fstab.
As for running as root : you'll burn yourself quite a few times, I know I did...
S.
|
|
|
08-24-2015, 03:06 PM
|
#13
|
Senior Member
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,207
|
Quote:
Originally Posted by Shadow_7
You can "sudo -s" to be root for a time.
You could also "sudo passwd -d root && sudo passwd root && su"
to get a normal root in ubuntu, but I wouldn't recommend it. As I haven't a clue of how to UNDO that. And there's probably reasons why ubuntu took the effort to do what they do.
|
As far as I know, giving root a password should make it a normal root account. I suppose to undo it, you would have to give root a password that can't be typed in.
I don't like sudo. If someone gets the user's password, they also have root access.
|
|
|
08-24-2015, 03:22 PM
|
#14
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,372
|
Quote:
Originally Posted by replica9000
I don't like sudo. If someone gets the user's password, they also have root access.
|
NOT if it is PROPERLY configured and used, as opposed to being wounded and left to bleed as is done by some distros.
Last edited by astrogeek; 08-24-2015 at 03:27 PM.
|
|
|
08-24-2015, 03:34 PM
|
#15
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
Quote:
Originally Posted by replica9000
As far as I know, giving root a password should make it a normal root account. I suppose to undo it, you would have to give root a password that can't be typed in.
I don't like sudo. If someone gets the user's password, they also have root access.
|
You can have more than one user. And you don't have to have easy passwords on any of them. The root password is sometimes easier to guess than users passwords. Since it's likely the same across multiple machines. Plus comes with a default password in many distros and embedded firmware. And you already know that the username is root.
|
|
|
All times are GMT -5. The time now is 04:05 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|