Search H3r3

Monday, 25 February 2019

Samba – How to set up a Samba client on CentOS/RHEL 7

Samba – How to set up a Samba client on CentOS/RHEL 7

If you have directories on your machine that you want to share out to other machines then you can do this by setting up your machine as an NFS server. However with NFS you can only share out folders to machine that are in the same private network. If you want share folders to other machines over the public internet, then that’s where you need to use the Samba/CIFS protocol. You can follow along this article using this vagrant project on Github.
We will walk through the following example:

+--------------------------+              +--------------------------+
|                          |              |                          |
|      samba-storage       |              |       samba-client       |
|     (IP: 10.0.4.10)      |              |                          |
|                          |              |                          |
|                          |              |                          |
|                          |              |                          |
|  +------------------+    |              |     +---------------+    |
|  | /samba/export_rw |<----------------------->| /mnt/dcp |    |
|  +------------------+    |              |     +---------------+    |
|                          |              |                          |
|                          |              |                          |
+--------------------------+              +--------------------------+
In this article we’ll cover setting up the samba client side. We cover setting up a Samba server in a separate article.

First you need to install the samba software:

$ yum -y install samba samba-client cifs-utils
 
Note: It’s recommended to install the samba server software on all samba
clients.

Then we create our mount point:

$ mkdir -p /mnt/dcp
 
Then we create a group that mirrors the same group that existing on the samba server:

$ groupadd --gid 2000 sambagroup
 
Now we need to add members to that group, in our case we’ll add the root user:

$ usermod -aG sambagroup root
 
Next we need check if we can connect to the samba server, and if we can to also check what shares are available:

$ smbclient -L //samba-storage.local -U samba_user1
Enter SAMBA\samba_user1's password:
 
 
 Domain=[SAMBA-STORAGE] OS=[Windows 6.1] Server=[Samba 4.6.2]

 Sharename       Type      Comment
 ---------       ----      -------
 print$          Disk      Printer Drivers
 bckp_storage    Disk      Folder for storing backups
 IPC$            IPC       IPC Service (Samba server samba-storage)
 samba_user1     Disk      Home Directories
Domain=[SAMBA-STORAGE] OS=[Windows 6.1] Server=[Samba 4.6.2]

 Server               Comment
 ---------            -------

 Workgroup            Master
 ---------            -------
Now we can test this by manually mounting this share like this:

$ mount -t cifs -o user=samba_user1,password=password123 //samba-storage.local/export_rw /mnt/dcp/
 
You can check if this command has worked using the mount or df -h commands.

To unmount this, do:

$ umount /mnt/dcp

If you has, then you automount this samba share at boot time by adding the following entry to the vi/etc/fstab file:

//samba-storage.local/bckp_storage /mnt/dcp  cifs  username=samba_user1,password=password123,soft,rw  0 0
 
To test this line, just run:

$ mount -a

Then check again if this has mounted successfully using mount or df -h commands. If all is well try creating dummy content in the mountpoint and see if the content also shows up on the samba server.

Monday, 18 February 2019

Mount Windows Share From Centos

The mount.cifs file is provided by the samba-client package. This can be installed from the standard CentOS yum repository by running the following command:


yum install samba samba-client
 
 
Once installed, you can mount a Windows SMB share on your CentOS server by running the following command:


Syntax:
mount.cifs //SERVER_ADDRESS/SHARE_NAME MOUNT_POINT -o user=USERNAME
 
SERVER_ADDRESS: Windows system’s IP address or hostname

SHARE_NAME: The name of the shared folder configured on the Windows system

USERNAME: Windows user that has access to this share

MOUNT_POINT: The local mount point on your CentOS server
I am mounting to a share from \\10.11.10.26\snaps
Make a directory under mount for your reference

mkdir /mnt/mymount
 
Now I am mounting the snaps folder from indiafps02, User name is the Domain credentials, i.e. Mydomain in this case

mount.cifs //10.11.10.26/snaps /mnt/mymount -o user=ajeeth,password=curve,dir_mode=0777,file_mode=0777
 
Now you could see the content by typing

ls /mnt/mymount
 
So, after performing your task, just fire umount command

umount /mnt/mymount
 
That's it. You are done.


Thursday, 7 February 2019

Remote Desktop CentOS7

RUN THIS CODING FIRST


1)  rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro 
 
2)  rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
 
3)  yum install rdesktop
 
 
CHECK RDESKTOP VERSION 
 
4)  rpm -qa rdesktop 
 
CONNECT REMOTE DESKTOP PC 

5)  rdesktop -u Ajeeth 192.168.50.5