We are Passionate About Building Tools for the Classroom

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed molestie, velit ut eleifend sollicitudin, neque orci tempor nulla, id sagittis nisi ante nec arcu.

Individual Online Learning

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos

Himenaeos. Sed molestie, velit ut eleifend sollicitudin, neque orci tempor nulla, id sagittis nisi ante nec arcu. Fusce porta bibendum convallis. Morbi fringilla sollicitudin scelerisque. In pellentesque

Classrooom Lessons

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos

Himenaeos. Sed molestie, velit ut eleifend sollicitudin, neque orci tempor nulla, id sagittis nisi ante nec arcu. Fusce porta bibendum convallis. Morbi fringilla sollicitudin scelerisque. In pellentesque

Coding Camps

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos

himenaeos. Sed molestie, velit ut eleifend sollicitudin, neque orci tempor nulla, id sagittis nisi ante nec arcu. Fusce porta bibendum convallis. Morbi fringilla sollicitudin scelerisque. In pellentesque

Education is in Our Blood

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed molestie, velit ut eleifend sollicitudin, neque orci tempor nulla, id sagittis nisi ante nec arcu. Fusce porta bibendum convallis. Morbi fringilla sollicitudin scelerisque.

Our Instructors

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos

Himenaeos. Sed molestie, velit ut eleifend sollicitudin, neque orci tempor nulla, id sagittis nisi ante nec arcu. Fusce porta bibendum convallis. Morbi fringilla sollicitudin scelerisque. In pellentesque

Comments Box SVG iconsUsed for the like, share, comment, and reaction icons

How to Delete a User on Linux (and Remove Every Trace)
A shell prompt in a terminal window on a Linux computer.
Fatmawati Achmad Zaenuri/Shutterstock
Deleting a user on Linux involves more than you think. If you’re a system administrator, you’ll want to purge all traces of the account and its access from your systems. We’ll show you the steps to take.

If you just want to delete a user account from your system and aren’t concerned about ending any running processes and other cleanup tasks, follow the steps in the “Deleting the User Account” section below. You’ll need the deluser command on Debian-based distributions and the userdel command on other Linux distributions.

Ad

User Accounts on Linux
Ever since the first time-sharing systems appeared in the early 1960s and brought with them the capability for multiple users to work on a single computer, there’s been a need to isolate and compartmentalize the files and data of each user from all the other users. And so user accounts—and passwords—were born.

User accounts have an administrative overhead. They need to be created when the user first needs access to the computer. They need to be removed when that access is no longer required. On Linux, there’s a sequence of steps that should be followed in order to correctly and methodically remove the user, their files, and their account from the computer.

If you’re the system administrator that responsibility falls to you. Here’s how to go about it.

Our Scenario
There’s any number of reasons an account might need to be deleted. A staff member might be moving to a different team or leaving the company altogether. The account might have been set up for a short term collaboration with a visitor from another company. Team-ups are common in academia, where research projects can span departments, different universities, and even commercial entities. At the conclusion of the project, the system administrator has to perform the housekeeping and remove unnecessary accounts.

The worst-case scenario is when someone leaves under a cloud because of a misdemeanor. Such events usually happen suddenly, with little fore-warning. That gives the system administrator very little time to plan, and an urgency to get the account locked, closed and deleted—with a copy of the user’s files backed up in case they are needed for any post-closure forensics.

In our scenario, we’ll pretend that a user, Eric, has done something that warrants his immediate removal from the premises. At this moment he is unaware of this, he’s still working, and logged in. As soon as you give the nod to security he’s going to be escorted from the building.

Everything’s set. All eyes are on you.

Check the Login
Let’s see if he really is logged in and, if he is, how many sessions he’s working with. The who command will list active sessions.

who
who in a terminal window

Eric is logged in once. Let’s see what processes he’s running.

Reviewing The User’s Processes
We can use the ps command to list the processes this user is running. The -u (user) option lets us tell ps to restrict its output to the processes running under the ownership of that user account.

ps -u eric
ps -u eric in a terminal window

We can see the same processes with more information using the top command. top also has an -U (user) option to restrict the output to the processes owned by a single user. Note that this time it is an uppercase “U.”

top -U eric
top -U eric in a terminal window

We can see the memory and CPU usage of each task, and can quickly look for anything with suspicious activity. We’re about to forcibly kill all of his processes, so it is safest to take a moment to quickly review the processes, and check and make sure that other users are not going to be inconvenienced when you terminate user account eric‘s processes.

Output from top -U eric in a terminal window

