0

We've recently had a customer ask for this; I'm uncertain as to whether in the future they would require more than one user to access this fileshare, so I have set it up with groups. Can you cast your eyes over this set-up and see if I'm missing anything glaring or can do anything in a more secure manner? HOWTO script is for colleagues. Thanks.

WINDOWS - do this first:
Create shared folder <newshare>
Create fileshare user <newuser>

Share permissions on <newshare>:
    <newuser> read/write
    Advanced sharing | permissions - change, read.
Security:
    uncheck 'Full control' for <newuser>


Linux
sudo to root [$sudo -s]
Create new group - e.g. windowshare [$groupadd windowshare]
Create new folder - e.g. /mounts/windows
Create new user  and add to new group - e.g. customeruser [$useradd -m -d /home/customeruser -s /bin/bash -G windowshare -U customeruser]
Create folder 'cifs' in /etc
Change permissions on folder to 600 (user root)
Create .smbcredentials file in /etc/cifs with <newuser> windows credentials with user=<newuser> CR password=<password>
Create new line in /etc/fstab: //WINDOWSSERVER/share$ /mounts/windows cifs gid=windowshare,credentials=/etc/cifs/.smbcredentials,iocharset=utf8,sec=ntlm,file_mode=0770,dir_mode=0770 0 0
Put 'mount /mounts/windows' in /etc/rc.local to ensure shares mount at boot time if necessary.
run 'mount -a' as root
check customeruser user permissions on share:
    $su - customeruser [enter password]
    $cd /mounts/windows
    $touch testfile.txt [should see file appear on windows share]
    $mkdir testfilectory
    $rm -rf testfilectory
    $rm testfile.txt
    $exit
FiddleDeDee
  • 101
  • 2
  • Rather than creating local users you may want to investigate making your Linux servers integrate with Active Directory to allow you to use Kerberos authentication and single sign on i.e. https://fedorahosted.org/sssd/wiki/Configuring_sssd_with_ad_server – HBruijn Aug 03 '16 at 07:16
  • @HBruijn Hey there, thanks for the reply. As far as I know, there is no domain or AD in this setup, it is just a single server of each. Is it still worth setting up AD on the windows machine do you think? – FiddleDeDee Aug 03 '16 at 07:58
  • It was intended as food for thought, as too many Linux admins tend to overlook (re-) using an existing Windows/AD infrastructure. Setting up an AD domain has many benefits, but is only worth the effort if you have a number of workstations and servers which you want/need to centrally manage. – HBruijn Aug 03 '16 at 08:11

0 Answers0