• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

[Gelöst] Netz einrichten

OP
lewendi

lewendi

Advanced Hacker
@susejunky
Code:
walter@Walter-Desk:~$ systemctl status smbd
● smbd.service - Samba SMB Daemon
     Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-02-02 12:11:18 CET; 3h 47min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 4959 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 4 (limit: 18989)
     Memory: 15.1M
     CGroup: /system.slice/smbd.service
             ├─4959 /usr/sbin/smbd --foreground --no-process-group
             ├─4961 /usr/sbin/smbd --foreground --no-process-group
             ├─4962 /usr/sbin/smbd --foreground --no-process-group
             └─4963 /usr/sbin/smbd --foreground --no-process-group

Feb 02 12:11:18 Walter-Desk systemd[1]: Starting Samba SMB Daemon...
Feb 02 12:11:18 Walter-Desk systemd[1]: Started Samba SMB Daemon.
Feb 02 12:43:11 Walter-Desk smbd[9230]: pam_unix(samba:session): session closed for user nobody
Feb 02 12:44:17 Walter-Desk smbd[9619]: pam_unix(samba:session): session closed for user nobody
Feb 02 12:58:38 Walter-Desk smbd[10530]: pam_unix(samba:session): session closed for user nobody
Feb 02 13:00:04 Walter-Desk smbd[10777]: pam_unix(samba:session): session closed for user nobody
Feb 02 14:34:37 Walter-Desk smbd[14711]: pam_unix(samba:session): session closed for user nobody
Feb 02 14:36:20 Walter-Desk smbd[14922]: pam_unix(samba:session): session closed for user nobody
walter@Walter-Desk:~$


@spoensche
Wie ich schon weiter oben geschrieben habe, ich habe keinen User und kein PW angelegt.
 

susejunky

Moderator
Teammitglied
Hallo lewendi,


lewendi schrieb:
...
Code:
walter@Walter-Desk:~$ systemctl status smbd
● smbd.service - Samba SMB Daemon
     Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-02-02 12:11:18 CET; 3h 47min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 4959 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 4 (limit: 18989)
     Memory: 15.1M
     CGroup: /system.slice/smbd.service
             ├─4959 /usr/sbin/smbd --foreground --no-process-group
             ├─4961 /usr/sbin/smbd --foreground --no-process-group
             ├─4962 /usr/sbin/smbd --foreground --no-process-group
             └─4963 /usr/sbin/smbd --foreground --no-process-group

Feb 02 12:11:18 Walter-Desk systemd[1]: Starting Samba SMB Daemon...
Feb 02 12:11:18 Walter-Desk systemd[1]: Started Samba SMB Daemon.
Feb 02 12:43:11 Walter-Desk smbd[9230]: pam_unix(samba:session): session closed for user nobody
Feb 02 12:44:17 Walter-Desk smbd[9619]: pam_unix(samba:session): session closed for user nobody
Feb 02 12:58:38 Walter-Desk smbd[10530]: pam_unix(samba:session): session closed for user nobody
Feb 02 13:00:04 Walter-Desk smbd[10777]: pam_unix(samba:session): session closed for user nobody
Feb 02 14:34:37 Walter-Desk smbd[14711]: pam_unix(samba:session): session closed for user nobody
Feb 02 14:36:20 Walter-Desk smbd[14922]: pam_unix(samba:session): session closed for user nobody
walter@Walter-Desk:~$
Der SAMBA-Server ist also aktiv.

In der von Dir gezeigten Datei /etc/samba/smb.conf kann ich aber keine Freigabe (Verzeichnis) erkennen.

Wenn Du den Link aus meinem letzten Beitrag durch gehst, dann siehst Du, dass etwas wie
Code:
[sambashare]
    comment = Samba on Ubuntu
    path = /home/username/sambashare
    read only = no
    browsable = yes
in dieser Datei zu finden sein müsste.


lewendi schrieb:
... Ich habe in "Dolphin" -> das Laufwerk angeklixt was ich freigeben will -> dann "Freigabe" -> dann "diesen Ordner für andere Rechner im Netzwerk freigeben" fertig.
Das verstehe ich nicht. Kannst Du dazu bitte ein Bildschirmfoto zeigen?

