Linux command line tools for working with non-Linux users

By Bryan Lunduke

I spend most of my computing life in the Shell (command line, terminal or whatever you want to call it on your platform of choice). This can be a bit challenging, though, when I need to work with large groups of other people, especially in big enterprise companies that — well — use anything but the Shell.

The problems that crop up are made worse when other people within your company use a different platform than you. I tend to use Linux. If I’m doing a lot of my daily work from a Linux terminal and the bulk of my co-workers use Windows 10 (entirely from the GUI side), things can get … problematic.

Luckily, over the past few years, I’ve figured out how to deal with these problems. I’ve found ways to make using a Linux (or other Unix-like systems) Shell much more doable within a non-Unix, corporate environment. These tools/tips apply equally well for SysAdmins working on a company’s servers as they do for developers or marketing people.

To read this article in full or to leave a comment, please click here

From: Network World

Share

Scary Linux commands for Halloween

By Sandra Henry-Stocker

With Halloween so fast approaching, it’s time for a little focus on the spookier side of Linux. What commands might bring up images of ghosts, witches and zombies? Which might encourage the spirit of trick or treat?

crypt

Well, we’ve always got crypt. Despite its name, crypt is not an underground vault or a burial pit for trashed files, but a command that encrypts file content. These days “crypt” is generally implemented as a script that emulates the older crypt command by calling a binary called mcrypt to do its work. Using the mycrypt command directly is an even better option.

$ mcrypt x
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase:
Enter passphrase:

File x was encrypted.

Note that the mcrypt command creates a second file with an added “.nc” extension. It doesn’t overwrite the file you are encrypting.

To read this article in full or to leave a comment, please click here

From: Network World

Share

More ways to examine network connections on Linux

By Sandra Henry-Stocker

The ifconfig and netstat commands are incredibly useful, but there are many other commands that can also help you see what’s up with you network on Linux systems. Today’s post explores some very handy commands for examining network connections.

ip

The ip command shows a lot of the same kind of information that you’ll get when you use ifconfig. Some of the information is in a different format – e.g., “192.168.0.6/24” instead of “inet addr:192.168.0.6 Bcast:192.168.0.255” and ifconfig is better for packet counts, but the ip command has many useful options.

First, here’s the ip a command listing information on all network interfaces.

To read this article in full or to leave a comment, please click here

From: Network World

Share

Using the Linux find command with caution

By Sandra Henry-Stocker

A friend just recently reminded me of a useful option that can add a little caution to the commands that I run with the Linux find command. It’s called -ok and it works like the -exec option except for one important difference – it makes the find command ask for permission before taking the specified action.

Here’s an example. If you were looking for files that you intended to remove from the system using find, you might run a command like this:

$ find . -name runme -exec rm {} ;

Anywhere within the current directory and its subdirectories, any files named “runme” would be summarily removed – provided, of course, that you have permission to remove them. Use the -ok command instead, and you’ll see something like this. The find command will ask for approval before removing the files. Answering y for “yes” would allow the find command to go ahead and remove the files one by one.

To read this article in full or to leave a comment, please click here

From: Network World

Share

Examining network connections on Linux systems

By Sandra Henry-Stocker

There are a lot of commands available on Linux for looking at network settings and connections. In today’s post, we’re going to run through some very handy commands and see how they work.

One very useful command is the ifquery command. This command should give you a quick list of network interfaces. However, you might only see something like this — showing only the loopback interface:

$ ifquery --list
lo

If this is the case, your /etc/network/interfaces file doesn’t include information on network interfaces except for the loopback interface. You can add lines like the last two in the example below — assuming DHCP is used to assign addresses — if you’d like it to be more useful.

To read this article in full or to leave a comment, please click here

From: Network World

Share

Getting Linux to ignore pings

By Sandra Henry-Stocker

The ping command sends one or more requests to a system asking for a response. It’s typically used to check that a system is up and running, verify an IP address, or prove that the sending system can reach the remote one (i.e., verify the route). The ping command is also one that network intruders often use as a first step in identifying systems on a network that they might next want to attack. In this post, we’re going to take a quick look at how ping works and then examine options for configuring systems to ignore these requests.

How ping works

The name “ping” came about because the ping command works in a way that is similar to sonar echo-location which used sound propogation for navigation. The sound pulses were called “pings”. The ping command on Unix and other systems sends an ICMP ECHO_REQUEST to a specified computer, which is then expected to send an ECHO_REPLY. The requests and replies are very small packets. On many systems, the default is to send four such packets and display the result of each request and each reply with a summary at the end. Others continue sending pings until the person issuing the command enters control-C to stop the process.

To read this article in full or to leave a comment, please click here

From: Network World

Share

Managing users on Linux systems

By Sandra Henry-Stocker

Your Linux users may not be raging bulls, but keeping them happy is always a challenge as it involves managing their accounts, monitoring their access rights, tracking down the solutions to problems they run into, and keeping them informed about important changes on the systems they use. Here are some of the tasks and tools that make the job a little easier.

Configuring accounts

Adding and removing accounts is the easier part of managing users, but there are still a lot of options to consider. Whether you use a desktop tool or go with command line options, the process is largely automated. You can set up a new user with a command as simple as adduser jdoe and a number of things will happen. John’s account will be created using the next available UID and likely populated with a number of files that help to configure his account. When you run the adduser command with a single argument (the new username), it will prompt for some additional information and explain what it is doing.

To read this article in full or to leave a comment, please click here

From: Network World

Share

Making good use of the files in /proc

By Sandra Henry-Stocker

The /proc file system first made its way into some Unix operating systems (like Solaris) in the mid-1990’s, promising to give users more and easier access into the kernel and to running processes. It was a very welcome enhancement — looking and acting like a regular file system, but delivering hooks into the kernel and the ability to treat processes as files. It went well beyond what we could do with ps and other common commands for examining processes and the system they’re running on.

When it first appeared, /proc took a lot of us by surprise. We were used to devices as files, but access to processes as files was new and exciting. In the years since, /proc has become more of a go-to source for process information, but retains an element of mystery because of the incredible detail that it provides.

To read this article in full or to leave a comment, please click here

From: Network World

Share

Mastering file searches on Linux

By Sandra Henry-Stocker

There are many ways to search for files on Linux systems and the commands can be very easy or very specific — narrowing down your search criteria to find what just you’re looking for and nothing else. In today’s post, we’re going to examine some of the most useful commands and options for your file searches. We’re going to look into:

  • quick finds
  • more complex search criteria
  • combining conditions
  • reversing criteria
  • simple vs detailed responses
  • looking for duplicate files

There are actually several useful commands for searching for files. The find command may be the most obvious, but it’s not the only command or always the fastest way to find what you’re looking for.

To read this article in full or to leave a comment, please click here

From: Network World

Share

What’s behind the Linux umask

By Sandra Henry-Stocker

The umask setting plays a big role in determining the permissions that are assigned to files that you create. But what’s behind this variable and how do the numbers relate to settings like rwxr-xr-x?

First, umask is a setting that directly controls the permissions assigned when you create files or directories. Create a new file using a text editor or simply with the touch command and its permissions will be derived from your umask setting. You can look at your umask setting simply by typing umask on the command line.

$ umask
0022

Where the umask setting comes from

The umask setting for all users is generally set up in a system-wide file like /etc/profile, /etc/bashrc or /etc/login.defs — a file that’s used every time someone logs into the system. The setting can be overidden in user-specific files like ~/.bashrc or ~/.profile since these files are read later in the login process. It can also be reset on a temporary basis at any time with the umask command.

To read this article in full or to leave a comment, please click here

From: Network World

Share