8/6/12

Linux RSH Server configuration

How to install and configure RSH Server on Linux

What is the RPM need to Installed

rsh-server-0.17-37.el5
rsh-0.17-37.el5
What is the RSH Server Config File:

#/etc/xinetd.d/rsh
#/etc/xinetd.d/rlogin
#/etc/xinetd.d/rexec
#/etc/securetty
#/root/.rhosts
#/etc/hosts
What is the Service need to be start:

#root@localhost#service xinetd restart
How To install RSH Server RPM

#root@localhost#mount 10.192.194.110:/work /mnt (mount it on Your Linux machine)
#root@localhost#cd /mnt/rhel5132/Server/
#root@localhost#rpm -ivh rsh-server-4.xxx.rpm
How to configure RSH Server on Linux

#root@localhost#vi /etc/xinetd.d/rsh
#service shell
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rshd
disable = yes
}
Note:change disable=yes to no and save
#root@localhost#vi /etc/xinetd.d/rlogin
service login
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rlogind
disable = yes
}
Note:change disable=yes to no and save
#root@localhost#vi /etc/xinetd.d/rexec
service exec
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rexecd
disable = yes
}
Note: Change disable=yes to no
#root@localhostservice xinetd restart (restart Service)
Add the Entry in vi /etc/securetty

#root@localhost#vi /etc/securetty
rsh
rlogin
rexec
#save restart service
#service xinetd restart
Add the entry vi /etc/hosts

#root@localhost#vi /etc/hosts
hostname ipaddress [ex rshserver]
hostname ipaddress [ex rsh client]
#save File
#root@localhost#vi /root/.rhosts
ipaddress root (ex:server)
ipaddress root (ex:client)
#save
#service xinetd restart (Restart the Service)
#chkconfig xinetd on
Make Sure to Stop Firewall Service:

#root@localhost#/etc/init.d/iptables stop
#root@localhost#/etc/init.d/iptables stop
#root@localhost#chkconfig iptables off
#root@localhost#chckconfig ip6tables off

Linux NFS Server Configuration

What is NFS Server

The Network File System (NFS) was developed to allow machines to mount a disk partition on a remote machine as if it were a local disk. It allows for fast, seamless sharing of files across a network

How to Configure NFSServer in Linux

#There is two way to configure NFS Server.
#Using NFS Server COnfiguration Tool (System-Config-NFS)
#manually Editing Configuration File vi /etc/exportfs
NFS Server Configuration Tool

#root@locathost#system-config-nfs
#Basic tab add the below details
#Directory — Specify the directory to share, such as /tmp.
#Host(s) — Specify the host(s) with which to share the directory.(bglinux or 138.239.197.10 or * to give everyone access)
#Basic permissions — Specify whether the directory should have read-only or read/write permissions.

#General tab->click checkbox Sync write operations on request
#Hide Filesystem beneath
Manually Editing NFS Server Configuration File vi /etc/exportfs

#root@localhost#vi /etc/exportfs
#root@localhost# /work *(ro,sync) (edit or delete and !wq save file)
#root@localhost#exportfs -a (reflect changes in NFS Server
Linux NFS configuration services

#root@localhost#etc/rc.d/init.d/portmap start
#root@localhost#/etc/rc.d/init.d/nfslock start
#root@localhost#/etc/rc.d/init.d/nfs start

Verify NFS Server is Running

#root@localhost#rpcinfo -p

FTP Server Configuration in Linux

Short for File Transfer Protocol, the protocol for exchanging files over the Internet or network.

How to start FTP Service

#root@localhost#/etc/init.d/vsftpd start
#root@localhost#/etc/init.d/vsftpd stop
#root@localhost#/etc/init.d/vsftpd restart

VSFTPD to start at boot you can use the chkconfig command
#root@localhost#chkconfig vsftpd on

Test the VSFTPD Server Status

#root@localhost#netstat -a | grep ftp
tcp 0 0 *:ftp *:* LISTEN
The vsftpd.conf File

VSFTPD only reads the contents of its vsftpd.conf configuration file you'll have to restart VSFTPD each time you edit the file in order for the changes to take effect. The file may be located in either the /etc or the /etc/vsftpd VSFTPD runs as an anonymous FTP server you want any remote user to log into to your default FTP directory using a username of anonymous and a password

#anon_root=/data/ftp
VSFTPD allows only anonymous FTP downloads to remote users, not uploads from them. This can be changed by modifying the anon_upload_enable VSFTPD doesn't allow anonymous users to create directories on your FTP server. You can change this by modifying the anon_mkdir_write_enable. VSFTPD logs FTP access to the /var/log/vsftpd.log log file. You can change this by modifying the xferlog_file directive. By default VSFTPD expects files for anonymous FTP to be placed in the /var/ftp directory

# Allow anonymous FTP?
anonymous_enable=YES
#The directory which vsftpd will try to change
#into after an anonymous login. (Default = /var/ftp)
anon_root=/data/directory
...
# Uncomment this to allow local users to log in.
local_enable=YES
...
#Uncomment this to enable any form of FTP write command.
#Needed even if you want local users to be able to upload files)
write_enable=YES
...
# Uncomment to allow the anonymous FTP user to upload files. This only
# has an effect if global write enable is activated. Also, you will
#obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
...
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
...
# Activate logging of uploads/downloads.
xferlog_enable=YES
...
# You may override where the log file goes if you like.
# The default is shown below.
xferlog_file=/var/log/vsftpd.log
Other vsftpd.conf Options

Limiting the maximum number of client connections (max_clients) Limiting the number of connections by source IP address (max_per_ip) The maximum rate of data transfer per anonymous login. (anon_max_rate) The maximum rate of data transfer per non-anonymous login. (local_max_rate)

The /etc/vsftpd.ftpusers File

you may restrict FTP access to certain users by adding them to the list of users in the /etc/vsftpd.ftpusers file

FTP Greeting Banner

ftpd_banner= Welcome to FTP Server

TFTP Server Configuration in Linux

TFTP Configuration File

/etc/xinetd.d/tftp
TFTP Server Service

service xinetd restart
How to configure TFTP Server for Linux

[root@bgpxetest ~]#vi /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot/
disable = yes (change to no)
per_source = 11
cps = 100 2
flags = IPv4
}
:wq
[root@bgpxetest ~]#service xinetd restart

Note: Pls make sure this Setting
Disable= yes change to NO
Server_args= -s /tftpboot pls make sure to change install path for while doing pxe installation
/tftpboot/linux-install

Loading Kernel Modules in Linux

Loading Kernel Modules

Linux allows the Kernel to be configured at run time, to enable or disable different services as you see fit

Module Commands

There are a few commands that allow you to maniuplate the kernel. Each is quickly described below, for more information say `man [command]`.
• depmod - handle dependency descriptions for loadable kernel modules.
• insmod - install loadable kernel module.
• lsmod - list loaded modules.
• modinfo - display information about a kernel module.
• modprobe - high level handling of loadable modules.
• rmmod - unload loadable modules

Using Module Commands

Below the different kernel module commands are demonstrated

# Show the module dependencies.
depmod -n

# Install some module

insmod [modname]
modprobe -v modename

# This lists all currently loaded modules, lsmod takes no useful parameters

lsmod

# Display information about module eepro100

modinfo modname

# Removing a module (don't use the example)

rmmod modname
modprobe -r modname

Module Configuration Files

The kernel modules can use two different methods of automatic loading. The first method (modules.conf) is my preferred method

/etc/modules.conf or /etc/modprobe.conf
/etc/rc.local