Showing posts with label Yum. Show all posts
Showing posts with label Yum. Show all posts

Sunday, 29 April 2018

How to install and configure samba server in RHEL 7 or redhat linux 7

Login on Samaba server
Check samba rpm installed or not, if not installed please install it,

[root@localhost ~]# rpm -qa | grep samba
[root@localhost ~]# yum install samba*

Create a directory in root file system which is shared with client.

[root@localhost ~]#mkdir -p /home/testuser/test

Add a new group or can use existing group

To provide access on shared directory,Here we are adding new group called samba

[root@localhost ~]#groupadd samba

Change the group and permission of sharing folder

[root@localhost ~]#chgrp -R samba /home/testuser/test
[root@localhost ~]#chmod -R 777 /home/testuser/test

create user, add into group and set samba password

[root@localhost ~]#useradd testuser
[root@localhost ~]#usermod -G samba testuser
[root@localhost ~]#smbpasswd -a testuser

Now Edit /etc/samba/smb.conf file

Note: Please take a backup of origianl file.

[root@localhost ~]#cd /etc/samba/
[root@localhost ~]#cp -p smb.conf smb.conf.orig

And add the below given contents in last line of /etc/samba/smb.conf file.

vi /etc/samba/smb.conf

[test]
comment = shared-directory
path = /home/testuser/test
public = no
valid users = testuser, @samba
writable = yes
browseable = yes
create mask = 0774
directory mask = 4774

##Edit these lines in /etc/samba/smb.conf . To allow network to reach samba server

interfaces = lo ens32 192.168.1.0/24
hosts allow = 127. 192.168.1.

security = user
passdb backend = tdbsam
netbios name = localhost
server string = Samba Server localhost
workgroup = MYGROUP
log file = /var/log/samba/samba.log
max log size = 50
security = server

Add services in /etc/services files

vi /etc/services
 
netbios-ns    137/tcp    # netbios name service
netbios-ns    137/udp    # netbios name service
netbios-dgm    138/tcp    # netbios datagram service
netbios-dgm    138/udp    # netbios datagram service
netbios-ssn    139/tcp    # netbios session service
netbios-ssn    139/udp    # netbios session service

Note: Please check these above ports are open from this samba server to client machine

Now start the smb and nmb services.

systemctl start smb.service
systemctl start nmb.service

Enable smb and nmb service at booting of system

systemctl enable smb.service
systemctl enable nmb.service

Note 1: firewalld service not enable on this server so no need to add any rule.
Note 2: selinux is in permissive state so no need to change the selinux security context.

Now login on window machine

and mount this samba share on the server.

\\localhost.redhat.com\test

Thursday, 31 August 2017

ifconfig command not found in centos 7 minimal installation

By default in Centos 7 minimal installation , ifconfig command is not found, so for obtaining this command , first you need to check which packages yum provide for this.

[root@localhost]# yum provides ifconfig

Loaded plugins: fastestmirror
Repository 'Packages' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
Packages/filelists_db                                                                                                                              
No matches found

Note: here no packages is installed on the system.

So, using yum we will install the net-tool rpm which is required for ifconfig command

[root@localhost]# yum install net-tools*

Loaded plugins: fastestmirror
Repository 'Packages' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package                  Arch           Version                                   Repository                    Size

Installing:
 net-tools                x86_64         2.0-0.17.20131004git.el7         Packages                        304 k

Transaction Summary
========================================================================
Install  1 Package

Total download size: 304 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : net-tools-2.0-0.17.20131004git.el7.x86_64                                                                     1/1
Verifying  : net-tools-2.0-0.17.20131004git.el7.x86_64                                                                    1/1

Installed:
net-tools.x86_64 0:2.0-0.17.20131004git.el7

Complete!

Now run the ifconfig command after successfully installed the packages.

[root@localhost]# ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.26.12.1  netmask 255.255.0.0  broadcast 192.26.255.255
        inet6 fe80::250:56ff:febf:f6  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:bf:00:f6  txqueuelen 1000  (Ethernet)
        RX packets 18939  bytes 1251073 (1.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 433  bytes 63109 (61.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost]# yum provides ifconfig

Loaded plugins: fastestmirror
Repository 'Packages' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo: @Packages
Matched from:
Filename: /usr/sbin/ifconfig

Sunday, 14 May 2017

How to configure YUM Server in Red Hat Linux 7 Operating System

This is my first post, hope you are like my blog content. I am trying to provide you the simple and straight forward solution on this post.

In this post, I will guide to you, how to configure YUM server in Red Hat Linux 7 operating system. Yum tends for Yellowdog Updater Modified utility which used for package management system on Linux environment. In the below post, you can find the step by step method of configuration and installation of YUM.

Step by Step Method of Installation & Configuration of YUM:

➤ If you have Red Hat Linux 7 operating system image or cd, then please mount this iso or cd on cdrom device of operating system.

[root@localhost]# mount -o loop /dev/cdrom /mnt

In above command syntax, you can able to see we have mount the our Red Hat Linux 7 operating system image on /mnt file system. Normally /mnt file system are used for mounting purpose only but its depends upon every user understanding.

➤ Please create a directory where you want to copy the all packages files for configuration of YUM server.

[root@localhost]# mkdir /"Directory Name"

In linux operating system mkdir command are used for creating a directory. In my case I normally use "/yumserver" name for YUM configuration. When you create a directory please change your directory name.

➤  Please copy the all files from "/mnt" directory to /"Directory Name".

[root@localhost]# cp -rvf /mnt/* /"Directory Name"

Using this command all the packages files are copied on the other place, you need to keep save this directory otherwise your YUM configuration is not works.

➤ In this step, we will go the the packages directory and install the required rpm packages which are required for installation of YUM server.

[root@localhost]# cd /yumserver/Packages

You can use your directory name to reach the packages folder. Now once we reached in this directory then we will install the required rpm packages one by one in below sequence.

[root@localhost]# rpm -ivh deltarpm-3.6-3.el7.x86_64.rpm
[root@localhost]# rpm -ivh python-deltarpm-3.6-3.el7.x86_64.rpm
[root@localhost]# rpm -ivh createrepo-0.9.9-23.el7.noarch.rpm

If you are trying to install the above rpm packages and not follow the above installation of rpm's in same sequence then you are definitely getting an dependency error.

➤ For creating a repo packages, you need to createrepo of all the packages, for this please run the below command on your terminal window.

[root@localhost]# createrepo  –v /yumserve/Packages

Please change the yum directory name which you used in above steps. Using this command all the packages repo has been created on the yum directory.

➤ Create a repo file on the below directory location. Please used the valid name while creating a repo file.

[root@localhost]# cd /etc/yum.repos.d/
[root@localhost]# vi yumserver.repo

You can change the repo file name according to your feasibility. Now please write the below entry inside this file.
#########################
[Packages]
baseurl=file:///yumserver/Packages 
gpgcheck=0
enable=1
########################

This is the main file content, so please more careful while doing the entry in this file. You can change the baseurl location as per your YUM packages directory location. After saving the file go for final step.

➤  In final step, as you configured the YUM configuration file, now you need to clean your yum repo and used it for installation the packages.

[root@localhost]# yum clean all

When you run this command , some space from /var file system get free, actually during packages installation /var file system get increase sometimes.

[root@localhost]# yum list

above command show you all the yum repo which exist on this server. In our case you can find the yumserver repo.

To test the yum server is configured properly or not then please run the below command to installed the any packages on the server using yum commands.

[root@localhost]# yum install samba*

When you run this command, if all the packages related to yum are installed that's means your YUM server installation and configuration are successful. If you are see any error then please check the above all steps configuration one by one.