Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Monday, November 21, 2011

Installing and Configuring RSH on Linux

I installed and configured RSH on CentOS release 5.5 . The steps would be almost same for all the other linux distros.

First you need to have xinetd installed. For that fire the following command:-

user@centos# yum install xinetd

Once its installed, you need to install rsh-server onto your machine. For that enter the following command:-

user@centos# yum install rsh-server

Now you need to Edit /root/.rhosts to add lists of hosts that can access without password. If you want to allow access to everyone without password, you need to put '+' in the file. A '+' indicates allowing everyone.
To do this, you can either modify the file by opening it or just enter the following command:-

user@centos# echo + > /root/.rhosts

Now you need to modify the permissions of .rhosts file. Enter the following command:-

user@centos# chmod 600 /root/.rhosts


Now you need to allow RSH , RLogin and Rexec to be used. For that you need to modify the /etc/xinetd.d/rsh , /etc/xinetd.d/rlogin  and /etc/xinetd.d/rexec file. Open these files one by one and then set the "disable=no"

Here is an example for modifying the rsh file:-

user@centos# vi /etc/xinetd.d/rsh


Similarly do for the rlogin and rexec file.
Once these are done, now you need to modify the /etc/pam.d/rsh file to allow passwordless rsh to the machine.

You need to modify the following line:-

     BEFORE: auth    required        pam_rhosts_auth.so
     AFTER : auth    required        pam_rhosts_auth.so promiscuous
Now you are done. You need to restart the xinetd service.
 
user@centos# /etc/init.d/xinetd restart
Now run the rsh command with the other commands and you will be able to successfully
execute them.
 If there are any warnings or errors as you are trying to access using the root 
privileges, then you need to modify the /etc/securetty file. Add rsh and rlogin 
to the bottom of that file.
Now you would be able to successfully perform rsh to the machine. 

Wednesday, November 9, 2011

Installing Lua on Linux

For installation, download the binaries, build them and install them. The steps for building and installing are listed below.

Download the Lua binaries from the site:-
1. Download the source: http://www.lua.org/ftp/lua-5.1.4.tar.gz
2. Extract the tar ball
3. Run this command from lua-5.1.4 directory: "make linux test"
------------------------------------------------------------------------------------------------------------------------
If you get an error that readline or history.h not found, then try installing the following package:-

sudo apt-get install libreadline6-dev
------------------------------------------------------------------------------------------------------------------------
To check what files exist in a package, use the following command:-
dpkg-query -L <package name>
Like:-
dpkg-query -L libreadline6

If you don’t find any header files and only .so files, then it means you are having the shared libraries and not the source. So you need to install the source files as well.

------------------------------------------------------------------------------------------------------------------------
To get the list of packages and their names if you don’t know, then one can search using the following command:-
sudo apt-get cache search readline

This will give you the list of all the packages containing the name readline
------------------------------------------------------------------------------------------------------------------------

How to build and install binaries from the package:-
Once the binaries are downloaded and the command “make linux test” is run, you need to now install the generated files.

For that enter the following command:-
sudo make install

This will install the Lua binaries to the required path.

Now you can run the files using the terminal.
user@ubuntu32$ which lua
/usr/local/bin/lua
user@ubuntu32$ lua
>