Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Essential Linux Commands

You're reading from   Essential Linux Commands 100 Linux commands every system administrator should know

Arrow left icon
Product type Paperback
Published in Nov 2023
Publisher Packt
ISBN-13 9781803239033
Length 250 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Paul Olushile Paul Olushile
Author Profile Icon Paul Olushile
Paul Olushile
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Part 1:Server Installations and Management Commands
2. Chapter 1: Getting a CentOS Server Up and Running FREE CHAPTER 3. Chapter 2: Linux User and Group Commands 4. Chapter 3: File Compression and Archival Commands 5. Part 2:Frequently Used Commands – Part 1
6. Chapter 4: Format and Disk Space Commands 7. Chapter 5: Linux Permissions Commands 8. Chapter 6: Filesystem Mount and Manipulation Commands 9. Part 3:Frequently Used Commands – Part 2
10. Chapter 7: File Content and Conversion Commands 11. Chapter 8: Linux SWAP Commands 12. Chapter 9: Linux Monitoring and Debugging Commands 13. Chapter 10: Linux IPTABLES and Network Commands 14. Chapter 11: File Transfer, Downloading, and Managing Log Files 15. Part 4:Linux Security and the Cloud
16. Chapter 12: Exploring Linux Security 17. Chapter 13: Linux in the Cloud 18. Index 19. Other Books You May Enjoy

Locking user accounts

In SELinux, the concept of locking user accounts is often associated with standard Linux account management practices, such as using the passwd command. SELinux itself does not directly handle account locking; rather, it relies on Linux’s account management tools to lock and unlock user accounts. Here are some Terminal examples of how to lock and unlock a user account:

  • Locking a user account:

    To lock a user account, you typically disable the account by changing the account’s password. This can be achieved by using the passwd command with the -l (lock) option:

Figure 12.9 – Locking a user account

Figure 12.9 – Locking a user account

  • Unlocking a user account:

    To unlock a user account that has been locked, you can use the passwd command again, with -u to unlock and f for the force option:

Figure 12.10 – Unlocking a user account

Figure 12.10 – Unlocking a user account

The first command unlocks the password for the intruder user, and the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image