Showing posts with label RHEL. Show all posts
Showing posts with label RHEL. Show all posts

Sunday, March 14, 2010

How to break root password !!!

How to break root password !!!

1) When you reach the grub screen press 'e' on linux.
2) Go to line which contains the word 'kernel' press 'e'
3) go to the end of that line and write 'linux single' or '1'
4) then press 'esc' twice and press 'b' to reboot the system
5) now wait for the prompt and then type 'passwd root'
6) enter new passwd

1) Boot the computer with linux installation CD
2) Enter the linux rescue mode by entering the following command in boot screen
boot:linux rescue
3) When the sh prompt is reached, enter the following commands to change root password:
#chroot /mnt/sysimage
#passwd
The above step will prompt you to enter your new password

Tags: rhel rhel5 rhce rhct hack how to break root password

===================================================


O************************O***********************O

Thursday, January 14, 2010

Disk Quotas

Disk space can be restricted by implementing disk quotas which alert a system administrator before a user consumes too much disk space or a partition becomes full. Disk quotas can be configured for individual users as well as user groups. This makes it possible to manage the space allocated for user-specific files (such as email) separately from the space allocated to the projects a user works on (assuming the projects are given their own groups).
In addition, quotas can be set not just to control the number of disk blocks consumed but to control the number of inodes (data structures that contain information about files in UNIX file systems). Because inodes are used to contain file-related information, this allows control over the number of files that can be created.

* Features of quotas
1). Limits disk usage (blocks or inodes)
2). Tied to file systems (et on a per file system basis)
3). can be configured for users and groups

* Steps to enable quota support :-
1) Enable quota support per file system in : /etc/fstab
a) defaults,usrquota,grpquota
Example:
#vi /etc/fstab
/dev/Volgroup00/logVol02/home ext3 defaults,usrquota,grpquota 1 2

2) Remount the file system(s)
a) mount -o remount /
b) use 'mount' to confirm that 'usrquota, grpquota' support are enabled
Example:
#mount -o remount /home

3) Create quota database files and generate disk usage table
a) quotacheck -mcug / (where c-create, u-user, g- group)
This creates /aquota.user and aquota.group
b) quotacheck -mavu

4) Assign quota policies:
a) edquota username (set blocks/inodes, soft_limits, hard_limits)
Example:
edquota student1 (sets quotas for user student1)
b) edquota -g devl
(for group quota, check using #quota -g devl)

5) Check quotas
#quota username
Example:
#quota student1

6) Report on usage
#repquota -a

==> The blocks are measured in 1K increments, eg 20000 blocks is roughly 20 MB.

* To change the grace period of quota
#edquota -t

* Managing quotas
If quotas are implemented, they need some maintenance-mostly in the form of watching to see if the quotas are exceeded and making sure the quotas are accurate.

a) Enabling and disabling quotas
i) To turn all user and group quotas off
#quotaoff -vuag
If neither the -u and -g options are specified, only the user quotas are disabled. If only -g is specified, only group quotas are disabled. The -v switches causes verbose status informtion to display as the command executes.
ii) To enable quotas again:
#quotaon -vaug
To enable quotas for a specific file system, such as /home, use the following
#quotaon -vug /home
If neither the -u or -g options are specified, only the user quotas are enabled. If only -g is specified, only group quotas are enabled.

b) Reporting on Disk Quotas
#repquota -a

c) Keeping Quotas accurate
Whenever a file system is not unmounted clearly (due to a system crash, for eg), it is necessary to run quotacheck. Running the following command periodically keeps the quotas more accurate.
#quotacheck -avug
The easiest way to run it periodically is to use cron.


**********************************

Tuesday, January 12, 2010

YUM - Yellowdog Updater, Modified

The Yellowdog Updater, Modified (YUM) is an open-source command-line package-management utility for RPM-compatible Linux operating systems and has been released under the GNU General Public License.

Copy/Backup the RHEL5 DVD on the local hdd.
Mount DVD drive:
#mount /dev/cdrom /media
Now copy all the files from the DVD disk to the local Hard disk drive
#mkdir /var/ftp/pub/rhel5
#cp -avf /dev/media/* /var/ftp/pub/rhel5

To configure YUM server, following rpm's and services are required:

1.vsftpd->vsftpd-2.0.5.10.el5.i386.rpm
a). Run vsftpd rpm
#rpm -ivh vsftpd-*.rpm
b). iptables -I INPUT -p tcp --dport 20 -j ACCEPT
iptables -I INPUT -p tcp --dport 21 -j ACCEPT
iptables -I INPUT -p udp --dport 21 -j ACCEPT
iptables -I INPUT -p udp --dport 20 -j ACCEPT
c). For SELinux
setsebool allow_ftpd_full_access on
d). open the file :- vim
#vim /etc/sysconfig/iptables-config and modify below mention line
IPTABLES_MODULES="ip_conntrack_netbios_ns ip_conntrack_ftp"
Now your ftp server is ready to take the responsibilty of yum server.

2.createrepo -> createrepo-0.4.11-3.el5.noarch.rpm
#cd /var/ftp/pub/rhel5/Server
#rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
#cd..
#createrepo -vg /var/ftp/pub/rhel5/Server/repodata/comps-rhel5-server-core.xml Server

*****ON CLIENT MACHINE*****

#vim /etc/yum.repos.d/rhel-debuginfo.repo
[reposfile]
name= Updates
baseurl=ftp://ipaddress/pub
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY

Eg: #vim /etc/yum.repos.d/client.repo
{*you can use the following lines if configuring on a local PC*}
[server]
name=YUM configuration for the client PC
baseurl=ftp://127.0.0.1/pub/rhel5/Server
gpgcheck=0
====>>>>press esc key and type ->:wq - to save the file and exit from vim


*****************************************