samba.org: mount.cifs — mount using the Common Internet File System (CIFS) Synopsis: mount.cifs {service} {mount-point} [-o options] https://www.samba.org/~ab/output/htmldocs/manpages-3/mount.cifs.8.html ------------------------------------- U:berpru:fen des gemounteten DIRs: cat /proc/mounts | grep fritzbox zeigt alle Optionen an -------------------------------------- Samba Client cifs ! ================= https://wiki.ubuntuusers.de/Samba_Client_cifs/ Dieser Artikel betrifft das Einbinden von Windows- bzw. Samba-Freigaben mit dem virtuellen Dateisystem CIFS-VFS in das lokale Dateisystem des Client. In vielen Fällen bietet auch das GVfs eine einfachere Alternative zum CIFS-VFS. Siehe hierzu gio mount und Samba Client GNOME. - Eintrag in /etc/fstab # Allgemein: /// cifs 0 0 # Beispiel: //192.168.1.100/Tausch /media/austausch cifs username=otto,passwd=geheim,domain=Gruppe1 0 0 //192.168.1.100/Tausch /media/austausch cifs credentials=/home/otto/.smbcredentials 0 0 //192.168.1.100/Tausch/WD /media/Fritz-NAS cifs credentials=/home/jules/.smbcredentials,vers=3.0,sec=ntlm,iocharset=utf8,file_mode=0644,dir_mode=0755,uid=1000,gid=100 0 0 # in fstab muss immer der komplette Pfad angegeben werden! Wird keine Authentifikationsdatei (credentials) und kein Benutzername angegeben, gilt der jeweils eingeloggte Benutzer. Das Passwort wird dann beim Einbinden interaktiv erfragt. Dies unterbleibt, wenn man die Option guest oder ein leeres Passwort einträgt. # Beispiel ohne Passwort (sinnvoll z.B. für USB Speicher ohne Passwort an einer Fritzbox) //192.168.178.1/Backup /media/Backup cifs password= 0 0 Simulierte Dateirechte: Die Simulation von Dateirechten mit den Optionen uid, gid, dir_mode und file_mode ist nur dann von Bedeutung, wenn die cifs-UNIX-Erweiterungen nicht aktiv sind. Sie wird weiter unten erklärt. Zeichensatz: Früher war es noch nötig, für Sonderzeichen in Datei- und Ordnernamen den verwendeten Zeichensatz anzugeben, z.B. iocharset=utf8. Dieser Zeichensatz ist inzwischen Standard, sodass man auf diese Option üblicherweise verzichten kann. - Temporäres Einbinden Falls ein Eintrag in fstab mit der Option noauto vorhanden ist, genügt die Befehlszeile sudo mount /media/austausch Ist kein Eintrag in fstab vorhanden, müssen alle Eingaben – mit etwas anderer Syntax – in die Befehlszeile übernommen werden: sudo mount -t cifs -o credentials=~/.smbcredentials //192.168.1.100/Tausch /media/austausch Persönlich bindet man Freigaben ohne Root-Rechte ein. Für /sbin/mount.cifs muss das SUID-Bit gesetzt sein (sudo chmod +s /sbin/mount.cifs , Der Einsatz des SUID-Bit ist eine mögliche Sicherheitslücke und sollte nur mit Bedacht verwendet werden.), und es muss ein Eintrag in fstab mit der Option user bzw. users und einem Mountpunkt bestehen, der Eigentum des einbindenden Benutzers ist, also z.B.: //192.168.1.100/Daten /home/otto/Daten cifs noauto,users,credentials=/home/otto/.smbcredentials 0 0 Dann genügt zum Einbinden die Befehlszeile: mount ~/Daten - Festes Einbinden ... - Persönliches Automount ... - Automount erst beim Zugriff Eine Möglichkeit, Freigaben nicht schon beim Systemstart oder beim Einloggen, sondern erst beim Zugriff automatisch einzubinden und sie auch automatisch wieder auszuhängen, wenn über längere Zeit kein Zugriff erfolgt, bietet das Tool Autofs. Seit Ubuntu 16.04 bietet auch systemd bereits standardmäßig diese Möglichkeit, allerdings mit weniger Optionen als Autofs. - Besitz- und Zugriffsrechte ------------------------------------------------------------------------------- https://help.ubuntu.com/community/Samba/SambaClientGuide Allow non-root users to mount SMB shares By default only root may mount SMB shares on the command line. To allow non-root users to mount SMB shares you could set the SUID, but I advise you configure sudo. You should configure sudo with visudo You may either allow the group "users" to mount SMB shares, or add a group, samba, and add users you wish to allow to mount SMB shares to the samba group. sudo groupadd samba sudo adduser user samba Change "user" to the username you wish to add to the samba group. sudo visudo In the "group" section add your group you wish to allow to mount SMB shares Add a line in the "group" section : ## Members of the admin group may gain root privileges %admin ALL=(ALL) ALL %samba ALL=(ALL) /bin/mount,/bin/umount,/sbin/mount.cifs,/sbin/umount.cifs Change "%samba" to "%users" if you wish to allow members of the users group to mount SMB shares. The following will mount the myshare folder on myserver to ~/mnt (it will be in your home directory): mkdir ~/mnt sudo mount -t cifs //myserver_ip_address/myshare ~/mnt -o username=samb_user,noexec Note: "samba_user" = the user name on the samba server (may be different from your log-in name on the client). The "noexec" option prevents executable scripts running from the SMB share. You will be asked for BOTH your sudo and then your samba_user password. To umount, sudo umount ~/mnt ------------------------------------------------------------- https://help.ubuntu.com/community/MountWindowsSharesPermanently Two methods, depending on share host cifs smbfs smbfs is the "original" method. However, smbfs is not compatible with security signatures, which are enabled by default and not recommended to disable on Windows Server 2003 and later. If a share is served by Windows Server 2003 or later, you should use cifs. sudo apt-get install cifs-utils Update the unmount order to prevent CIFS from hanging during shutdown. sudo update-rc.d -f umountnfs.sh remove sudo update-rc.d umountnfs.sh stop 15 0 6 see /media/sdb2/DATA/Html/g-h-o-de/Help/Linux/Samba