Configure Linux Network Interface

Red Hat/Centos
Edit interface settings by editing the “/etc/sysconfig/network-scrips/ifcfg-eth0” file. The following settings will configure an interface to have a static IP address:


The following settings will configure an interface to use DHCP:

Continue reading “Configure Linux Network Interface”

Configure SSH for Public Key Login

Some quick notes on creating and using a key pair for SSH logon.

1. Generate key pair on the client.

ssh-keygen -t rsa -b 2048

2. Enter a passphrase when prompted. If you do not want a password so that you can use this key pair for automating logons just press Enter twice.
3. Copy the public key from the client to the server

scp ./ssh/ username@server:.ssh/authorized_keys

The ssh-copy-id command, if it is available, can be used to copy the public key to the server as well.

ssh-copy-id username@server

4. Secure the .ssh folder on the server

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Change Linux Hostname

Edit the line that starts with “HOSTNAME” in the /etc/sysconfig/network file to reflect the new name

Echo the new host name to “/etc/hostname”

echo “” > /etc/hostname

All Distros
For both types of distributions update the “/etc/hosts” file so that the new name points to the loopback       localhost localhost