It doesn’t look like he’s doing much, just using less to view a file. We’re safe to proceed. But before we kill his processes, we’ll freeze the account by locking the password.

RELATED: How to Use the ps Command to Monitor Linux Processes

Locking the Account
We’ll lock the account before we kill the processes because when we kill the processes it will log out the user. If we’ve already changed his password, he won’t be able to log back in.

The encrypted user passwords are stored in the /etc/shadow file. You wouldn’t normally bother with these next steps, but so that you can see what happens in the /etc/shadow file when you lock the account we’ll take a slight detour. We can use the following command to look at the first two fields of the entry for the eric user account.

sudo awk -F: '/eric/ {print $1,$2}' /etc/shadow
sudo awk -F: '/eric/ {print $1,$2}' /etc/shadow in a terminal window

The awk command parses fields from text files and optionally manipulates them. We’re using the -F (field separator) option to tell awk that the file uses a colon ” : ” to separate the fields. We’re going to search for a line with the pattern “eric” in it. For matching lines, we’ll print the first and second fields. These are the account name and the encrypted password.

The entry for user account eric is printed for us.

To lock the account we use the passwd command. We’ll use the -l (lock) option and pass in the name of the user account to lock.

sudo passwd -l eric
sudo passwd -l eric in a terminal window

If we check the /etc/passwd file again, we’ll see what’s happened.

sudo awk -F: '/eric/ {print $1,$2}' /etc/shadow
sudo awk -F: '/eric/ {print $1,$2}' /etc/shadow in a terminal window

An exclamation mark has been added to the start of the encrypted password. It doesn’t overwrite the first character, it’s just added to the start of the password. That’s all that’s required to prevent a user from being able to log in to that account.

Now that we’ve prevented the user from logging back in, we can kill his processes and log him out.

Killing the Processes
There are different ways to kill a user’s processes, but the command shown here is widely available and is a more modern implementation than some of the alternatives. The pkill command will find and kill processes. We’re passing in the KILL signal, and using the -u (user) option.

sudo pkill -KILL -u eric
sudo pkill -KILL -u eric in a terminal window

You’re returned to the command prompt in a decidedly anti-climactic fashion. To make sure something happened let’s check who again:

who
who in a terminal window

His session is gone. He’s been logged off and his processes have been stopped. That’s taken some of the urgency out of the situation. Now we can relax a bit and carry on with the rest of the mopping up as security takes a walk over to Eric’s desk.

RELATED: How to Kill Processes From the Linux Terminal

Archiving the User’s home Directory
It’s not out of the question that in a scenario such as this, access to the user’s files will be required in the future. Either as part of an investigation or simply because their replacement may need to refer back to their predecessor’s work. We’ll use the tar command to archive their entire home directory.

The options we’re using are:

c: Create an archive file.
f: Use the specified filename for the name of the archive.
j: Use bzip2 compression.
v: Provide verbose output as the archive is created.
sudo tar cfjv eric-20200820.tar.bz /home/eric

A lot of screen output will scroll in the terminal window. To check the archive has been created, use the ls command. We’re using the -l (long format) and -h (human-readable) options.

ls -lh eric-20200802.tar.bz

A file of 722 MB has been created. This can be copied somewhere safe for later review.

Removing cron Jobs
We’d better check in case there are any cron jobs scheduled for user account eric. A cron job is a command that is triggered at specified times or intervals. We can check if there are any cron jobs scheduled for this user account by using ls:

sudo ls -lh /var/spool/cron/crontabs/eric

If anything exists in this location it means there are cron jobs queued for that user account. We can delete them with this crontab command. The -r (remove) option will remove the jobs, and the -u (user) option tells crontab whose jobs to remove.

sudo crontab -r -u eric

The jobs are silently deleted. For all we know, if Eric had suspected he was about to be evicted he might have scheduled a malicious job. This step is best practice.

Removing Print Jobs
Perhaps the user had pending print jobs? Just to be sure, we can purge the print queue of any jobs belonging to user account eric. The lprm command removes jobs from the print queue. The -U (username) option lets you remove jobs owned by the named user account:

lprm -U eric

The jobs are removed and you are returned to the command line.

Deleting the User Account
We’ve already backed up the files from the /home/eric/ directory, so we can go ahead and delete the user account and delete the /home/eric/ directory at the same time.

The command to use depends on which distribution of Linux you’re using. For Debian based Linux distributions, the command is deluser, and for the rest of the Linux world, it is userdel.

