Sandra Henry-Stocker

Author Archives: Sandra Henry-Stocker

How to modify user-account settings with usermod

There are quite a few changes you can make to user accounts on Linux systems: setting them up, deleting or disabling them, adding or removing users from secondary groups, changing usernames or UIDs, moving home directories, changing users’ shells, altering account expiration timing, and so on.One command that can make nearly all of these changes easier is usermod. The only real constraints are 1) that the accounts you intend to change must already exist on the system (this command won’t set them up from scratch), and 2) that the affected users should probably not be logged in when you make these changes.The basic syntax for the command is usermod [options] LOGIN but that options section has a lot more possibilities than you might anticipate. In addition, sudo permissions will be required for this command since superuser access is required to set up or change nearly all user account settings.To read this article in full, please click here

How to modifying user-account settings with usermod

There are quite a few changes you can make to user accounts on Linux systems: setting them up, deleting or disabling them, adding or removing users from secondary groups, changing usernames or UIDs, moving home directories, changing users’ shells, altering account expiration timing, and so on.One command that can make nearly all of these changes easier is usermod. The only real constraints are 1) that the accounts you intend to change must already exist on the system (this command won’t set them up from scratch), and 2) that the affected users should probably not be logged in when you make these changes.The basic syntax for the command is usermod [options] LOGIN but that options section has a lot more possibilities than you might anticipate. In addition, sudo permissions will be required for this command since superuser access is required to set up or change nearly all user account settings.To read this article in full, please click here

Disowning a process in Linux

When you want a process to continue running even after you log off a Linux system, you have a couple options.One of them is to use the disown command. It tells your shell to refrain from sending a HUP (hangup) signal to the process when you log off. So, the process continues running. This can be very handy whenever you start a process and then, for some reason, you can’t stay logged in and wait until it finishes.[Get regularly scheduled insights by signing up for Network World newsletters.] The disown command is a shell built-in. This means that you don’t have to install it to use it, but it also means that it won’t be available if you use a shell that doesn’t support it. For those of us using bash and related shells (zsh, ksh etc.), disown should be available and you can verify this with a command like this that lists shell built-ins and then looks for "disown":To read this article in full, please click here

How to enforce password complexity on Linux

Deploying password-quality checking on your Debian-based Linux servers can help ensure that your users assign reasonably secure passwords to their accounts, but the settings themselves can be a bit misleading.For example, setting a minimum password length of 12 characters does not necessarily mean that all your users' passwords will actually have 12 or more characters.Let's stroll down Complexity Boulevard and see how the settings work and examine some that are worth considering.[Get regularly scheduled insights by signing up for Network World newsletters.] The files that contain the settings we're going to look at will be:To read this article in full, please click here

How to enforce password complexity on Linux

Deploying password-quality checking on your Debian-based Linux servers can help ensure that your users assign reasonably secure passwords to their accounts, but the settings themselves can be a bit misleading.For example, setting a minimum password length of 12 characters does not necessarily mean that all your users' passwords will actually have 12 or more characters.Let's stroll down Complexity Boulevard and see how the settings work and examine some that are worth considering.[Get regularly scheduled insights by signing up for Network World newsletters.] The files that contain the settings we're going to look at will be:To read this article in full, please click here

How to enforce password complexity on Linux

Deploying password-quality checking on your Debian-based Linux servers can help ensure that your users assign reasonably secure passwords to their accounts, but the settings themselves can be a bit misleading.For example, setting a minimum password length of 12 characters does not necessarily mean that all your users' passwords will actually have 12 or more characters.Let's stroll down Complexity Boulevard and see how the settings work and examine some that are worth considering.[Get regularly scheduled insights by signing up for Network World newsletters.] The files that contain the settings we're going to look at will be:To read this article in full, please click here

How to download and play YouTube and other videos on Linux

Who would have imagined that there’s a Linux tool available for downloading YouTube videos? Well, there is and it works for Linux as well as for other operating systems. So, if you need to watch some of the available videos even when your internet connection is flaky or you need to be offline for a while, this tool can be especially handy.The tool for downloading videos is called youtube-dl. (The “dl” portion undoubtedly means “download”.) It’s very easy to use and drops webm or mp4 files onto your system. Both formats provide compressed, high-quality video files that you can watch whenever you like.To read this article in full, please click here

