Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2021-02-21 03:30:24
Size: 722
Editor: PieterSmit
Comment:
Revision 4 as of 2021-03-12 09:41:26
Size: 1699
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
 * Use pam (plugable authentication manager) to mount the windows share on mount  * Use pam (pluggable authentication manager) to mount the windows share on mount
Line 18: Line 18:
-systemd.automount,x-systemd.device-timeout=10 x-systemd.automount,x-systemd.device-timeout=10
Line 20: Line 20:
   * after editing fstab, update systemd {{{
systemctl daemon-reload
systemctl restart remote-fs.target
}}}


==== 2b. Option: autofs (older) ====
 * specify root dir in /etc/auto.master {{{
/cifs /etc/auto.cifs --timeout=5
}}}
 * create map file /etc/auto.cifs (/!\ not executable) {{{
datadir -fstype="cifs,rw,uid={user},gid={group},username={user_win},password={pass_win)" ://192.168.20.22/c
}}}
 * debug autofs by stopping and running in terminal {{{
sudo service autofs stop
sudo automount -f -v
}}}

== Samba / smb - share/serve linux files ==
 * add to /etc/samba/smb.conf {{{
[Videos]
    comments = Home-Laptop-Videos
    path = /home/pes/Videos
    guest ok = no
    browseable = yes
    read only = yes
    create mask = 0600
    directory mask = 0700
}}}
 * restart smbd service {{{
$ sudo systemctl restart smbd.service
}}}
 * add smb password for user, seperate from normal linux password {{{
$ sudo smbpasswd -a <user>
}}}

Linux Smb/Cifs Autofs, Pam, Systemd

  • Mount Windows shares using smb protocol, 2020 linux now has cifs(smb) drive in the kernel don't need the fullh samba software suite to mount fs.

Goals

1. Goal: mount user directories from windows(cifs) on login

  • Use pam (pluggable authentication manager) to mount the windows share on mount

2. Goal: mount server share in fixed path

2a. Option: systemd.

  • Setup in /etc/fstab

    //192.168.20.22/c /home/{user}/cifs cifs rw,uid={user},gid={user},username={win_user},password={win_pass},x-systemd.automount,x-systemd.device-timeout=10 0 0
    • specific settings

      x-systemd.automount,x-systemd.device-timeout=10
    • after editing fstab, update systemd

      systemctl daemon-reload 
      systemctl restart remote-fs.target

2b. Option: autofs (older)

  • specify root dir in /etc/auto.master

    /cifs  /etc/auto.cifs --timeout=5
  • create map file /etc/auto.cifs (/!\ not executable)

    datadir -fstype="cifs,rw,uid={user},gid={group},username={user_win},password={pass_win)" ://192.168.20.22/c
  • debug autofs by stopping and running in terminal

    sudo service autofs stop
    sudo automount -f -v

Samba / smb - share/serve linux files

  • add to /etc/samba/smb.conf

    [Videos]
        comments = Home-Laptop-Videos
        path = /home/pes/Videos
        guest ok = no
        browseable = yes
        read only = yes
        create mask = 0600
        directory mask = 0700
  • restart smbd service

    $ sudo systemctl restart smbd.service
  • add smb password for user, seperate from normal linux password

    $ sudo smbpasswd -a <user>

Linux/SmbCifsAutofsPamSystemd (last edited 2022-03-08 23:49:12 by PieterSmit)