Viele Grüße

susejunky
 
OP
lewendi

lewendi

Advanced Hacker
Der Ordner D-Daten-Linux Freigeben
https://up.picr.de/42949169eb.jpg

Dann Aufrufen und PW Eingabe -was ich aber nicht habe root-PW geht nicht
https://up.picr.de/42949171nu.jpg
 

admine

Ultimate Guru
lewendi schrieb:
Der Ordner D-Daten-Linux Freigeben
https://up.picr.de/42949169eb.jpg
Ich finde das ja äußerst interessant und wusste bis eben noch gar nichts von dieser Möglichkeit der Freigabe - funzt bei mir auch nicht.

An deiner Stelle würde ich die Konfiguration mal über "YaST - Netzwerk-Dienste - Samba-Server" erstellen.
Evt. kommst du so eher zum Ziel.
 

susejunky

Moderator
Teammitglied
Hallo lewendi,


lewendi schrieb:
Der Ordner D-Daten-Linux Freigeben
https://up.picr.de/42949169eb.jpg

Dann Aufrufen und PW Eingabe -was ich aber nicht habe root-PW geht nicht
https://up.picr.de/42949171nu.jpg
diese Art der "Netzwerk-Freigabe" steht bei meinem openSUSE Tumbleweed System nicht zur Verfügung (das kann meiner "Minimal-Installation" geschuldet sein).

Die hier für Ubuntu beschriebene Vorgehensweise entspricht dem, wie ich meine SAMBA-Freigabe unter Tumbleweed erstellt habe (und sie funktioniert einwandfrei). Also orientiere Dich einfach an dieser Beschreibung.

Viele Grüße

susejunky
 
OP
lewendi

lewendi

Advanced Hacker
Hi, susejunky
ich habe es nach Deiner Anleitung gemacht und das Funktioniert.
Was allerdings nicht geht, sind die Schreibrechte.

In der smb.conf habe ich folgende Zeilen eingefügt:

Code:
[sambashare]
  comment = Samba on Ubuntu
    path = /home/walter/sambashare
    read only = no
    browsable = yes
   
   
[D-DATEN-LINUX]
  comment = Samba on Ubuntu
    path = /media/walter/D-DATEN-LINUX/
    read only = no
    browsable = yes
   
[D-DATEN-WINDOWS]
  comment = Samba on Ubuntu
    path = /media/walter/D-DATEN-WINDOWS/
    read only = no
    browsable = yes

Der 1. Block funktioniert, da liegt ja das Verzeichnis im /home/walter
bei den beiden anderen, welches 2 Partitionen sind geht das schreiben nicht.

Hast Du da noch eine Lösung?
 

susejunky

Moderator
Teammitglied
Hallo lewendi,


lewendi schrieb:
... Was allerdings nicht geht, sind die Schreibrechte.
das kann an den Zugriffsrechten liegen.

Setze in Deiner smb.conf bei den beiden Freigaben
Code:
writeable = yes
und wenn das nicht hilft, zeige bitte die Ergebnisse von
Code:
ls -la /media/walter/D-DATEN-LINUX
und
Code:
ls -la /media/walter/D-DATEN-WINDOWS

Viele Grüße

susejunky
 
OP
lewendi

lewendi

Advanced Hacker
Code:
writeable = yes
Hat nix gebracht

ls -la /media/walter/D-DATEN-LINUX

