Posts Tagged ‘centos’

Directory Disk Space in Linux

Running Linux distribution Centos 4.6, I need to check the disk space available in a directory. For this, I use the command df, which reports the file system disk space usage.

df
This command returns the file system, the mount directory, total disk space, used disk space, and available disk space (in 1-K blocks) based on currently mounted directories.

df -h
This command returns the file system, the mount directory, total disk space, used disk space, and available disk space (in MB and GB blocks) based on currently mounted directories.

df /to/directory
This command returns the file system, the mount directory, total disk space, used disk space, and available disk space (in 1-K blocks) based the stated /to/directory.

df /to/directory -h
This command returns the file system, the mount directory, total disk space, used disk space, and available disk space (in MB and GB blocks) based the stated /to/directory.

Install Package Updates from the Linux Shell

Installing updates from the Linux Shell is very simple in CentOS 4 and RHEL4 (with a valid subscription). Below are two of the most commonly used methods.

The first method can be dangerous, is easier because it is a non-interactive installation. It automatically assumes yes to all prompts.

yum -y update

The second method is safer and is exactly the same as the first method, except it will prompt you at specified parts of the installation process.

yum update

Install And Configure RLogin on CentOS 4

The below instructions for installing rlogin have been confirmed for CentOS. This means there is a very high probability it is compatible with a registered copy of Red Hat Enterprise Linux 4 (rhel4).

ENSURE RSH PACKAGES INSTALLED

The first step is to insure you have the correct packages installed. To do this, simply type the following in the terminal.

rpm -qa | grep -i rsh

The following should return two packages similar to:

rsh-server-0.17-25.3
rsh-0.17-25.3

If you are missing any of the above packages, run the code below to have the appropriate two rsh packages installed using yum.

yum install rsh*

EDIT FILE: /etc/xinetd.d/rsh
The most common changes are in red, though you should still confirm the rest of the file.

# default: off
# description:
# The rshd server is a server for the rcmd(3) routine and,
# consequently, for the rsh(1) program. The server provides
# remote execution facilities with authentication based on
# privileged port numbers from trusted hosts.
service shell
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rshd
disable = no
}

EDIT FILE: /etc/xinetd.d/rlogin
The most common changes are in red, though you should still confirm the rest of the file.

# default: off
# description:
# Rlogind is a server for the rlogin program. The server provides remote
# execution with authentication based on privileged port numbers from trusted
# host
service login
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rlogind
disable = no
}

EDIT FILE: /etc/xineted.d/rexec
The most common changes are in red, though you should still confirm the rest of the file.

# default: off
# description:
# Rexecd is the server for the rexec program. The server provides remote
# execution facilities with authentication based on user names and
# passwords.
service exec
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rexecd
disable = no
}

EDIT FILE: /etc/securetty
The most common changes are in red, though you should still confirm the rest of the file.

console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
ttyS0
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
rsh
rlogin
rexec

RESTART THE RSH-SERVER SERVICE
To restart, one of the the following two commands below. One restarts the service while the other starts again.

/etc/init.d/xinetd start
/etc/init.d/xinetd restart