Navigating your Linux files with ranger

Ranger is a unique and very handy file system navigator that allows you to move around in your Linux file system, go in and out of subdirectories, view text-file contents and even make changes to files without leaving the tool.It runs in a terminal window and lets you navigate by pressing arrow keys. It provides a multi-level file display that makes it easy to see where you are, move around the file system and select particular files.To install ranger, use your standard install command (e.g., sudo apt install ranger). To start it, simply type “ranger”. It comes with a lengthy, very detailed man page, but getting started with ranger is very simple.To read this article in full, please click here

Recovering deleted files on Linux with testdisk

When you delete a file on a Linux system, it isn’t necessarily gone forever, especially if you just recently deleted it.Unless you rubbed it out with a tool such as shred, the data will still be sitting on your disk—and one of the best tools for recovering deleted files, testdisk, can help you rescue it. While testdisk has a wide range of functionality including recovering lost or damaged partitions and making non-booting disks bootable again, it’s also frequently used to restore files that were deleted by mistake.In this post, we’ll take a look at how you can recover deleted files using testdisk and what each step in the process looks like. Since the process requires quite a few steps, you’re likely to feel more comfortable running through them once you’ve done it a few times.To read this article in full, please click here

How to view information on your Linux devices with lshw

While far from being one of the first 50 Linux commands anyone learns, the lshw command (read as “ls hardware”) can provide a lot of useful details on your system’s hardware.It extracts details—maybe quite a few more than you knew were available—in a format that is reasonably easy to digest. Given descriptions, logical (device) names, sizes, etc., you are likely to appreciate how much detail you can access.This post examines the information that lshw provides with a particular focus on disk and related hardware. Here is some sample lshw output:$ sudo lshw -C disk *-disk:0 description: SCSI Disk product: Card Reader-1 vendor: JIE LI physical id: 0.0.0 bus info: [email protected]:0.0.0 logical name: /dev/sdc version: 1.00 capabilities: removable configuration: logicalsectorsize=512 sectorsize=512 *-medium physical id: 0 logical name: /dev/sdc Note that you should run the lshw command with sudo to ensure that you get all of the available details.To read this article in full, please click here

Using bash’s shopt builtin to manage Linux shell behavior

If you haven’t tried it yet, you might be surprised by the many features of shopt. While it works like a Linux command, it’s actually a bash shell builtin that allows you to change many things about that shell’s behavior.One option, for example, allows the shell to fix minor typos when you type directory names. To demonstrate, in the first cd command shown below, the directory name, bin, is typed with an extra letter and the shell complains and gives up:$ cd binn -bash: cd: binn: No such file or directory This next command enables the cdspell option that gets bash to attempt to correct minor typos in directory names.To read this article in full, please click here

Using the Linux stat command to create flexible file listings

The stat command supplies a lot of detailed information on files.It provides not just the date/time of the most recent file changes, but also shows when files were most recently accessed and permissions changed. It tells you the file size in both bytes and blocks. It displays the inode being used by the file along with the file type. It includes the file owner and the associated user group both by name and UID/GID. It displays file permissions in both the “rwx” (referred to as the “human-readable” format) and numerically. On some systems, it might even include the date and time that a file was created (called its “birth”).[Get regularly scheduled insights by signing up for Network World newsletters.] In addition to providing all this information, the stat command can also be used to create file listings. These listings are extremely flexible in that you can choose to include any or all of the information described above.To read this article in full, please click here

Enhancing the Linux command line with aliases

Want to get work done a little faster, spend less time remembering commands and maybe even show your coworkers how clever you are? Easy. Set up several dozen bash aliases.Your days will get easier and a tad less stressful. You might even have some fun. In this post, we'll look at the various types of aliases that you can set up, and what you need to know to manage them.[Get regularly scheduled insights by signing up for Network World newsletters.] Why use aliases? Using aliases helps you to avoid having to type a lot of command details, especially those that are hard to remember or require a lengthy string of options that might have to be entered in some particular order before they'll spit out just the output that you're waiting to see.To read this article in full, please click here

11 ways to list and sort files on Linux

There are many ways to list files and display information about them on Linux systems. This post reviews a number of commands that provide details on files and provides options for customizing your file listings to meet your needs.Most of the commands list files within individual directories while others reach as deeply into a file system as you care to look.The primary command for listing files is, of course, ls. This command, however, has an extensive number of options for finding and listing just the files you want to see. Plus, there's always find for helping with very specific file searches.Listing files by name The easiest way to list files by name is simply to list them using the ls command. Listing files by name (alphanumeric order) is, after all, the default. You can choose the ls (no details) or ls -l (lots of details) to determine your view.To read this article in full, please click here

Managing process accounting on Linux

Process accounting is a method of recording and summarizing commands and processes. It's an option on Linux systems, but you have to enable it and use a particular command to view the details collected. This post covers the commands involved and offers some suggestions on making the views even more useful.To start, understand that process accounting is different than what you see when running the ps command. It shows details on commands that have completed –- not those that are currently running. It also shows a lot more details than you would see by looking at your users' command history files and keeps all the collected data in a single file on the system.To read this article in full, please click here

Word game: Finding anadromes with Linux

In these stressful times, one way to distract ourselves from the gloom is by playing word games. With this thought in mind, I challenged myself to identify words that, spelled backwards, would still be words.Instead of cheating by doing a simple Google search, I cheated by using my Linux commands skills. So, in this post, we’ll look at how Linux commands and resources can be used to identify such words.Defining the search Before we get started on the Linux search technique, I should point out that what I was looking for were not just palindromes – words like “civic” and “deified” that read the same from left to right as they do right to left. Instead, I was also looking for words like “reward” and “decaf” that turn into different words – in this case, “drawer” and “faced” -- when one reads them backwards.To read this article in full, please click here

Merging and sorting files on Linux

There are a number of ways to merge and sort text files on Linux, but how to go about it depends on what you're trying to accomplish – whether you simply want to put the content of multiple files into one big file, or organize it in some way that makes it easier to use. In this post, we'll look at some commands for sorting and merging file contents and focus on how the results differ.Using cat If all you want to do is pull a group of files together into a single file, the cat command is an easy choice. All you have to do is type "cat" and then list the files on the command line in the order in which you want them included in the merged file. Redirect the output of the command to the file you want to create. If a file with the specified name already exists, it will be overwritten by the one you are creating. For example:To read this article in full, please click here

How to find what you’re looking for on Linux with find

There are a number of commands for finding files on Linux systems, but there are also a huge number of options that you can deploy when looking for them.For example, you can find files not just by their names, but by their owners and/or groups, their age, their size, the assigned permissions, the last time they were accessed, the associated inodes and even whether the files belong to an account or group that no longer exists on the system and so on.[Get regularly scheduled insights by signing up for Network World newsletters.] You can also specify where a search should start, how deeply into the file system the search should reach and how much the search result will tell you about the files it finds.To read this article in full, please click here

Digging up IP addresses with the Linux dig command

Not unlike nslookup in function, but with a lot more options, the dig command provides information that name servers manage and can be very useful for troubleshooting problems. It’s both simple to use and has lots of useful options.The name “dig” stands for “domain information groper” since domain groping is basically what it does. The amount of information that it provides depends on a series of options that you can use to tailor its output to your needs. Dig can provide a lot of detail or be surprisingly terse.[Get regularly scheduled insights by signing up for Network World newsletters.] Just the IP, please To get just the IP address for a system, add the +short option to your dig command like this:To read this article in full, please click here

Navigating man pages in Linux

Man pages provide essential information on Linux commands and many users refer to them often, but there’s a lot more to the man pages than many of us realize.You can always type a command like “man who” and get a nice description of how the man command works, but exploring commands that you might not know could be even more illuminating. For example, you can use the man command to help identify commands to handle some unusually challenging task or to show options that can help you use a command you already know in new and better ways.Let’s navigate through some options and see where we end up.Using man to identify commands The man command can help you find commands by topic. If you’re looking for a command to count the lines in a file, for example, you can provide a keyword. In the example below, we’ve put the keyword in quotes and added blanks so that we don’t get commands that deal with “accounts” or “accounting” along with those that do some counting for us.To read this article in full, please click here

1 4 5 6 7 8 19