October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk12 min

How to Secure a Linux Server With Multiple Users

A practical, distribution-aware guide to securing Linux servers shared by multiple users—covering individual accounts, narrow sudo rules, SSH and firewall hardening, revocation, recovery, and CIS auditing.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Secure a shared Linux server by giving every person a named account, assigning role-based groups, granting only the sudo commands they need, limiting SSH and firewall exposure, and continuously checking logs and configuration. Make one access change at a time, test it from a second session or console, and keep a recovery path open so a bad SSH rule cannot lock out every administrator.

What a secure multi-user server looks like

Security starts with attribution. Each operator should authenticate with an individual account, not a shared root or team login. Group membership should represent a job function, and sudo should provide temporary elevation while recording which user initiated an administrative command. This model lets you remove one person’s access without disrupting everyone else and makes investigations possible.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use several independent controls rather than relying on a single setting:

  • Named accounts and role-based groups identify people and define ordinary access.
  • Narrow sudo rules allow only the administrative commands a role requires.
  • SSH policy determines who may connect and which authentication methods are accepted.
  • A host firewall limits reachable network services.
  • Updates, service minimization, AppArmor or another mandatory access-control layer reduce the attack surface.
  • Authentication, sudo, and system-audit records show what happened and when.

Password status, SSH-key access, sudo membership, and network reachability are separate controls. Removing one does not automatically remove the others.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

1. Inventory access before changing anything

Record the current state before editing SSH, sudo, or firewall policy. You need to know how to restore the original configuration and how to reach the machine if a daemon refuses to start.

Build an access inventory

  • List local identities with getent passwd and review which accounts have interactive shells.
  • List groups and memberships with getent group; identify every group that grants administration, access to data, or access to devices.
  • Inspect each administrator’s effective sudo rights with sudo -l -U username.
  • Record listening sockets with ss -tulpn and map each port to a service and owner.
  • Find SSH public keys in users’ ~/.ssh/authorized_keys files and note who controls each key.
  • Save copies of /etc/ssh/sshd_config, any files in /etc/ssh/sshd_config.d/, /etc/sudoers, /etc/sudoers.d/, and the active firewall rules.

Keep a recovery path open

Do not make the first SSH or firewall change from your only remote session. Keep that session connected, open a second session for testing, and know how to use an out-of-band console supplied by your hosting provider or data center. Ubuntu warns that an invalid sshd configuration can stop the daemon from starting or lock out a remote administrator. A console or still-working session is the difference between correcting the file and requiring provider intervention.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Change one control at a time. Validate the syntax, test a new login as the affected user, and only then close the known-good session.

2. Give every person a named account

Create accounts with the right platform tools

On Debian- and Ubuntu-based systems, an administrator can create an interactive account with:

sudo adduser alice

On distributions that provide the lower-level useradd utility, create the home directory and login shell explicitly:

sudo useradd --create-home --shell /bin/bash alice
sudo passwd alice

Use the command style documented for your distribution. The important result is one account per person, a private home directory, and a recorded owner for every action. Never distribute one root password or one shared operator account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use groups to represent roles

Create groups around duties, not around individual people. For example:

sudo groupadd web-operators
sudo usermod --append --groups web-operators alice
sudo usermod --append --groups web-operators bob

Choose names that describe the authority granted by the group. Keep membership small, review it regularly, and remove a user from a group when the role ends:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
sudo gpasswd --delete alice web-operators

Group membership may not appear in an already-open shell. Ask the user to start a new login session before testing the change.

Remove stale and unnecessary identities

Disable an account before deleting it if you may need its files or audit history. Locking the password is one step:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo passwd --lock alice

For a complete departure, remove the account according to your distribution’s procedure and preserve records required by your retention policy. Also check scheduled jobs, file ownership, API tokens, SSH keys, and memberships in every privileged group. A deleted local account does not revoke a key that was copied to another account or a credential held by an external identity provider.

3. Grant sudo privileges narrowly

Understand what sudo provides

Sudo lets a user perform a specific administrative operation using their own password rather than sharing the root password. The initiating username can therefore be associated with the elevated command in authentication and sudo logs. Ubuntu describes this temporary elevation and accountability as a core part of secure user management.

Privilege should be explicit. Red Hat cautions that a rule such as ALL ALL=(ALL) ALL allows every user to run every command as every user on every host and creates serious risk.

Store role rules in a controlled drop-in

Keep local policy in files under /etc/sudoers.d/ rather than repeatedly editing the main file. Always use visudo, which checks syntax before installing the change:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo visudo -f /etc/sudoers.d/web-operators

Write the smallest rule that meets the job requirement. A role may need to restart one service, inspect its status, or read one log, but not obtain an unrestricted root shell.

