Tuesday, August 13, 2013

yum setup on RHEL 6 and samba installation

Here are the quick steps:

mkdir -p  /var/OSimage/RHEL_6
 mount -o loop /ISO/rhel-server-6.4-x86_64-dvd.iso  /var/OSimage/RHEL_6

To make sure that the iso is mounted after each reboot make it permanent in the fstab file:

[root@RHEL-6 ~]# cat /etc/fstab

/ISO/rhel-server-6.4-x86_64-dvd.iso             /var/OSimage/RHEL_6 loop         defaults 0 0

Create a file:

vi /etc/yum.repos.d/rhel6.repo

[RHEL-6]
name=RedHat nterprise Linux 6
baseurl=file:///var/OSimage/RHEL_6
enabled=1
gpgcheck=0

save and exit

1 means enabled 0 means disabled. Here we are enabling the file:///var/OSimage/RHEL_6 as a yum repository.

Now run following two commands:

1. yum clean all
2. yum repolist

[root@RHEL-6 ~]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: RHEL-6
Cleaning up Everything

[root@RHEL-6 ~]# yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Bad id for repo: Raj's ISO Repository, byte = ' 3
RHEL-6                                                                                                                                                           | 3.9 kB     00:00 ...
RHEL-6/primary_db                                                                                                                                                | 3.1 MB     00:00 ...
repo id                                                                         repo name                                                                                         status
RHEL-6                                                                          RedHat nterprise Linux 6                                                                          3,648
repolist: 3,648

To test I installed samba - It will resolve the dependencies on ots own.

[root@RHEL-6 ~]# yum install samba
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Bad id for repo: Raj's ISO Repository, byte = ' 3
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package samba.x86_64 0:3.6.9-151.el6 will be installed
--> Processing Dependency: samba-winbind-clients = 3.6.9-151.el6 for package: samba-3.6.9-151.el6.x86_64
--> Processing Dependency: samba-common = 3.6.9-151.el6 for package: samba-3.6.9-151.el6.x86_64
--> Processing Dependency: libwbclient.so.0()(64bit) for package: samba-3.6.9-151.el6.x86_64
--> Running transaction check
---> Package samba-common.x86_64 0:3.6.9-151.el6 will be installed
---> Package samba-winbind-clients.x86_64 0:3.6.9-151.el6 will be installed
--> Processing Dependency: samba-winbind = 3.6.9-151.el6 for package: samba-winbind-clients-3.6.9-151.el6.x86_64
--> Running transaction check
---> Package samba-winbind.x86_64 0:3.6.9-151.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================================
 Package                                              Arch                                  Version                                         Repository                             Size
========================================================================================================================================================================================
Installing:
 samba                                                x86_64                                3.6.9-151.el6                                   RHEL-6                                5.0 M
Installing for dependencies:
 samba-common                                         x86_64                                3.6.9-151.el6                                   RHEL-6                                 10 M
 samba-winbind                                        x86_64                                3.6.9-151.el6                                   RHEL-6                                2.2 M
 samba-winbind-clients                                x86_64                                3.6.9-151.el6                                   RHEL-6                                2.0 M

Transaction Summary
========================================================================================================================================================================================
Install       4 Package(s)

Total download size: 19 M
Installed size: 68 M
Is this ok [y/N]: y
Downloading Packages:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                    24 MB/s |  19 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : samba-winbind-3.6.9-151.el6.x86_64                                                                                                                                   1/4
  Installing : samba-winbind-clients-3.6.9-151.el6.x86_64                                                                                                                           2/4
  Installing : samba-common-3.6.9-151.el6.x86_64                                                                                                                                    3/4
  Installing : samba-3.6.9-151.el6.x86_64                                                                                                                                           4/4
