SUSE Linux Commands

Checking Address Resolution Protocol ARP

If you're not able to ping your gateway, you may have an issue at the Ethernet MAC layer. The Address Resolution Protocol (ARP) can be used to find information at the MAC layer. To view and configure ARP entries, use the arp or ip neighbor command. This example shows arp listing computers in the ARP cache by hostname arp -v List ARP cache entries by name Address HWtype HWaddress Flags Mask Iface ritchie ether 00 10 5A AB F6 A7 C eth0 einstein ether 00 0B 6A 02 EC 98 C eth0 In this example, you...

Installing openSUSE and Adding Software

Critical tools for initially installing openSUSE, and for adding and managing software later, include the rpm utility install manage local packages , the YaST utility install manage packages from online repositories , and zypper, a relatively recent command line tool for managing packages. This chapter highlights critical issues you need to know during initial installation of openSUSE. It covers information about online software repositories for an array of software tools and shows how to set...

Mounting File Systems with the mount Command

The mount command is used to view mounted file systems, as well as mount any local (hard disk, USB drive, CD, DVD, and so on) or remote (NFS, Samba, and so on) file systems. Here is an example of the mount command for listing mounted file systems mount List mounted remote and local file systems dev sda7 on type ext3 (rw,acl,user_xattr) proc on proc type proc (rw) sysfs on sys type sysfs (rw) devpts on dev pts type devpts (rw,mode 0 62 0,gid 5) dev sda6 on mnt debian type ext3 (rw) dev sda3 on...

Creating Backup Images with mkisofs

Most data CDs and DVDs can be accessed on both Windows and Linux systems because they are created using the ISO9660 standard for formatting the information on those discs. Because most modern operating systems need to save more information about files and directories than the basic ISO9660 standard includes, extensions to that standard were added to contain that information. Using the mkisofs command, you can back up the file and directory structure from any point in your Linux file system and...

Viewing Active Processes with ps

Every Linux system (as well as every system derived from Unix, such as BSD, Mac OS X, and others) includes the ps command. Over the years, however, many slightly different versions of ps have appeared, offering slightly different options. Because ps dates back to the first Unix systems, it also supports nonstandard ways of entering some options (for example, allowing you to drop the dash before an option in some cases). The different uses of ps shown in this chapter will work on SUSE, openSUSE,...

Configuring the BuiltIn Firewall

Which itself relies on two init scripts etc init.d SuSEfirewall2_init and etc init.d SuSEfirewall2_setup. The default iptables configuration is a good starting point for simple server firewalling, which consists of opening just a few ports for running daemons and blocking the rest. You can customize this default configuration by editing etc sysconfig SuSEfirewall2. Before doing so, we recommend you read the documentation in For more complex needs, as when iptables is used as the firewall in...

Doing Remote Login and Tunneling with SSH

Linux's big brother Unix grew up on university networks. At a time when the only users of these networks were students and professors, and with networks mostly isolated from each other, there was little need for security. Applications and protocols that were designed in those times (the 1970s and 1980s) reflect that lack of concern for encryption and authentication. SMTP is a perfect example of that. This is also true of the first generation of Unix remote tools telnet, ftp (file transfer...

Working with Users and Groups

During most Linux installation procedures, you are asked to assign a password to the root user (for system administration). Then you might be asked to create a user name of your choice and assign a password to that as well (for everyday computer use). We encourage you to always log in as a regular user and only su or sudo to the root account when necessary. When Linux is installed, you can use commands or graphical tools to add more users, modify user accounts, and assign and change passwords....

Changing Running Processes

Even after a process is running, you can change its behavior in different ways. With the renice command, shown earlier, you can adjust a running process's priority in your system's scheduler. With the nice command, you can determine the default priority and also set a higher or lower priority at the time you launch a process. Another way you can change how a running process behaves is to send a signal to that process. The kill and killall commands can be used to send signals to running...

Starting with SUSE

Whether you use SUSE Linux every day or just tweak it once in a while, a book that presents efficient ways to use, check, fix, secure, and enhance your system can be an invaluable resource. SUSE Linux Toolbox is that resource. SUSE Linux Toolbox is aimed primarily at SUSE Linux power users and systems administrators. To give you what you need, we tell you how to quickly locate and get software, monitor the health and security of your systems, and access network resources. In short, we cut to...

Using Text Based Email Clients

