LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-04-2023, 04:04 AM   #16
manchot
Member
 
Registered: May 2023
Posts: 32

Rep: Reputation: Disabled

My principles are simple: Give the least privilege to accounts. Make the bad guys work for every toehold they get on your system. To that end, I do the following:

Root: Disabled. Use sudo. Sometimes you do not have the option to leave root disabled.

Admin Account: Usually created at installation time if you do not provide a root password. It depends on the distro, etc. The username for this account is never "admin" or "administrator" or anything guessable. If you have multiple administrators, do not let them share this account. Give each one their own, so that there is accountability for actions performed on the system. The admin account is used for system updates, maintenance, and backups; configuration changes; software installations, etc.

Unprivileged User Account: This is the account where the work gets done. Documents, media editing and creation, email, web browsing, messaging, etc. If you EVER see a prompt for the admin password when you are in this account, do not enter it. Ask yourself why it appeared. If necessary, login using the admin account and fix the issue there. Sure it is an extra step that annoys impatient people, but it keeps the two separate roles separate. You asked.

Backup Admin Account: On some systems, I keep a separate backup admin account. If something happens to the primary admin account, this account exists for emergencies, but is not normally used. I usually give it the same name as the admin account, with an "x" "y" or "z" prefix so that it ends up at the bottom of lists, out of the way. It sits there, dormant, just in case. In the last 20 years or so, I would guess that I have used it twice. Maybe.

Servers:
Unprivileged Remote Access Account: This is the only account that can login remotely (via SSH) on servers. It has no privileges and no files and nothing gets done here, except su to the working account. Set SSH to public key authentication only, no root login, and AllowUsers to this account. I switch SSH away from port 22. The choice of well-known port (lower than 1024) or a random high port is a risk/value judgement. The port change is "security by obscurity" (no real security) and is more about eliminating the noise in log files, etc.

This arrangement means that if I want to do administrator work on servers, I must connect to the unprivileged remote access account, then su to the unprivileged user account, and finally su to the admin account to do that work. In the admin account, "sudo" is needed for many actions. (Do I use sudo -s or -i? Sure, if I have lots of consecutive sudo commands to type. Otherwise, no.)

I can read your mind - "What a pain in the @#$@1!@#!!!! ") Well, yeah. I get it. Not your thing? Okay. I am not forcing you to do anything. Don't shoot the messenger.

Attackers may be forced to perform the same actions through privilege escalation, and they do not know the long, strong, random passwords that you generated for those accounts. (Yes, I know that sometimes they "pwn" your system in one privilege escalation straight to root.) You must decide for yourself if the inconvenience is worth the benefits. Honestly, I think it is more about annoyance and staying disciplined that upsets others rather than time/efficiency issues. I have been following this practice for many decades and it hasn't slowed me down much. It works for me. Some of the same people who complain about inconvenience and inefficiency will spend hours and hours customizing their desktops while my work was turned in a long time ago. :-(
 
1 members found this post helpful.
Old 07-04-2023, 04:17 AM   #17
manchot
Member
 
Registered: May 2023
Posts: 32

Rep: Reputation: Disabled
P.S.:
I always create accounts in the same order. This has been useful with family member accounts on family computers. Personal laptops have placeholder accounts for everyone in the family, even though only one account is typically used by the owner. Because I create accounts in the same order every time, a given person's account always has the same userID and groupID on every system. It made file copying and sharing between computers easier sometimes. I am pleased that I thought of it.

Last edited by manchot; 07-04-2023 at 04:19 AM.
 
Old 07-04-2023, 08:54 AM   #18
will41
Member
 
Registered: Jul 2020
Posts: 76

Original Poster
Rep: Reputation: Disabled
Thanks for the help. I think I've got it now.
 
  


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
LXer: The Differences between Su, Sudo Su, Sudo -s and Sudo -i LXer Syndicated Linux News 0 09-15-2022 07:47 PM
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
sys admin vs network admin sulekha Linux - General 5 01-11-2009 05:03 AM
2K admin now RHEL4 admin (I have some questions) wilsryan Red Hat 5 01-30-2006 12:18 PM
User admin and N/w admin on Gnome hangs ssrini *BSD 2 07-28-2005 07:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:49 PM.

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