RHEL-6/productid                                                                                                                                                 | 1.7 kB     00:00 ...
  Verifying  : samba-winbind-clients-3.6.9-151.el6.x86_64                                                                                                                           1/4
  Verifying  : samba-winbind-3.6.9-151.el6.x86_64                                                                                                                                   2/4
  Verifying  : samba-3.6.9-151.el6.x86_64                                                                                                                                           3/4
  Verifying  : samba-common-3.6.9-151.el6.x86_64                                                                                                                                    4/4

Installed:
  samba.x86_64 0:3.6.9-151.el6

Dependency Installed:
  samba-common.x86_64 0:3.6.9-151.el6                      samba-winbind.x86_64 0:3.6.9-151.el6                      samba-winbind-clients.x86_64 0:3.6.9-151.el6

Complete!
[root@RHEL-6 ~]# rpm -qa | grep -i samba
samba-common-3.6.9-151.el6.x86_64
samba-winbind-3.6.9-151.el6.x86_64
samba-winbind-clients-3.6.9-151.el6.x86_64
samba-3.6.9-151.el6.x86_64










Monday, August 12, 2013

mount dvd - RHEL 6

Follow the following:

[root@RHEL-6 ~]# mount /dev/sr0 /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@RHEL-6 ~]# cd /mnt/
[root@RHEL-6 mnt]# ll
total 732
-rw-r--r-- 1 root root   5165 Feb 29  2012 blafdoc.css
drwxr-xr-x 3 root root   2048 Feb 29  2012 Cluster
drwxr-xr-x 3 root root   4096 Feb 29  2012 ClusterStorage
-rw-r--r-- 1 root root   6830 Feb 29  2012 EULA
-rw-r--r-- 1 root root   7041 Feb 29  2012 eula.en_US
-rw-r--r-- 1 root root   3334 Feb 29  2012 eula.py
-rw-r--r-- 1 root root  18390 Feb 29  2012 GPL
drwxr-xr-x 4 root root   2048 Feb 29  2012 images
drwxr-xr-x 2 root root   2048 Feb 29  2012 isolinux
-rw-r--r-- 1 root root   3547 Feb 29  2012 README-en
-rw-r--r-- 1 root root   7897 Feb 29  2012 README-en.html
-rw-r--r-- 1 root root  35456 Feb 29  2012 RELEASE-NOTES-en
-rw-r--r-- 1 root root  38444 Feb 29  2012 RELEASE-NOTES-en.html
-rw-r--r-- 1 root root   1397 Feb 29  2012 RPM-GPG-KEY
-rw-r--r-- 1 root root   1397 Feb 29  2012 RPM-GPG-KEY-oracle
drwxr-xr-x 4 root root 593920 Feb 29  2012 Server
-rw-r--r-- 1 root root    105 Feb 29  2012 supportinfo
-r--r--r-- 1 root root   4436 Feb 29  2012 TRANS.TBL
drwxr-xr-x 3 root root   8192 Feb 29  2012 VT

Thursday, August 1, 2013

SSH Passwordless login

This is tested on RHEL-6

run the following command to generate the public key and copy it over to the system where you want to login without password.

[root@RHEL-6 .ssh]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
ea:86:92:04:ac:35:21:e8:bf:9d:3c:72:26:f4:46:3a root@RHEL-6
The key's randomart image is:
+--[ RSA 2048]----+
|.                |
|o .              |
|o. .             |
|.oo              |
|.o..    S        |
|. .o . .         |
| ...B.o          |
|  oE.@.          |
|   .B.o          |
+-----------------+
[root@RHEL-6 .ssh]# ll

type in the following command now :

ssh-copy-id -i ~/.ssh/id_rsa.pub  rsangvik@cluster1

You would get the following message: And the  .ssh/authorized_keys is created automatically with th command

Now try logging into the machine, with "ssh 'rsangvik@cluster1'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[root@RHEL-6 .ssh]# ssh rsangvik@cluster1

See the prompt:

Last login: Thu Aug  1 10:25:28 2013 from rhel-6.example.com
-bash-3.2$ hostname
cluster1