Code:
walter@Walter-Desk:~$ ls -la /media/walter/D-DATEN-LINUX
insgesamt 22721
drwxrwxrwx  1 walter walter     8192 Feb  3 17:05  .
drwxr-x---+ 4 root   root       4096 Feb  4 10:01  ..
drwxrwxrwx  1 walter walter     4096 Dez 15 17:46 '$RECYCLE.BIN'
drwxrwxrwx  1 walter walter     4096 Dez  5 15:21  Asprovalta
drwxrwxrwx  1 walter walter    40960 Nov 22 13:15 'ASUS -Bios'
drwxrwxrwx  1 walter walter     4096 Mär 31  2015  Cloud
-rwxrwxrwx  1 walter walter      471 Okt  5 16:53  Darknet.txt
drwxrwxrwx  1 walter walter    28672 Feb  1 13:07  Doc
drwxrwxrwx  1 walter walter     8192 Dez  5 16:15  Foto
drwxrwxrwx  1 walter walter        0 Feb  3  2020  Fritzbox-6490
drwxrwxrwx  1 walter walter     4096 Nov 18 16:20  Fritzbox-6590
drwxrwxrwx  1 walter walter        0 Dez  5 17:24 'Fritzbox ⁄ Router-GR'
drwxrwxrwx  1 walter walter     4096 Jan 20 13:35  grub2
drwxrwxrwx  1 walter walter     4096 Jan  4 11:48  Iso
-rwxrwxrwx  1 walter walter   175088 Okt  3  2019  libifd-cyberjack6_3.99.5final.sp13_amd64_u1804.deb
-rwxrwxrwx  1 walter walter    24519 Jan 20 16:02  linux-brprinter-installer-2.2.3-1.gz
drwxrwxrwx  1 walter walter     4096 Jan 19 16:06  Moneyplex-Linux
drwxrwxrwx  1 walter walter        0 Sep 25 18:59  Recovery
-rwxrwxrwx  1 walter walter  1562767 Jan 31 12:50  solar02.png
drwxrwxrwx  1 walter walter     4096 Okt 10 17:04 'System Volume Information'
-rwxrwxrwx  1 walter walter 13837520 Sep 13  2019  teamviewer_14.5.5819_amd64.deb
drwxrwxrwx  1 walter walter        0 Jan 10  2015  Toshiba
drwxrwxrwx  1 walter walter        0 Nov 18 16:25  .Trash-0
drwxrwxrwx  1 walter walter        0 Aug  8  2019  .Trash-1000
-rwxrwxrwx  1 walter walter  7205834 Aug 11  2019  tvbrowser_4.0.1-1_all.deb
drwxrwxrwx  1 walter walter     4096 Okt 30 13:04  upcam-07.2021
drwxrwxrwx  1 walter walter   315392 Feb  1 15:03  Video-Aspro
drwxrwxrwx  1 walter walter     4096 Sep  4 12:10 'Video-Aspro 19.9.21 -30.8.21'
drwxrwxrwx  1 walter walter     4096 Jan 16 17:20 'WICHTIGE DATEIEN'
walter@Walter-Desk:~$

Das ist aber komisch, dass die Datei /media/walter/D-DATEN-LINUX nicht da ist. Im Dolphin ist sie aber genau in dem Pfad.
 

susejunky

Moderator
Teammitglied
Hallo lewendi,


lewendi schrieb:
... Hat nix gebracht
Verstehe ich das richtig:

Du kannst die Freigabe lesen, nur nicht schreiben?

Von welchem Betriebssystem aus und mit welchem Benutzer versuchst Du auf die Freigabe zuzugreifen (z.B. MS Windows 10, Benutzer "walter")?

Welche Anwendung verwendest Du für den Zugriff (z.B. Explorer)?

Viele Grüße

susejunky
 
OP
lewendi

lewendi

Advanced Hacker
So ist es, ich kann von smb://walter-desk.local/D-DATEN-LINUX/ Daten ins /home kopieren, das geht, in die andere Richtung aber nicht.
https://up.picr.de/42957686fo.jpg
 

susejunky

Moderator
Teammitglied
lewendi schrieb:
So ist es, ich kann von smb://walter-desk.local/D-DATEN-LINUX/ Daten ins /home kopieren, das geht, in die andere Richtung aber nicht.
https://up.picr.de/42957686fo.jpg
Sehe ich das richtig:

smb://walter-desk.local/D-DATEN-LINUX/ ist die Freigabe, welche die laufende SAMBA-Instanz zur Verfügung stellt (loopback-Zugriff)?

Welcher SAMBA-Benutzer ist dabei aktiv?

Viele Grüße

susejunky
 

susejunky

Moderator
Teammitglied
Hallo lewendi,

