Saturday, December 13, 2014

[Linux] Install EPEL repo in CentOS

List default repository CentOS on my server

CentOS-Base.repo

or you can check with this command

[root@vix3r ~]# ls -al /etc/yum.repos.d/
total 28
drwxr-xr-x 2 root root 4096 Dec 14 18:30 .
drwxr-xr-x 61 root root 4096 Dec 14 08:24 ..
-rw-r--r-- 1 root root 1926 Dec 14 19:07 CentOS-Base.repo
-rw-r--r-- 1 root root 638 Dec 14 19:07 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root 630 Dec 14 19:07 CentOS-Media.repo
-rw-r--r-- 1 root root 4528 Dec 14 19:07 CentOS-Vault.repo

[root@vix3r ~]# yum repolist enabled
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.freedomvoice.com
* extras: mirror.nwresd.org
* updates: mirror.stanford.edu
repo id repo name status name
base CentOS-6 - Base 6,367 Base
extras CentOS-6 - Extras 14 Extras
updates CentOS-6 - Updates 297 Updates
repolist: 6,678

INSTAL EPEL REPOSITORY

Download epel-release
Version 7 (64bit)
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uvh epel-release-7-5.noarch.rpm

Version 6.x (64bit)
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm

Version 6.x (32bit)
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm

Version 5.x (64bit)
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm

Version 5.x (32bit)
wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm

Version 4.x (64bit)
wget http://dl.fedoraproject.org/pub/epel/4/x86_64/epel-release-4-10.noarch.rpm
rpm -Uvh epel-release-4-10.noarch.rpm

Version 4.x (32bit)
wget http://dl.fedoraproject.org/pub/epel/4/i386/epel-release-4-10.noarch.rpm
rpm -Uvh epel-release-4-10.noarch.rpm


recheck repolist

[root@vix3r ~]# ls -al /etc/yum.repos.d/
total 44
drwxr-xr-x 2 root root 4096 Dec 14 19:07 .
drwxr-xr-x 70 root root 4096 Dec 14 19:07 ..
-rw-r--r-- 1 root root 2031 Dec 14 19:07 CentOS-Base.repo
-rw-r--r-- 1 root root 647 Dec 14 19:07 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root 289 Dec 14 19:07 CentOS-fasttrack.repo
-rw-r--r-- 1 root root 630 Dec 14 19:07 CentOS-Media.repo
-rw-r--r-- 1 root root 5394 Dec 14 19:07 CentOS-Vault.repo
-rw-r--r-- 1 root root 957 Dec 14 20:24 epel.repo
-rw-r--r-- 1 root root 1056 Dec 14 20:24 epel-testing.repo

[root@horcux ~]# yum repolist enabled
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vodien.com
 * epel: mirror.smartmedia.net.id
 * extras: mirror.vodien.com
 * updates: mirror.vodien.com
repo id repo name status
base CentOS-6 - Base 6,503+15
epel Extra Packages for Enterprise Linux 6 - x86_64 11,283
extras CentOS-6 - Extras 36
updates CentOS-6 - Updates 494
repolist: 18,577


Epel repo instaled :D

[Linux] Add user as Root

For example I will add user bejo6 as root
You need login as root first, then run this following command:


[root@linux]# /usr/sbin/useradd -u 0 -o -g root -G 1,2,3,6,10 -m bejo6
[root@linux]# passwd bejo6
[root@linux]# type your password
[root@linux]# retype your password
[root@linux]# service sshd restart


Finnaly login with new user, then check status with this command:
"whoami;id"

login as: bejo6
bejo6@bejo6.com's password:
Last login: Sat Dec 13 14:40:16 2014 from 127.0.0.1
[root@linux ~]# whoami;id
root
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),6(disk),10(wheel)
[root@linux ~]#