Requirement Safer policy pattern Why it is safer
Restart one application %web-operators ALL=(root) /usr/bin/systemctl restart example.service The group can restart one named service, not arbitrary services.
Inspect service state %web-operators ALL=(root) /usr/bin/systemctl status example.service Read-only troubleshooting does not require broad administration.
Run a maintenance script Allow the fully qualified script path and, where practical, fixed arguments. Preventing arbitrary arguments limits unexpected behavior.
Full system administration Assign only to a small, named administrator group and review membership. Concentrates the highest-risk authority and preserves attribution.

Use absolute command paths, specify the target user where possible, and avoid wildcards that allow a user to substitute another executable. If a command can edit a configuration file, execute a shell, or invoke another program, treat it as equivalent to broad root access even when the command name looks narrow.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Verify and revoke sudo access

After editing a rule, test both an allowed and a denied action as the affected user:

sudo -l -U alice
sudo -u root /usr/bin/systemctl status example.service

Do not assume that removing a user from one group removes every privilege. Check direct entries, nested operational groups, and rules in all files under /etc/sudoers.d/. Re-run sudo -l -U username after each change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Harden SSH without locking yourself out

Prefer protected keys and add a second factor where appropriate

Key authentication removes the need to send a reusable account password over an SSH login exchange and is easier to tie to a particular operator or device. Protect each private key with a strong passphrase, keep it off shared machines, and remove it when the device or person is no longer trusted. Ubuntu also identifies two-factor authentication as an additional layer for SSH.

On the server, check ownership and permissions on the key path. A typical baseline is a user-owned ~/.ssh directory with mode 700 and an authorized_keys file with mode 600:

chmod 700 /home/alice/.ssh
chmod 600 /home/alice/.ssh/authorized_keys
chown -R alice:alice /home/alice/.ssh

Apply the commands as root or the account owner and adapt the path to the actual home directory.

Restrict SSH to an administration group

Create a group for people who are permitted to log in over SSH, add only current operators, and place an AllowGroups directive in the SSH server configuration. A common location is /etc/ssh/sshd_config, with drop-in files under /etc/ssh/sshd_config.d/ on many current systems:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
AllowGroups ssh-admins

Check the complete effective configuration and syntax before reloading. The service name differs by distribution; Ubuntu commonly uses ssh, while other systems use sshd:

sudo sshd -t
sudo systemctl reload ssh
sudo journalctl -fu ssh.service

If your system uses sshd.service, substitute that unit name. Keep the existing session open, start a new connection as a permitted user, and test a deliberately denied account before applying any further restriction.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Understand password locking versus SSH-key access

Locking a password does not remove a previously installed public key. Ubuntu explicitly warns that a user can still log in remotely with an authorized SSH key after the account password is locked. When revoking access, inspect and remove the user’s key entries from ~/.ssh/authorized_keys, remove the user from AllowGroups membership, and check any other accounts where the key may have been copied.

Only disable PasswordAuthentication after key-based login has been tested from a second session and you have a console recovery path. A policy that disables passwords before every administrator has a working key can lock out the entire team.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

5. Reduce network exposure with a host firewall

Start with deny-by-default on Ubuntu

Ubuntu’s default firewall frontend is ufw. Begin by allowing established administration access, then deny unsolicited inbound traffic and open only services the server actually provides:

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow from 203.0.113.0/24 to any port 22 proto tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verbose

The address range above is an example documentation network; replace it with the trusted administration network or omit the source restriction only when remote access genuinely must be available from anywhere. Do not open port 22 before confirming that your current source address is permitted. Add application ports one at a time, document their owners, and remove rules when services are retired.

Match firewall policy to real listeners

Compare the firewall with ss -tulpn. A port that is listening but not needed should be closed by disabling the service, not merely hidden behind an undocumented firewall exception. A required public service needs both a listener and an intentional firewall rule. On non-Ubuntu distributions, use the native firewall manager, such as a firewalld zone policy, but retain the same deny-by-default and least-exposure design.

After enabling or changing rules, test from an allowed network and a disallowed network. Confirm that existing administration remains possible before ending the original session.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

6. Patch the system and remove unnecessary services

Keep the operating system, SSH implementation, kernel, and exposed application daemons updated through the distribution’s supported update process. Security is weaker when an unused service remains installed, enabled, and reachable. Disable software that has no current purpose, then verify the listening-port inventory again.

Use AppArmor where the distribution supports it to constrain what a compromised process may read or execute. Mandatory access control complements, rather than replaces, account permissions, sudo policy, patching, and the firewall.

7. Choose local or centralized identity deliberately

Approach Best fit Operational considerations
Local accounts A small number of servers and operators Simple to deploy, but every account, group, key, and departure must be managed on each host.
Centralized identity with Kerberos or SSSD Organizations with many hosts or shared identities Central policy and offboarding scale better, but the server must retain a tested emergency access path if the identity service is unavailable.

