Showing posts with label rpm. Show all posts
Showing posts with label rpm. 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

Wednesday 24 May 2017

Best Practical examples of RPM commands in linux

Basically Red Hat Package Manager (RPM) are a package management utility which are used for install, update , uninstall, query and verify of packages in Linux system like (RHEL,CentOS and Fedora).

Please find the below practical examples of rpm commands in Linux operating system.

➤ How to install an RPM packages.

To install the packages on Linux operating machine, please use the -i option for install. Please find the below example for installing the rpm.

[root@localhost]# rpm -ivh jdk-6u37-linux-amd64.rpm

Using above command you can install the rpm on linux operating machine. In the above command, -h print the has mark stat that package is archived and -v used as a verbose for better display.

➤ How to install an RPM packages without dependencies.

To install the packages on linux machine, please use --nodeps option. Please find the below example for installing the rpm without dependencies.

[root@localhost]# rpm -ivh --nodeps ftp-2.7.9-5.el6.2.i686.rpm

In above example, all the dependencies for installing the ftp server has been ignored.

➤ How to check a RPM signature.

To check the PGP signature of any rpm , please use the below command. This signature process is used for verification of the origin of rpm.

[root@localhost]# rpm --checksig jdk-6u37-linux-amd64.rpm

Using above command you can verify that the origin of installing rpm is valid. Normally this command is used before installing the rpm.

➤ How to check all installed rpm on Linux server.

To check the all installed rpm's on the linux machine, please use -q option. Please check the below example for checking all list.

[root@localhost]# rpm -q samba

Using above command you can find the all installed rpm related to packages.

➤ How to check recently installed RPM.

 To check the recently installed rpm, please use the -qa (query all) option. Please find the below example to check the recently installed rpm.

[root@localhost]# rpm -qa --last

The above command show you the list of all recently rpm in sequence of installation order. 

➤ How to list all installed RPM.

To check and print the list of all installed rpm on linux machine, use the below command.

[root@localhost]# rpm -qa

Command output show you the list of all installed packages on the linux machine.

➤ How to Upgrade a RPM Package.

If you want to upgrade already installed rpm on the linux machine, please check the command which is used in below example.

[root@localhost]# rpm -Uvh ftp-2.7.9-5.el6.2.i686.rpm

Here, -U option is used for upgrading the rpm packages which are installed on the linux machine.

➤ How to Remove a RPM Package.

To remove the package from linux server, you can use the -e option. Please find the below command with an example to remove the packages.

[root@localhost]# rpm -e ftp-2.7.9-5.el6.2.i686.rpm

You can use the below command syntax as well for removing the package from the linux machine.

 [root@localhost]# rpm -ev ftp

In last example, all the package dependencies are also removed with this command syntax.

➤ How to Remove a RPM Package without dependencies.

Please use the below command to remove a rpm package without removing any dependencies.

[root@localhost]# rpm -ev--nodeps samba

here, -nodeps command used for removing the package without any dependencies.

➤ How to query a information of Installed RPM package.

If you want to get all information regarding the installed rpm package, please use the -qi option. Please find the below example to query the information of installed rpm.

[root@localhost]# rpm -qi samba

Above command display all the information related to samba packages.

➤ How to verify a RPM package.

To verify a rpm package, please use the -Vp (Verify Package) option. Please check the below example to verify the package.

[root@localhost]# rpm -Vp ftp-2.7.9-5.el6.2.i686.rpm

Using this command you can verify the package.

Please let me know, if you have any concern regarding this topic.