Actually, on Ubuntu both commands are available. I half-expected one to be an alias of the other, but they are distinct binaries.

type deluser
type userdel
type deluser in a terminal window

Although they’re both available, the recommendation is to use deluser on Debian-derived distributions:

“userdel is a low level utility for removing users. On Debian, administrators should usually use deluser(8) instead.”

That’s clear enough, so the command to use on this Ubuntu computer is deluser. Because we also want their home directory to be removed we’re using the --remove-home flag:

sudo deluser --remove-home eric
sudo deluser --remove-home eric in a terminal window

The command to use for non-Debian distributions is userdel, with the --remove flag:

sudo userdel --remove eric
All traces of user account eric have been erased. We can check that the /home/eric/directory has been removed:

ls /home
ls /home in a terminal window
...

#DMS

Future Proof - Switching costs a concern? #DMS built with tomorrow’s uncertainty in mind.
Equally at home in an in-house server room as it is in the cloud,
moving individual files or entire document repositories in and out of DMS is a breeze (history and all).
And since the software is open-source, you can easily add tools to automate the process of moving to or integrating with
future third-party systems.

Features
Support for any file type (docs, spreadsheets, images, PDFs-anything!)
Securely stores unlimited revisions of your business’s essential files
Provides a full file history in the form of a revision log, accessible via RSS
Helps you track and organize documents as they move through your organization’s existing workflow
Each file gets a permanent, authenticated URL that always points to the latest version
Each revision gets its own unique url (e.g.,TPS-Report-revision-3.doc) accessible only to those you deem
Files are intuitively checked out and locked to prevent revisions from colliding
Toggle documents between public, private, and password protected with a single mouse click
Runs in-house or in the cloud
Secure: filenames are hashed on upload and files are only accessible through WordPress’s proven authentication system
Can move document upload folder to location outside of web root to further ensure government- and enterprise-grade security
Documents and Revisions shortcodes, Recently Revised Documents widget

Integration with Edit Flow
Recently Revised Documents Widget, shortcodes, and templating functions for front-end integration

Audit Trail - creates check in / check out audit trail for all documents
Taxonomy-based Permissions - allows setting user-level permissions based on a custom taxonomy such as department
Third Party Encryption - example of how to integrate at rest encryption using third-party tools
Rename Documents - changes all references to “Documents” in the interface to any label of your choosing
State Change Notification - how to use document api to allow users to receive notification whenever documents change workflow state
Bulk Import - how to batch import a directory (or other list) of files as documents
Filetype Taxonomy - Adds support to filter by filetype
Track Changes - Auto-generates and appends revision summaries for changes to taxonomies, title, and visibility
Remove Workflow States - Completely removes Workflow state taxonomy backend and UI
Change Tracker - Auto-generates and appends revision summaries for changes to taxonomies, title, and visibility

0799455189
...

MUST READ ON DATA PROTECTION, THE UK SAYS IT WILL GO IT ALONE. IT PROBABLY WON'T.
Oracle tells the Supreme Court: "Google has a problem"
Oracle delivered its latest argument to the Supreme Court ahead of its showdown with Google over the internet giant's use of Java APIs to build Android.

Oracle on Wednesday delivered fresh arguments to the Supreme Court in its ongoing dispute with Google over the internet giant's use of Java APIs to build Android. The high court will finally consider the case on March 24 and deliver a verdict later this year, putting to rest a decade-long legal battle that put billions of dollars on the line, as well as the rules of software development.

"Google has a problem," Oracle argues in its brief. "It committed an egregious act of plagiarism and now needs to rewrite copyright law to justify it. It cannot."

ENTERPRISE SOFTWARE
As support ends, Windows 7 users head for the exits
Must-have macOS security, productivity, and performance utilities
Best video conferencing services for business: Zoom, WebEx, AnyMeeting, Slack, and more
How many computers do you regularly use? (ZDNet YouTube)
The Best Password Managers of 2020 (CNET)
SaaSOps: The next step in Software as a Service evolution (TechRepublic)
Oracle first took Google to court in 2010, claiming that Google owed it upwards of $9 billion for using Java API packages without paying copyright licensing fees. Oracle argued Google had infringed Oracle's copyright by copying into Android the "structure, sequence and organization" of 37 Java APIs.

In its latest brief, Oracle contends that Google wanted its own software platform so that it could jump into the nascent mobile business -- "But with a looming existential crisis, there was no time to innovate." Rather than talking about APIs, Oracle stresses that Google "copied 11,330 lines of computer code from Java SE, as well as the intricate organization and relationships among the lines of code."

