Best of Technical Support

Our experts answer your technical questions.
You Can't Log in Now; Get a Life

I have a couple of questions. First, how would you create a backup user for root with the same privileges as root? Second, is there a way to allow users to log in only within a specific time frame? An example of this would be to allow a user to log in between the hours of 6 A.M. and 6 P.M., but not to allow logins outside of this window.

—Jerry Fulkerson, hrlinkin@aol.com

To add a second root account, edit /etc/passwd and /etc/shadow (using vipw and vipw -s). In both files, duplicate the line with root and change the name to backuproot.

—Marc Merlin, marc_bts@valinux.com

Regarding control of login time, there are several ways of doing it. Using the Pluggable Authentication Modules (PAM) system's pam_time module is one of them, for instance. The file /etc/security/time.conf could have the line:

login;*;joe;Al0600-1800

This means the user joe is allowed to use the service called login, from any terminal (*), all days (Al) only during 06:00 and 18:00 hours. Be aware that this requires the entry:

login   account required   pam_time.so

on the PAM configuration file, which is usually at /etc/pam.conf or alternatively, the file named login to be within /etc/pam.d/ and containing:

account required pam_time.so

A good PAM reference can be found at www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam.html#toc4.

—Felipe E. Barousse Boué, fbarousse@piensa.com

I Have No DHCP and I Must Network

Currently, I use Red Hat 7.0 on PCs in my computer programming lab. These computers use DHCP to connect to the building network and the Internet. Recently I attempted to upgrade these machines to a stock version of Red Hat 7.2. I have been unable to get computers to connect via DHCP. I have tried to configure the card and networking using the various GUI tools but have had no success.

—Bill Hummel, hummelb@readingsd.org

Looks to me that you are having trouble connecting because of two possible issues. First, you have not configured the DHCP client to connect to the network. I just did it on a Red Hat 7.2 machine by having the minimally configured file /etc/sysconfig/network-scripts/ifcfg-eth0 for network interface eth0 as:

DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"

This will provide enough information for the system to boot up, and when starting networking facilities, to look for an IP address provided by a DCHP server. Second, you probably set a firewall or network filter that is not allowing DHCP to work properly. Did you request a “high” security level when installing? Just one time, get rid of the ipchains setup that Red Hat 7.2 sets up by commenting all lines in /etc/sysconfig/ipchains and then try step one.

—Felipe E. Barousse Boué, fbarousse@piensa.com

What Does ./ Mean?

When (and why) is it necessary to put ./ in the beginning of a command line?

—Murray Zangen, murray@nj.com

The ./ means current working directory. You need to put ./ in front only when you want to run a program in the directory you are in, and that directory is not in the PATH shell variable ($PATH).

—Usman Ansari, uansari@yahoo.com

The reason the current directory is not in the path is due to security concerns. If an adversary installed a Trojan ls command in the /tmp directory and you cd-ed into /tmp and typed ls, you would run the adversary's program. If you really don't like having to type ./, place the current directory at the *end* of your PATH shell variable, this will make your file system surfing safer.

—Christopher Wingert, cwingert@qualcomm.com

Opening a File with filep_open

I have created a configuration file stored in the directory /etc. I have been trying to open this file from a C program without success:

struct file     *filp;
char *Filename = "/etc/pg.conf\0";
filp = filp_open(Filename,00,O_RDONLY);
if (IS_ERR(filp)||(filp==NULL))
        return;

Could someone advise me how to fix this?

—Senthil, senthil@singnet.com.sg

I believe that you do not have the parameters correct to filp_open(). Try

filp = filp_open( Filename, O_RDONLY, 0 );

—Christopher Wingert, cwingert@qualcomm.com

______________________

White Paper
Fabric-Based Computing Enables Optimized Hyperscale Data Centers

Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.

Learn More

Sponsored by AMD

White Paper
Red Hat White Paper: Using an Open Source Framework to Catch the Bad Guy

Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6

Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.

Learn more about catching the bad guy in this free white paper.

Learn More

Sponsored by DLT Solutions