wenn Du lediglich die hier gezeigte smb.conf ergänzt hast, dann ist meine Vermutung:

security = fehlt (entspricht security = auto), also wird der Wert aus server role = abgeleitet. server role = fehlt ebenfalls, also wird security = user angenommen.

Damit muss sich jeder Benutzer, der auf eine Freigabe zugreifen will, authentifizieren (Benutzername/Kennwort). Benutzer, die sich nicht authentifizieren, werden aufgrund von map to guest = bad user über das Gast-Konto angemeldet.

Da guest account = auch nicht gesetzt ist, wird sehr wahrscheinlich das Benutzerkonto nobody als Gast-Konto verwendet und das hat vermutlich keine Schreibrechte auf /media/walter/D-DATEN-LINUX.

Es wäre interessant zu wissen, ob Du auf die Freigabe schreiben kannst, wenn Du Dich (idealerweise von einem anderen Rechner im Netzwerk aus) mit einem Benutzernamen/Kennwort anmeldest.

Viele Grüße

susejunky
 
OP
lewendi

lewendi

Advanced Hacker
Meine smb.conf

Code:
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which 
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic 
# errors. 

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
   server string = %h server (Samba, Ubuntu)

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
   logging = file

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller". 
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set 
#

# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe.  
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.  
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap config * :              backend = tdb
;   idmap config * :              range   = 3000-7999
;   idmap config YOURDOMAINHERE : backend = tdb
;   idmap config YOURDOMAINHERE : range   = 100000-999999
;   template shell = /bin/bash

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 means that usershare is disabled.
#   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
;   comment = Home Directories
;   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
;   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only "username"
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
;   valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin



[sambashare]
  comment = Samba on Ubuntu
    path = /home/walter/sambashare
    read only = no
    browsable = yes
   
   
[D-DATEN-LINUX]
  comment = Samba on Ubuntu
    path = /media/walter/D-DATEN-LINUX/
    read only = no
    browsable = yes
    writeable = yes
    
[D-DATEN-WINDOWS]
  comment = Samba on Ubuntu
    path = /media/walter/D-DATEN-WINDOWS/
    read only = no
    browsable = yes
    writeable = yes
 
OP
lewendi

lewendi

Advanced Hacker
Habe mal security eingefügt geht auch nicht.

Code:
[D-DATEN-LINUX]
  comment = Samba on Ubuntu
    path = /media/walter/D-DATEN-LINUX/
    read only = no
    browsable = yes
    writeable = yes
    security = auto
    
[D-DATEN-WINDOWS]
  comment = Samba on Ubuntu
    path = /media/walter/D-DATEN-WINDOWS/
    read only = no
    browsable = yes
    writeable = yes
    security = auto

Vom meinen Notebook aus, habe ich auch keine Schreibrechte.
 

susejunky

Moderator
Teammitglied
Hallo lewendi,


lewendi schrieb:
Habe mal security eingefügt geht auch nicht.
Code:
[D-DATEN-LINUX]
  comment = Samba on Ubuntu
    path = /media/walter/D-DATEN-LINUX/
    read only = no
    browsable = yes
    writeable = yes
    security = auto

...
security = ist ein Parameter für den Abschnitt [global]; d.h. er bestimmt das Verhalten des SAMBA-Servers und nicht der einzelnen Freigabe . Siehe auch
Code:
man smb.conf
Und wie ich bereits gesagt habe security = auto entspricht security = user mit den sich daraus ergebenden Konsequenzen.


lewendi schrieb:
Vom meinen Notebook aus, habe ich auch keine Schreibrechte.
Wie hast Du von Deinem Notebook aus auf die Freigabe zugegriffen?

Anmeldung als "Gast" oder mit "Benutzername/Kennwort"?
Die Freigabe per mount eingebunden oder über dolphin darauf zugegriffen oder über MS Windows Dateiexplorer?

Viele Grüße

susejunky
 
OP
lewendi

lewendi

Advanced Hacker
Zugriff von Notebook mit Anmeldung und PW über Dolphin -nicht als Gast!
 
Oben