Do not introduce central identity merely to avoid maintaining a handful of local users. Conversely, manually copying accounts and keys across many machines creates drift and makes timely revocation difficult. Whichever model you choose, retain individual identities and narrow role mappings; centralization is not a reason to use shared administrator credentials.

8. Audit activity and configuration continuously

Use authentication and sudo records

Review authentication failures, successful SSH sessions, sudo invocations, group changes, and service restarts. On systems using journald, follow SSH activity live with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo journalctl -fu ssh.service

Some distributions also write authentication events to files such as /var/log/auth.log or /var/log/secure. Keep timestamps synchronized, protect logs from ordinary users, and forward them to a separate log system when the server’s own disk cannot be treated as a trusted audit archive.

A log entry is useful only if it identifies the initiating account. Shared logins, copied private keys, and unrestricted root shells destroy that link, so fix the identity design rather than relying on more log volume.

Run a repeatable CIS-oriented check

Ubuntu’s USG utility can run a CIS Level 1 server audit and produce HTML and XML reports:

sudo usg audit cis_level1_server

Read the generated findings, document accepted exceptions, and tailor controls to the server’s purpose. A CIS profile is a baseline and a repeatable way to find drift, not proof that the host is secure or that every recommendation belongs in every environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

9. Handle onboarding, role changes, and departures

Onboard a new operator

  1. Create a named account and verify the home directory and shell.
  2. Enroll the person’s public key through a controlled channel; never email or paste a private key onto the server.
  3. Add the account only to the role groups required for the job.
  4. Grant command-scoped sudo in a dedicated file under /etc/sudoers.d/ and validate it with visudo.
  5. Add the account to the SSH-allowed group only after a second-session login test.
  6. Record the owner, approval, expiry or review date, and recovery contact.

Change a role

Remove obsolete group memberships before adding new ones, then recalculate effective sudo rights with sudo -l -U username. Review direct sudo entries and SSH keys as well as the obvious role group. Ask the operator to start a new session so stale group membership is not mistaken for current authorization.

Revoke access urgently

  1. Keep an administrator session open and identify the account, keys, groups, active sessions, and recent logins.
  2. Remove the account from SSH-allowed and privileged groups.
  3. Delete or disable its entries in every relevant authorized_keys file.
  4. Lock the local password if the account will remain for evidence or file ownership.
  5. Terminate active sessions according to your incident procedure and rotate any shared secrets the user could read.
  6. Review sudo and authentication logs for activity before and after the revocation.

These steps address local access; also revoke credentials held by centralized identity systems, automation agents, source-control deploy keys, and cloud or hosting consoles.

10. Common failure modes and recovery

Symptom Likely cause Recovery
The administrator cannot connect after an SSH edit. AllowGroups, address restrictions, authentication settings, or a syntax error excluded the account. Use the still-open session or console, run sshd -t, restore the last known-good file, reload the service, and test from a second session.
A locked user still logs in. An authorized public key remains installed, or another account contains the same key. Remove the key, review all copies, check SSH group membership, and inspect active sessions.
A user can run more than intended with sudo. A broad group rule, wildcard, direct entry, or command that launches a shell grants indirect root access. Run sudo -l -U username, inspect every sudoers file with visudo, replace broad rules with fixed commands and arguments, then retest denied operations.
UFW blocks a legitimate service or administrator. The needed port or source network was not allowed before enabling the deny policy. Use the console or existing session, add the narrowly scoped rule, verify with ufw status verbose, and test externally.
Audit records cannot identify the operator. People share an account, use a shared key, or obtain unrestricted root shells. Issue individual accounts and keys, remove shared credentials, narrow sudo, and preserve authentication and sudo logs.

11. A maintenance cadence that prevents drift

At every access change

  • Record the requester, approver, account, groups, sudo rule, SSH key fingerprint, and expiry or review date.
  • Validate configuration syntax before reload.
  • Test an allowed login and a denied login from separate sessions.
  • Confirm that firewall exposure still matches listening services.

On a regular review schedule

  • Reconcile accounts and privileged groups with the current staff and contractors.
  • Remove stale keys and inspect unexpected changes under /etc/sudoers.d/ and SSH configuration directories.
  • Review authentication and sudo logs for unusual source addresses, failed-login bursts, and commands outside a user’s role.
  • Apply supported updates and reassess enabled services and listening ports.
  • Run the USG CIS Level 1 audit where it fits the environment, track exceptions, and compare reports over time.
  • Rehearse console recovery and restoration of a known-good SSH configuration.

This layered process keeps one person’s departure, one compromised key, or one configuration error from becoming a server-wide compromise or an irreversible lockout.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.