samba share on vpn network

samba share on vpn network

root@raspberrypi32:~# cat /etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
  workgroup = BRUNOCSMARTIN
  security = user

  passdb backend = tdbsam

  bind interfaces only = yes
  interfaces = 127.0.0.1 10.8.0.2/24 192.168.1.26/24

  wins support = yes
  name resolve order = wins lmhosts host bcast

  local master = yes
  preferred master = yes

  netbios name = IMPACTE

  veto files = /.DS_Store/._.DS_Store
  delete veto files = yes

  vfs objects = full_audit

  full_audit:prefix = %u|%I|%m|%S
  full_audit:success = mkdir rename unlink rmdir pwrite
  full_audit:failure = mkdir rename unlink rmdir pwrite
  full_audit:facility = local7
  full_audit:priority = NOTICE

[impacte]
  comment = "Imp'Acte"
  path = /home/impacte/impacte
	valid users = bmartin acdremont jpereira araschetti
	writable = yes

[impacte-admin]
  comment = "Imp'Acte Admin"
  path = /home/impacte/impacte-admin
	valid users = bmartin acdremont jpereira xguicherd araschetti
	writable = yes

Add user for samba share only (no home directory, no other rights)

root@localhost:~# useradd xguicherd
root@localhost:~# usermod -a -G impacte xguicherd
root@localhost:~# passwd xguicherd
root@localhost:~# smbpasswd -a xguicherd
root@localhost:~# systemctl restart smbd

CentOS and dev

You can create a virtual machine with VirtualBox, just download minimal install iso and start a vm with it. Installation is quite easy. The best is to use an ssh connection once system is setup.

you can use NAT network with VirtualBox, you’ll need to redirect port. Or you can use Bridge connection so that it will have is own address and will be visible on the LAN.

To change hostname seen on the LAN, type for naming it centos7-vm  :

[root@localhost]# hostnamectl set-hostname centos7-vm

Install extra package for extra applications (htop for instance) :

[root@localhost]# yum install -y centos-release-scl epel-release

install gcc environment

[root@localhost]# yum install -y devtoolset-7-gcc devtoolset-7-gcc-c++

install git

[root@localhost]# yum install -y git