Most Mail User Agents (MUAs) are GUI-based these days. So if you began using e-mail in the past decade or so, you probably think of Evolution, Kmail, Thunderbird, or (on Windows systems) Outlook when it comes to e-mail clients. On the first Unix and Linux systems, however, e-mail was handled by text-based applications. If you find yourself needing to check e-mail on a remote server or other text-based environment, venerable text-based mail clients are available and still quite useful. In fact,...

Extracting Files from RPMs

An RPM is basically an archive of files that you want to install to your computer and some header information that identifies the software (descriptions, checksums, build information, and so on). You can remove the archive from an RPM package and output the archive to a cpio archive file. The cpio format is similar to the tar format, described in Chapter 8, and can be similarly used for backing up and transporting files. Here's an example using the rpm2cpio command to extract the cpio archive...

Creating and Using Swap Partitions

Swap partitions are needed in Linux systems to hold data that overflows from your system's RAM. If you didn't create a swap partition when you installed Linux, you can create it later using the mkswap command. You can create your swap partition either on a regular disk partition or in a file formatted as a swap partition. Here are some examples mkswap dev sda1 Format sda1 as a swap partition Setting up swapspace version 1, size 205594 kB To check your swap area for bad blocks, use the -c option...

Tracing Routes to Hosts

After you make sure that you can ping your gateway and even reach machines that are outside of your network, you may still have issues reaching a specific host or network. If that's true, you can use traceroute to find the bottleneck or point of failure traceroute boost.turbosphere.com Follow the route taken to a host traceroute to boost.turbosphere.com (66.113.99.70),30 hops max,40 byte packets 1 10.0.0.1 (10.0.0.1) 0.281 ms 0.289 ms 0.237 ms 2 tl-03.hbci.com (64.211.114.1) 6.213 ms 6.189 ms...

Using fuser to Find Processes

Another way to locate a particular process is by what the process is accessing. The fuser command can be used to find which processes have a file or a socket open at the moment. After the processes are found, fuser can be used to send signals to those processes. The fuser command is most useful for finding out if files are being held open by processes on mounted file systems (such as local hard disks or Samba shares). Finding those processes allows you to close them properly (or just kill them...

Changing File Attributes

Files and directories in Linux file systems all have read, write, and execute permissions associated with user, group, and others. However, there are also other attributes that can be attached to files and directories that are specific to certain file system types. Files on ext2 and ext3 file systems have special attributes that you may choose to use. You can list these attributes with the lsattr command. Most attributes are obscure and not turned on by default. Here's an example of using...

Using the Pico and nano Editors

Pico is a popular, very small text editor, distributed as part of the Pine e-mail client. Although Pico is free, it is not truly open source. Therefore, many Linux distributions don't offer Pico. Instead, most distributions offer an open source clone of Pico called nano (nano's another editor). SUSE provides both Pico and nano as optional packages. This section describes the nano editor. nano (represented by the nano command) is a compact text editor that runs from the shell, but is...

Making and Burning DVDs with growisofs

Using the growisofs command, you can combine the two steps of gathering files into an ISO image (mkisofs) and burning that image to DVD (cdrecord). Besides saving a step, the growisofs command also offers the advantage of keeping a session open by default until you close it, so you don't need to do anything special for multi-burn sessions. Here is an example of some growisofs commands for a multi-burn session growisofs -Z dev dvd -R -J home chris Master and burn to DVD growisofs -Z dev dvd -R...

Setting File and Directory Permissions

The ability to access files, run commands, and change to a directory can be restricted with permission settings for user, group, and other users. When you do a long list (ls -l) of files and directories in Linux, the beginning 10 characters shown indicate what the item is (file, directory, block device, and so on) along with whether or not the item can be read, written, or executed. Figure 4-1 illustrates the meaning of those 10 characters. Figure 4-1 Read, write, and execute permissions are...

Checking File Systems

In Linux, instead of just having the scandisk utility you have in Windows, you can scan a physical device for bad blocks at a physical level with the badblocks command and scan a file system for errors at the logical level with the fsck command. Here's how to scan for bad blocks badblocks dev sdal Physically scan hard disk for bad blocks badblocks -v dev sdal Add verbosity to hard disk scan Checking blocks 0 to 200781 Checking for bad blocks (read-only test) done Pass completed, 0 bad blocks...

Using the JOE Editor

If you have used classic word processors such as WordStar that worked with text files, you might be comfortable with the JOE editor (from the joe package, installed by default). To use the spell checker in JOE, install the aspell package. With JOE, instead of entering a command or text mode, you are always ready to type. To move around in the file, you can use control characters or the arrow keys. To open a text file for editing, just type joe and the file name or use some of the following...