While Google and others have argued that APIs shouldn't be subject to copyright protection, a U.S. Court of Appeals in 2014 ruled that copyright law did indeed apply to the Java APIs. Then in 2016, Google successfully convinced a jury in federal court that, even if copyright laws were applicable, its use of the APIs amounted to "fair use." However, the US Court of Appeals for the Federal Circuit reversed that ruling two years later.

After losing at the court of appeals in 2018, Google is finally bringing its case all the way to the Supreme Court. Earlier this year, Google submitted its brief to the high court, arguing that a win for Oracle would "stymie the creation of new implementations and applications."

SEE: The Supreme Court will decide software development's future in Google v. Oracle
Oracle's latest brief explains why Oracle believes APIs are indeed subject to copyright protection -- the Copyright Act covers "computer programs," and it doesn't make exceptions for APIs or any other specific kinds of code.

"Unauthorized copying into a competing product at this scale is clear-cut copyright infringement," the brief says. "If Google had taken 11,330 topic sentences from an encyclopedia or the entire structure of a treatise to compete with the original, Google could not credibly argue that what it took was devoid of copyright protection or fair to copy. Software is no different."

Next, Oracle takes on Google's claim to "fair use." The brief says, "Copying for a commercial and nontransformative purpose strongly weighs against fair use. Android generated over $42 billion. Google used Oracle's code or its original purpose without changing its expression, meaning, or message. That makes Google's use nontransformative."

Google and its allies in this case contend that a ruling in Oracle's favor could have significant damage on the tech industry, creating a "chilling effect" among developers that want to leverage APIs.

Oracle's brief delivers a rebuttal, pointing out that the software industry has flourished in the six years since the Court of Appeals' copyrightability decision.

"Google protests that the decisions below defied 'settled expectations' and threaten the software industry," the brief says. "But the U.S. software sector has risen to dominance because of copyright protection, not piracy. The real 'settled expectation' is the Copyright Act's constitutionally inspired imperative to reward authors' 'individual effort by personal gain.'"

RELATED TOPICS
CXO SECURITY INNOVATION SMART CITIES
RELATED STORIES
Hardware

10 tech gadgets we love for Valentine's Day

Security

UK police deny responsibility for poster urging parents to report kids for using Kali Linux

Innovation

Netflix: JPEG needs replacing and AV1 Image File Format is our best option
...

ZDNET ENTERPRISE SOFTWARE LINUX
MUST READ MICROSOFT'S FEBRUARY 2020 PATCH TUESDAY FIXES 99 SECURITY BUGS
Linux is ready for the end of time
2038 is for Linux what Y2K was for mainframe and PC computing in 2000, but the fixes are underway to make sure all goes well when that fatal time rolls around.

