ubuntuusers.de

system-config-samba?

Status: Ungelöst | Ubuntu-Version: Ubuntu 18.10 (Cosmic Cuttlefish)
Antworten |

WirrLicht

Anmeldungsdatum:
25. Juni 2011

Beiträge: 354

wirrlicht@mediasender:~$ sudo -H system-config-samba
[sudo] Passwort für wirrlicht: 
No protocol specified
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/usr/share/system-config-samba/mainWindow.py:62: Warning: invalid (NULL) pointer instance
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: Warning: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: GtkWarning: IA__gdk_pango_context_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_context_set_font_description: assertion 'context != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_context_set_base_dir: assertion 'context != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_context_set_language: assertion 'context != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_layout_new: assertion 'context != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_layout_set_attributes: assertion 'layout != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_layout_set_text: assertion 'layout != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_layout_get_unknown_glyphs_count: assertion 'PANGO_IS_LAYOUT (layout)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: Warning: value "TRUE" of type 'gboolean' is invalid or out of range for property 'visible' of type 'gboolean'
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: GtkWarning: IA__gdk_screen_get_display: assertion 'GDK_IS_SCREEN (screen)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: GtkWarning: IA__gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
Speicherzugriffsfehler
wirrlicht@mediasender:~$ 

So siehts aus. Blöderweise ist halt, das

Seit Ubuntu 18.04 ist gksu nicht mehr in den Paketquellen enthalten. Das Tool system-config-samba kann dann nur noch von einem Terminal [2] aus mit der Befehlszeile sudo -H system-config-samba geöffnet werden.

https://wiki.ubuntuusers.de/Samba_Server_GNOME/

Komm ich jetzt gar nicht mehr an die config? Das wär halt schon praktisch... oder ist bei mir einfach was im Eimer?

weholei

Anmeldungsdatum:
7. Februar 2019

Beiträge: 833

Wohnort: Mittelfranken

Komm ich jetzt gar nicht mehr an die config? Das wär halt schon praktisch... oder ist bei mir einfach was im Eimer?

meinst du die smb.conf?

kB Team-Icon

Supporter, Wikiteam
Avatar von kB

Anmeldungsdatum:
4. Oktober 2007

Beiträge: 9675

Wohnort: Münster

WirrLicht schrieb:

wirrlicht@mediasender:~$ sudo -H system-config-samba
[…]

Ich vermute, es fehlen bei Dir einige Python-Bibliotheken/Skripts.

Komm ich jetzt gar nicht mehr an die config?

Versuche:

$ sudo -i # Root-Shell starten.
# nano /etc/samba/smb.conf # Konfigurationsdatei als root bearbeiten.
# exit # Root-Shell beenden.

Du kannst mit dieser Methode auch einen anderen, sogar grafischen Editor wie z.B. gedit benutzen, nur eben bitte nicht direkt sudo gedit DATEI verwenden!

WirrLicht

(Themenstarter)

Anmeldungsdatum:
25. Juni 2011

Beiträge: 354

Du kannst mit dieser Methode auch einen anderen, sogar grafischen Editor wie z.B. gedit benutzen, nur eben bitte nicht direkt sudo gedit DATEI verwenden!

Ich mag ja grafische Editoren. Neugierhalber: Weshalb sollte ich nicht sudo gedit .... ??

WirrLicht

(Themenstarter)

Anmeldungsdatum:
25. Juni 2011

Beiträge: 354

...irgendwas stimmt da auch nicht

wirrlicht@mediasender:~$ sudo -i
[sudo] Passwort für wirrlicht: 
root@mediasender:~# gedit /etc/samba/smb.conf
No protocol specified
Unable to init server: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt

(gedit:5043): Gtk-WARNING **: 17:56:31.790: cannot open display: :0
root@mediasender:~# exit
Abgemeldet
wirrlicht@mediasender:~$ gedit
wirrlicht@mediasender:~$ 

Gedit geht zumindest. Aber halt nicht für die smb.conf

weholei

Anmeldungsdatum:
7. Februar 2019

Beiträge: 833

Wohnort: Mittelfranken

Ich habe jahrelang webmin genommen, um den Samba Server zu administrieren. Das ist ein grafisches Admintool wenn gar nichts hilft....

seit mir davon abgeraten wurde, benutze ich nano im Terminal

kB Team-Icon

Supporter, Wikiteam
Avatar von kB

Anmeldungsdatum:
4. Oktober 2007

Beiträge: 9675

Wohnort: Münster

WirrLicht schrieb:

[…] Neugierhalber: Weshalb sollte ich nicht sudo gedit .... ??

Der direkte Aufruf von grafischen Programmen (nicht nur gedit) mit sudo kann schwere Verwüstungen im eigenen Home-Verzeichnis anrichten. Berechtigungen für Wichtige Dateien werden geändert. Eine mögliche Folge: Du kannst Dich nicht mehr anmelden. Das Grafik-System Wayland verhindert deshalb konsequent die Ausführung grafischer Programme als root. Das ist der Grund, warum gksudo unter Wayland nicht mehr funktioniert.

kB Team-Icon

Supporter, Wikiteam
Avatar von kB

Anmeldungsdatum:
4. Oktober 2007

Beiträge: 9675

Wohnort: Münster

WirrLicht schrieb:

...irgendwas stimmt da auch nicht

wirrlicht@mediasender:~$ sudo -i
[sudo] Passwort für wirrlicht: 
root@mediasender:~# gedit /etc/samba/smb.conf
No protocol specified
Unable to init server: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt

Benutzt Du Wayland? Prüfe mit:

printenv XDG_SESSION_TYPE 

dirkolus

Anmeldungsdatum:
17. Mai 2011

Beiträge: 2177

Wohnort: dahoam

Edit: Mit dem Öffnen der neuen Shell (sudo -i) wird vermutlich die .Xauthority nicht mehr ausgewertet. (Die DISPLAY-Variable des Xservers ist hier default, sollte also stimmen.)

WirrLicht

(Themenstarter)

Anmeldungsdatum:
25. Juni 2011

Beiträge: 354

Ich habe mir eine Kopie der smb.conf gemacht, diese kann man dann (anscheinend) editieren. Da steht nur leider so viel zeug drin, das ich leicht verwirrt bin:

#
# 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

Wenn ich das richtig verstanden habe, brauche ich von dem hier so ziemlich nichts, was mit # oder ; anfängt ?

Das würde das ganze auf

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

[global]
   workgroup = WORKGROUP
   server string = %h server (Samba, Ubuntu)

#### Networking ####

#### Debugging/Accounting ####

   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######
   server role = standalone server
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user

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

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

   usershare allow guests = yes

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

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

reduzieren.

Jetzt habe ich eine neue Freigabe angelegt, bei der ich "guest" nicht erlaubt habe. (mittels rechtsclick)

Die neue Samba.con sieht jetzt (nach anlegen) so aus:

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

[global]

   workgroup = WORKGROUP
   server string = %h server (Samba, Ubuntu)

#### Debugging/Accounting ####
   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file
   panic action = /usr/share/samba/panic-action %d


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

   server role = standalone server
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user

########## Domains ###########
############ Misc ############
   usershare allow guests = yes

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

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

Es hat sich also nichts geändert, oder?

Ich sehe aber die Freigabe/den Ordner auf einem Rechner (komischerweise nicht im windows-rechner über wlan, aber das ist ja im Moment egal.)

Wie auch immer: Wie komme ich an diesen freigegebenen Ordner ran? Ich dachte, ich benutze "Benutzername & Passwort" des jeweiligen Benutzers (wirrlicht), aber das geht nicht. Nach ein bischen herumsuchen fand ich dies hier:

https://www.thomas-krenn.com/de/wiki/Samba_Freigabe_mit_Authentifizierung

Also muss ich wohl einen sambauser anlegen uswusf.

Also mal fragen:

0.) Kann ich die (; bzw #) weglassen? (Ich speichere mir die ursprüngliche .conf ab, dann ist das unnötig, oder?)

1.) Hab ich das so weit richtig verstanden, das die Rechner-User nicht die Samba-User sind? Oder muss ein Samba-User auch ein Konto auf dem Rechner haben?

2.) Was ist mit der Domain? Ich habe mal einen samba-user angelegt, da wurde mir als Domain automatisch der Nutzername eingetragen (glaube ich)?

3.) Ist die Reihenfolge in der .conf relevant?

4.) in meiner Samba-Config gibt es anscheinend kein [homes] oder [restricted] .... Ist das eine Art selbstgewählte Überschrift oder so etwas?

Lidux

Anmeldungsdatum:
18. April 2007

Beiträge: 16740

Hallo WirrLicht,

Benutzt du nun Wayland oder XOrg als Displaymanager ?

Ich habe mir einfach gksudo aus 16.04 mit den entsprechenden Abhängigkeiten nachinstalliert und den Displaymanager auf Xorg gestellt, d.h. danach funktioniert alles wie gehabt .... auch die system-config-samba.

Wichtig: Wenn du das Tool nimmst niemals mehr die smb.config mit etwas anderem bearbeiten.

Gruss Lidux

WirrLicht

(Themenstarter)

Anmeldungsdatum:
25. Juni 2011

Beiträge: 354

Ich weiß im Moment gerade nicht, ob das relevant ist, daher hab' ich beschlossen, erst mal zu verstehen, was diese Einträge in der Samba.conf überhaupt bedeuten (daher meine Fragen.) Die einzelnen Freigaben scheinen sowieso wo anders zu sein ( da irgendwo: /var/lib/samba/usershares )

Bearbeiten kann man das wohl auch mit Nano.....oder?

Was ich jetzt gerne machen würde, ist,

1.) diesen ganzen kram, den ich freigegeben habe etc loszuwerden 2.) eine Nutzer & Passwortfreigebe und eine Gruppenspezifische Freigabe erstellen 3.) dieses SSH-Terminal-Zeug (wahlweise andere "Fernbedienung") zu verstehen

Im Moment komme ich da aber nicht recht weiter. Kann mir jemand eine "How-to-Samba"-Seite empfehlen?

chr123

Anmeldungsdatum:
19. Juli 2018

Beiträge: 1632

WirrLicht schrieb:

Was ich jetzt gerne machen würde, ist,

1.) diesen ganzen kram, den ich freigegeben habe etc loszuwerden

Du kannst Freigaben wahlweise über die Datei /etc/samba/smb.conf erstellen (mit root Rechten) oder über net usershare (das ginge für einen Benutzer auch ohne root Rechte. Zeige am besten noch mal folgende Ausgaben:

1
2
3
smbclient -L localhost
net usershare info
grep home /etc/passwd

Im Moment komme ich da aber nicht recht weiter. Kann mir jemand eine "How-to-Samba"-Seite empfehlen?

Normalerweise ist das Wiki hier ausreichend. How Tos können veraltet sein. Fangen wir doch hier im Thread an. Dazu neben den Ausgaben von oben die Frage, welchen Ordner du im Netzwerk freigeben willst. Konkrete Pfadangabe benennen.

Antworten |