Monday, May 17, 2010

Restrict root access on particular terminal in linux

There are 7 terminal through which user can login as a different or same user. It is sometimes required to restrict a user on a particular tty or terminal.
One can easily switch to various terminals using Ctrl + Alt + numeric key(1 to 6) and 7 is user to come back to GUI.
For this purpose a file "securetty" is used you just need to migrate to the file and and place # in front of a tty(1 to 6) on which you want to restrict the user to login as a root.
Various steps are:
1) open the terminal and open the file as
# vi /etc/securetty
2) Place # in front of the desired tty.
3) save and quit the file (press esc from insert mode and type :"wq!")

You are done.
Login to the terminal in front of which you placed #.
It will give you a error Login Failed!

Verified.....:)

Wednesday, May 12, 2010

Installing yum and creating repository

Yum can be installed for easy installation of rpm and to overcome various dependencies of rpm.
Various steps are:
1) Mount cd on any directory and then copy the rpm into the directory /var/ftp/pub/Server(create the directory ftp,pub,Server).
2) Goto the server directory and install the package using command
# rpm -ihv createrepo*
(createrepo is the name of the package and * is a wild card with any number of characters after the keyword)
3) Migrate to directory location /etc/yum.repose.d using command
# cd /etc.yum.repose.d
4) Open the file rhel-debuginfo.repo using the command
# vi rhel-debuginfo.repo
Make the necessary changes and the file should contain only this information.
Delete all other information

[Rhel]
baseurl:file///var/ftp/pub/Server
enabled=1
gpgcheck=1

5) #rm -fr .olddata/
It will give you instruction that old data need to be deleted manually.

You are done!!! wow:)
Now install any rpm package using #yum install
CAUTION: It is advisable to copy the file rhel-debuginfo.repo to any other location as a backup copy.