Twenty years later, the Y2K bug is making a comeback
On 03:14:08 Greenwich Mean Time (GMT, aka Coordinated Universal Time) January 19, 2038 (that's a Tuesday), the world ends. Well, not in the biblical Book of Revelations sense. But, what will happen is the value for time in 32-bit based Unix-based operating systems, like Linux and older versions of macOS, runs out of numbers and starts counting time with negative numbers. That's not good. We can expect 32-bit computers running these operating systems to have fits. Fortunately, Linux's developers already had a fix ready to go.

LINUX
Nasty Linux, macOS sudo bug found and fixed
VPNs will change forever with the arrival of WireGuard into Linux
10 super sweet laptops that come with Linux pre-installed
From Linux to cloud, why Red Hat matters for every enterprise
Linus Torvalds has no problem with Microsoft (ZDNet YouTube)
Best Chromebooks for 2020 (CNET)
How to install Microsoft Teams on Linux (TechRepublic)
The problem starts with how Unix tells time. Unix, and its relations -- Linux, macOS, and other POSIX-compatible operating systems -- date the beginning of time from the Epoch: 00:00:00 GMT on January 1, 1970. The Unix family measures time by the number of seconds since the Epoch.

So far, so good. But, since Unix and family started out as 32-bit operating systems, time's value is kept as a single signed 32-bit integer number. Those are a lot of seconds, but just like the last century's Y2K bug, it's not enough.

Linux developers have seen this coming for decades. So, Linux kernel developer Arnd Bergmann and others have been working on a repair. These corrections are now in the forthcoming Linux 5.6 kernel. Bergmann explained, "Linux-5.6, or my backport of the patches to 5.4, should be the first release that can serve as a base for a 32-bit system designed to run beyond year 2038."

There are some caveats:

All user space must be compiled with a 64-bit time_t, which will be supported in the coming musl-1.2 and glibc-2.32 releases, along with installed kernel headers from Linux-5.6 or higher.
Applications that use the system call interfaces directly need to be ported to use the time64 syscalls added in Linux-5.1 in place of the existing system calls.
Applications that use a private copy of kernel uapi header files or their contents may need to update to the Linux-5.6 version.
A few remaining interfaces cannot be changed to pass a 64-bit time_t in a compatible way, so they must be configured to use CLOCK_MONOTONIC times.
All Epoch problems present on 64-bit machines also apply to 32-bit machines. In particular this affects file systems with on-disk timestamps using signed 32-bit seconds: ext4 with ext3-style small inodes, ext2, xfs (to be fixed soon) and ufs.
In short, there's a lot of clean-up work to be done even after the core problem has been fixed.

MacOS has been moving away from 32-bit software for over a decade. But, tt was only in the late 2019 release of macOS Catalina, that Apple gave 32-bit apps the boot.

Now, you may be wondering -- since we're all running 64-bit computers these days -- why is this even an issue. Well, it's like this. First, many embedded systems and Internet of Things (IoT) devices are still running 32-bit operating systems. Indeed, by 2038, there will probably still be new 32-bit devices arriving in the market.

We also know, thanks to the Y2K bug popping up again in 2020, that systems you might assume will be dumped into landfills in 18-years will still be alive and well -- and badly misbehaving come the Epoch.

But look at this way: After we fix this, we won't have to worry about 64-bit Linux running out of seconds until 15:30:08 GMT Sunday, December 4, 29,227,702,659. Personally, I'm not going to worry about that one.

Related Stories:

The Y2K bug is back, causing headaches for developers again
South Korea's government explores move from Windows to Linux desktop
Nasty Linux, macOS sudo bug found and fixed
RELATED TOPICS
CLOUD BIG DATA ANALYTICS INNOVATION TECH AND WORK COLLABORATION DEVELOPER
RELATED STORIES
Home Affairs and Austrac think blockchain can reduce compliance costs
Innovation

Home Affairs and Austrac think blockchain can reduce compliance costs

Spirit Telecom continues shopping spree by acquiring TBG for managed services
Telcos

Spirit Telecom continues shopping spree by acquiring TBG for managed services

Sales of smart home devices accelerate in Brazil
Mobility

Sales of smart home devices accelerate in Brazil

Black Hat Asia 2020 postponed due to coronavirus concern
TechRepublic Forums
...

#تصميم مواقع إلكترونية (Website #Design#)
العرض يشمل 👇
✅ تصميم وبرمجة صفحات الموقع
✅ استضافة الموقع لمدة سنة (hosting)
✅ لوحة CMS
✅ تسجيل اسم الموقع لمدة سنة (Domain name registration)
✅ عدد غير محدد من عناوين ايميلات Official Emails
✅ أدوات سهلة للتحكم Friendly Site Tools
✅ تخزين في SSD storage
✅ أنظمة حماية Anti-Hack Systems
✅ نسخ احتياطي يومي Daily Backup
✅ دعم فني 24/7
✅ ربط بمواقع التواصل الاجتماعي
✅ اضافة الكلمات الدلالية والبحثية SEO & Keywords
✅ تصميم احترافي
✅ اضافة رابط واتس أب وماسنجر على الموقع للتواصل
0799455189. اسعار مغرية جدا
...

Load more

Casey Andrews

Javascript

Celine Marie

Web Apps

Jennifer Holand

Html / CSS

Cathy Waller

Apps & Games

Get In Touch with Us

New York

2923 Extra Ave.

New York, NY 39456

Headquarters

1235 Divi Street, Floor 3

San Francisco, CA 92021

Phone Number

sales@codingwithdivi.com

Sales

sales@codingwithdivi.com

Support

support@codingwithdivi.com

Join the Revolution

Himenaeos. Sed molestie, velit ut eleifend sollicitudin, neque orci tempor nulla, id sagittis nisi ante nec arcu. Fusce porta bibendum convallis.

Free Courses

Duis egestas aliquet aliquet. Maecenas erat eros, fringilla et leo eget, viverra pretium nulla. Quisque sed augue tincidunt, posuere dui tempor.

Premium Courses

Duis egestas aliquet aliquet. Maecenas erat eros, fringilla et leo eget, viverra pretium nulla. Quisque sed augue tincidunt, posuere dui tempor.

Ready to get started?

Get in touch, or create an account

Send message via your Messenger App