mount shared folder on another CentOS

Issues related to configuring your network
Post Reply
RizONE
Posts: 9
Joined: 2018/07/27 10:52:41

mount shared folder on another CentOS

Post by RizONE » 2018/08/03 14:45:28

Hi
I need make shared folder on first CentOS and open it from 2nd CentOS. Both of them is Minimal.
On first:
yum install samba samba-common
chkconfig --level 345 smb on
service smb start
chmod -R 775 /tmp
/etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
host allow = 192.168.10.2

[tmp]
path = /tmp
browsable = yes
writable = yes
read only = no
guest ok = yes

service smb reload

On second:
yum install samba-client
mount -t cifs //192.168.10.1/tmp /tmp

and get error
mount: wrong fs type, bad option, bad superblock on....

What is going wrong?

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mount shared folder on another CentOS

Post by TrevorH » 2018/08/03 14:49:03

Did you open your firewall on the server machine to allow the right ports?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

RizONE
Posts: 9
Joined: 2018/07/27 10:52:41

Re: mount shared folder on another CentOS

Post by RizONE » 2018/08/03 14:53:11

firewall is disabled
[root@localhost samba]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)

Aug 02 05:51:31 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 02 05:51:31 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Aug 03 09:47:05 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
Aug 03 09:47:06 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost samba]#

RizONE
Posts: 9
Joined: 2018/07/27 10:52:41

Re: mount shared folder on another CentOS

Post by RizONE » 2018/08/03 15:06:57

after
yum install cifs-utils
on second centOS and its work! But asked a password

RizONE
Posts: 9
Joined: 2018/07/27 10:52:41

Re: mount shared folder on another CentOS

Post by RizONE » 2018/08/03 16:30:00

from client CentOS
[root@localhost mnt]# smbclient -L 192.168.10.1
Enter SAMBA\pkpvd's password:
Anonymous login successful

Sharename Type Comment
--------- ---- -------
pkpvd_opt Disk pkpvd Directories
IPC$ IPC IPC Service (Samba 4.7.1)
Reconnecting with SMB1 for workgroup listing.
Anonymous login successful
Server Comment
--------- -------
Workgroup Master
--------- -------
SAMBA LOCALHOST
WORKGROUP ADMIN

but steel can't mount it

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: mount shared folder on another CentOS

Post by hunter86_bg » 2018/08/04 13:05:06

Your SAMBA host is exporting "/tmp" but by default it has the following SELINUX context:
$ ls -lZd /tmp
drwxrwxrwt. root root system_u:object_r:tmp_t:s0 /tmp
Thus , I'm pretty sure that your SAMBA server cannot provide access to your client.
In order to verify that , run

Code: Select all

setenforce 0 && getenforce
Then just restart your smb and nmb services and try again.

RizONE
Posts: 9
Joined: 2018/07/27 10:52:41

Re: mount shared folder on another CentOS

Post by RizONE » 2018/08/06 08:34:55

SELINUX is turned off
After smbpasswd -a root on first CentOS I can get access to shared folder from second CentOS using
sudo mount -vt cifs //192.168.10.2/pkpvd_opt /opt

How should I configyre /etc/fstab on second CentOS?
//192.168.10.2/pkpvd_opt /opt ext4 defaults 0 0
Is that right?

Post Reply