LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-11-2020, 05:58 PM   #16
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888

Quote:
Originally Posted by ondoho View Post
Disallow password login over ssh. Also disallow root ssh access completely, if that wasn't mentioned already.
I normally use "PermitRootLogin prohibit-password" so that other PC's in my local net can use ssh root (with key access) to access backup storage on my main machine.
That one has a E-sata docking station for backup disks and a SCSI interface to a tape changer drive. So when everything is made ready the previous evening I can go to sleep and the next morning the backups are ready (cron scripts do the work).
 
Old 01-11-2020, 07:33 PM   #17
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Original Poster
Rep: Reputation: 53
Thank you for the great replies!

Why was sudo created? What problem did it solve? Does it only make more than one root on a system and that is it plus it keeps the real roots password protected?
 
Old 01-11-2020, 11:28 PM   #18
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,303
Blog Entries: 3

Rep: Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720
Quote:
Originally Posted by theKbStockpiler View Post
Does it only make more than one root on a system and that is it plus it keeps the real roots password protected?
No. Please re-read post #6 above. If you need a long-form explanation get Michael W Lucas' book, sudo Mastery, 2nd edition or his online presentation, "sudo: You're Doing It Wrong".
 
Old 01-12-2020, 03:33 AM   #19
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,569
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
Quote:
Originally Posted by theKbStockpiler View Post
Why was sudo created? What problem did it solve?
It solves one problem common in offices: what happens when the sysadmin goes on leave?

She has a team of course, one or two people who know enough to manage the machine without her for a couple of weeks and deal with users' problems on a day-to-day basis. But she doesn't trust them to do really fundamental things like full system updates and in any case she can't give them her password, because once a second person knows a password, in principle everyone knows it!

So she gives them sudo rights to a range of commands that will allow them to keep the system ticking over smoothly while she's away but not allow them to do anything catastrophic. Because that's the thing about sudo: not only does it give root access without the root password but it can be used to give access to specific commands and not others.

I think it was Knoppix that first used sudo as a general go-to-root command that could be used for any purpose. Then Ubuntu popularised the idea for installed systems.
 
2 members found this post helpful.
Old 01-12-2020, 11:07 AM   #20
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,499

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
A brief history of 'sudo' at the link below. As you can see it pre-dates Ubuntu and Linux. Ubuntu documentation on the use of sudo on Ubuntu with the pros and cons is at the 2nd link below.

https://www.linux.com/tutorials/linu...oduction-sudo/

https://help.ubuntu.com/community/RootSudo
 
1 members found this post helpful.
Old 01-12-2020, 12:25 PM   #21
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by theKbStockpiler View Post
The actual reason I posted this question is because I don't use a long password for my personal login
Long passwords don't have to be a pain in the neck. See xkcd's "Password Strength" toon for one method of making memorable long passwords. Much better than the mainframe/supermini passwords we were assigned years ago that looked like modem line noise which guaranteed they'd be written down somewhere near each user's desk. (And security policy mandated that we get new ones every three months---right about the time you finally memorized the previous password.)

Quote:
... and Ubuntu will do anything if you put a sudo in front of the command.
I'm not an Ubuntu user but I have yet to encounter a system that disallowed "sudu /bin/bash" which lets you be root for as long as you wanted to. On openSUSE I'm at least required to enter root's password to do this (unless the issuer is in the 'wheel' group). I can only guess that, on a distribution using a password-less root account, that command lets you right in.

As for the SSH issue, check the contents of "/etc/securetty"... if that's used on Ubuntu. It's supposed to contain a list of places where 'root' is allowed to login directly. Usually this file lists all the virtual consoles ('tty1' through 'tty6'). On some systems, it would also contain 'console'.)

Cheers...
 
Old 01-12-2020, 04:40 PM   #22
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by rnturn View Post
I have yet to encounter a system that disallowed "sudu /bin/bash" which lets you be root for as long as you wanted to.
On my older machines sudo isn't even installed and anyway, it isn't configured by default in Slackware (which then a real root has to do).
On my working machine I do have it configured to do those "one command things" it isn't worthwhile becoming root for.

PS: the command sudo -i is much shorter and simpler then the one you mentioned, explicitly naming the shell (or others like sudo su). From the man page
Quote:
-i, --login
Run the shell specified by the target user's password database entry as a login shell. This means that login-specific resource files such as .profile, .bash_profile or .login will be read by the shell. If a command is specified, it is passed to the shell for execution via the shell's -c option. If no command is specified, an interactive shell is executed. sudo attempts to change to that user's home directory before running the shell. The command is run with an environment similar to the one a user would receive at log in.
BTW: you can disable this by denying that user access to the shell. Of course this is a bit difficult for the root user, so that's one of the reasons why using sudo for all commands (and destinarion user ID's) is not that good an idea.

Last edited by ehartman; 01-12-2020 at 04:41 PM.
 
Old 01-13-2020, 06:03 AM   #23
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,569
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
Quote:
Originally Posted by rnturn View Post
Long passwords don't have to be a pain in the neck. See xkcd's "Password Strength" toon for one method of making memorable long passwords. Much better than the mainframe/supermini passwords we were assigned years ago that looked like modem line noise which guaranteed they'd be written down somewhere near each user's desk. (And security policy mandated that we get new ones every three months---right about the time you finally memorized the previous password.)
There's a well-known principle here that probably has a name, but I don't know what it is: any attempt to make things more secure will probably end up making them less secure. Someone I once worked with had worked for GCHQ during the war. There was one room in their building which was supposed to be kept locked and which could only be opened with a key that was kept in a locked wall box. You checked out the key for that at the main desk. Of course what happened was that no one ever locked that door because it was such a pain to open it.
 
Old 01-13-2020, 06:42 PM   #24
friefl
LQ Newbie
 
Registered: Jan 2020
Location: Australia
Distribution: about to find out
Posts: 8

Rep: Reputation: Disabled
Quote:
Originally Posted by rnturn View Post
Long passwords don't have to be a pain in the neck. See xkcd's "Password Strength" toon for one method of making memorable long passwords. Much better than the mainframe/supermini passwords we were assigned years ago that looked like modem line noise which guaranteed they'd be written down somewhere near each user's desk. (And security policy mandated that we get new ones every three months---right about the time you finally memorized the previous password.).
It is also arguable that a home user should (if not using a password manager) generate complicated passwords then write them down on a piece of paper and stick it in their desk drawer. When was the last time someone broke into your house, and then inspected and stole some paper? I think it at least as important that one never re-use a password; although I am drifting off topic here.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sudo to user other than root but do not allow sudo to root Westmoreland Linux - Security 4 07-13-2022 01:09 PM
In shell script how can i change the user using sudo -s and it asking password. So in script how to password sopanlavhale Linux - Newbie 5 06-14-2018 12:03 PM
Question about the sudo command, specifically how to have sudo act as if user is root slacker_ Linux - Newbie 17 09-22-2013 03:48 PM
[SOLVED] sudo password different from non-sudo password edrom Linux - Newbie 2 04-20-2012 03:00 PM
sudo password not same as root password - ubuntu 11.04. hence can't access partitions daudiam Linux - Newbie 1 09-03-2011 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration