The rise of shadow passwords and MD5 could potentially cause over-diversification, with every combination of add-ons requiring its own versions of commands like passwd or login. This problem is avoided by the Pluggable Authentication Method (PAM). PAM can be thought of as an intermediary between the commands and processes involved with authentication and any modifications to it. PAM evolved along with shadow passwords and MD5 and has been available in distributions since about 1997.
Originally, PAM was configured in /etc/pam.conf. However, in most distributions, this file is now as vestigial as an appendix. Instead, PAM uses the /etc/pam.d directory.
A handful of files in /etc/pam.d define which users or groups, if any, can use a specific command. For example, /etc/pam.d/su regulates the su command. Other limits may be set in /etc/security/limits.conf. However, the majority of the files in /etc/pam.d act as intermediaries between password system enhancements and other commands, pointing to libraries in /lib/security. Examples of these files include chfn, chsh, cron, gdm and login. This function allows not only the use of shadow passwords or MD5 but eases the addition of upscale security solutions such as Kerebos.
The files in /etc/pam.d offer far too many options to detail here. However, the files are heavily commented and relatively easy to follow. Files such as passwd, gdm, login and su, which control the basics of the password system, are especially useful. For example, login can control root logins, put a time restraint on logins and set how login attempts are logged. Similarly, if you use su on the system, rather than the more controllable sudo, /etc/pam.d/su can help you set limits on how the command is used. And, while you don't want to change the references to security libraries in the pam.d files, you might want to look at the options used with them—for instance, the security-minded might want to avoid nullok, which allows users to change empty passwords. Going farther afield, chsh can be used to limit the shells users can use to a list in /etc/shells. In short, while browsing the pam.d directory can leave you with the trauma of option anxiety, you'll find the effort an important step in learning how to make your system more secure.
Shadow passwords, MD5 and PAM all increase the security of a system. However, keep in mind that the security they provide is relative. Given enough computing power and enough time, a brute-force attack can crack any system.
Moreover, the effort is getting easier with each advance in hardware and crackers' tools. To put things in perspective, in 1994, RSA Security system estimated that a brute-force attack on the average machine would succeed within 24 days. By contrast, the developers of mdcrack, a tool that can be used for testing the security of MD5-enabled systems, claim that a 56-character password can be cracked on an average machine using the 2.2 Linux kernel within 20 seconds. Although that was almost twice as long as the average time to crack a Windows machine, obviously Linux users have no reason to be smug. And the situation is only going to get worse.
One way to respond to this pressure is to make better use of the password system. Many users, especially at home, forget about the password system after they install and fail to use anything except its most basic features. Yet a little attention to detail could be enough to send the script kiddies into tantrums. For example:
Set the number of days that a password can be used in /etc/shadow. The method is a pain, but regularly changed passwords could set back a brute-force attack that relies more on time than computing power.
Increase the minimum and maximum password lengths in /etc/pam.d/passwd. Other things being equal: the longer the password, the longer it takes to crack.
Lower the minimum number of login attempts in /etc/pam.d/gdm. Legitimate users with sausage-like fingers might complain, but anyone attempting a brute-force attack could be irritated enough to go away.
Approve all user passwords or insist that they are generated by a program like pwgen that creates secure passwords. The number of users whose password is “password” or the name of their youngest daughter or goldfish is too depressing for words.
Install a program like cracklib2, which prevents the use of easily guessed passwords. You'll probably want to add a custom dictionary of company, product and user names that cannot be used as passwords. Currently, cracklib2 requires some patience to set up, as well as the uncommenting of a number of lines in /etc/pam.d, but it, or a similar package, is likely to become a standard part of major distributions in the next few years.
Do not allow the root user to log in remotely.
Watch for expired passwords or user accounts without passwords. Either could be an entry point to the system.
Turn off your computer or your net connection if you're not using it. Forget the geek macho about how long your system has been running. If it's not connected, then remote cracks can't happen.
Another response to the increased risks of modern computers is the increased use of password authentication on the system. Here are some of the places you can add passwords if they aren't already there:
The BIOS: use a password and make sure it can't be bypassed via floppy or CD.
The Boot Manager: use LILO's password command or GRUB's lock command.
Remote Services: ssh sends encrypted passwords—Telnet and FTP don't. Guess which one you should use?
Still, there's no reason not to use whatever security passwords afford. And there's definitely not a reason to bypass the password system or weaken it—two options that are starting to appear in modern distributions in the hopes of making GNU/Linux seem more like other operating systems of the average user's acquaintance. The tools are there, so why not use them?
-- Bruce Byfield (nanday)
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Parsing an RSS News Feed with a Bash Script
- Google's SwiftShader Released
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide