Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: Bestanden naar server plaatsen via Samba  (gelezen 4812 keer)

Offline Hayo

  • Lid
Bestanden naar server plaatsen via Samba
« Gepost op: 2011/07/12, 15:11:47 »
Ik heb een paar dagen terug Ubuntu 10.04 Server editie geïnstalleerd. En nu wil ik via mijn windows xp computer bestanden naar deze server toeschrijven.

Dus ik dacht daar kan ik samba mooi voor gebruiken. Nu ben ik door middel van webmin al zo ver gekomen dat ik wel bestanden kan lezen van mijn server maar ik kan er niet naar toe schrijven.

De map die ik deel staat bij webmin ingesteld als "Read/write to everyone" zou moeten werken dus.  ???

Ik heb al tal van handleidingen doorgenomen en vele forums doorgelezen maar het wil niet lukken. Dus misschien weet hier iemand het antwoordt.  ;)

Ik wil een beetje hetzelfde als deze gast. Het liefst ook zonder inteloggen.http://forum.ubuntu-nl.org/server-en-netwerk/samba-share-zonder-wachtwoord-maar-met-schrijf-rechten/

Alles op 777 instellen heb ik ook al geprobeerd.

Hieronder staat mijn config file.
#
# 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.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#

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

[global]
log file = /var/log/samba/log.%m
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
obey pam restrictions = yes
map to guest = bad user
encrypt passwords = yes
passwd program = /usr/bin/passwd %u
passdb backend = tdbsam
dns proxy = no
netbios name = Ubuntu-Server
server string = %h server (Samba, Ubuntu)
unix password sync = yes
workgroup = Workgroup
os level = 20
auto services = homes
syslog = 0
security = ads
panic action = /usr/share/samba/panic-action %d
usershare allow guests = yes
max log size = 1000
pam password change = yes

## Browsing/Identification ###

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

# server string is the equivalent of the NT Description field

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
#   wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.

# What naming service and in what order should we use to resolve host names
# to IP addresses
;   name resolve order = lmhosts host wins bcast

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

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

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
#   syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.

# Do something sensible when Samba crashes: mail the admin a backtrace


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

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
#   security = user

# You may wish to use password encryption.  See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.  


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

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

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

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections

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

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
;   domain logons = yes
#
# The following setting only takes effect if '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

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
#   load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
;   printing = bsd
;   printcap name = /etc/printcap

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
;   printing = cups
;   printcap name = cups

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

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
#         SO_RCVBUF=8192 SO_SNDBUF=8192
#   socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
#   domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
;   winbind enum groups = yes
;   winbind enum users = yes

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

# Maximum number of usershare. 0 (default) 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

#======================= 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
;   share modes = no

# 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

# A sample share for sharing your CD-ROM with others.
;[cdrom]
;   comment = Samba server's CD-ROM
;   read only = yes
;   locking = no
;   path = /cdrom
;   guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
#       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
;   preexec = /bin/mount /cdrom
;   postexec = /bin/umount /cdrom


[Ubuntu-Server]
force create mode = 755
writeable = yes
public = yes
path = /home/hayo/shared
force directory mode = 755


« Laatst bewerkt op: 2011/07/12, 15:26:35 door Hayo »

Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #1 Gepost op: 2011/07/12, 16:22:35 »
Is onderstaande link misschien een oplossing om gemakkelijk spullen naar mijn server te brengen via xp?
https://help.ubuntu.com/8.04/serverguide/C/network-file-system.html

Offline 10o

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #2 Gepost op: 2011/07/12, 17:51:21 »
Je zou van het laatste blokje in je smb.conf kunnen maken:

[Ubuntu-Server]
    comment = Ubuntu Server
    path = /home/hayo/shared
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0777
    directory mask = 0777

Zo werkt het bij mij prima.
Iedereen kan dan (alle) bestanden én mappen aanmaken/wijzigen/verwijderen. Iedereen heeft in dit geval ook alle rechten, wat in mijn situatie wenselijk was maar natuurlijk verder af te bakenen is.

Na de aanpassing van smb.conf samba even opnieuw opstarten:

sudo restart smbd
sudo restart nmbd
Workstation:  i7-5820K 16GiB - GeForce GTX 960 2GiB - 4K  (Ubuntu 16.04.1)
Server: Asus E35M1-I Deluxe - AMD Fusion APU E-350 (Ubuntu Server 16.04.1)

Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #3 Gepost op: 2011/07/12, 18:08:35 »
Net geprobeerd maar geen succes, ik krijg weer dezelfde foutmelding als ik er naar toe probeer te schrijven.

"De toegang is geweigerd. Controleer of de schijf vol of tegen schrijven is beveiligd of dat het bestand momenteel in gebruik is.

Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #4 Gepost op: 2011/07/12, 19:38:35 »
Ik heb het nu op mijn windows 7 computer geprobeerd en dan krijg ik een wat duidelijkere foutmelding. Ik weet alleen nog niet wat ik er mee moet. ???


Offline tap

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #5 Gepost op: 2011/07/12, 23:24:43 »
In je config file staat

security = ads

Klopt dit wel? Heb je gewoon users aangemaakt in samba, dan moet dit user zijn
Even de samba server herstarten en dan kun je zien of het werkt.

Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #6 Gepost op: 2011/07/12, 23:54:07 »
Net aangepast naar:

security = user
Maar wederom zonder succes. :(

Citaat
Heb je gewoon users aangemaakt in samba
Volgens mij niet ik ben begonnen met onderstaande handleiding. En toen heb ik alleen gedaan Convert Unix users to Samba users
http://www.linux.com/learn/tutorials/299651-samba-configuration-with-webmin

Offline tap

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #7 Gepost op: 2011/07/13, 00:14:28 »
Ik ben niet zo kapot van het gebruik van webmin
Ben er in het verleden ook mee begonnen maar ik heb het idee (en geen bewijs) dat het soms niet helemaal goed gaat als je webmin zijn gang laat gaan.

Heb je de originele samba.cfg nog. Zo niet doen dan het volgende.
 
Met het onderstaande commando's verwijder je samba inclusief de configuratie file
Voer dit uit in de terminal:

sudo apt-get remove --purge samba

cd /etc/samba

ls

Als na het laatste commando samba.cfg nog aanwezig is, verwijder het dan met

sudo rm samba.cfg

Voer daar de instructies uit in deze tutorial. Die is straightforward.

http://www.jonathanmoeller.com/screed/?p=1590

Je kunt daarna verder experimenteren, maar levert je een werkende configuratie op. (tenminste bij mij. =D)

Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #8 Gepost op: 2011/07/13, 11:39:22 »
Webmin doet inderdaad wel een beetje raar. Zo werkt hij bijvoorbeeld niet meer als ik mijn server herstart. Dus dan moet ik webmin weer opnieuw installeren en dan doet hij het weer. Maar goed dat doet er nu niet toe.

Ik heb geprobeerd wat jij schreef. Dus samba verwijderd. Configuratie bestand stond er nog. Dus verwijderd zoals jij zei (Het was alleen wel smb.conf inplaats van smb.cfg)

Vervolgens weer opnieuw geprobeerd te installeren volgens die handleiding (inderdaad best wel duidelijk) maar ik loop al vast bij de tweede stap.

Aan het eind van de installatie staat er ook:
smbd start/running, process 916
Start: Job failed to start

Ik krijg samba ook niet gestart. Hij zegt dan:
hayo@ubuntu-server: ~$ sudo restart smbd
restart: Unknown instance:
Weet niet of dat hoort. (lijkt me niet)

Maar als ik dan vervolgens naar de tweede stap ga zegt hij:
hayo@ubuntu-server: ~$ sudo smbpasswd -a hayo
Can't load /etc/samba/smb.conf - run testparm to debug it
« Laatst bewerkt op: 2011/07/13, 11:43:11 door Hayo »

Offline tap

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #9 Gepost op: 2011/07/13, 11:53:10 »
samba.conf klopt. Tikfoutje.

Probeer eens

sudo testparm

Wat zegt hij dan.

Werkt dit trouwens

sudo /etc/init.d/smbd restart

Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #10 Gepost op: 2011/07/13, 13:24:58 »
Citaat
Werkt dit trouwens


sudo /etc/init.d/smbd restart

Dat lijkt te werken ik krijg dan dit:
hayo@ubuntu-server: ~$ sudo /etc/init.d/smbd restart
[sudo] password for hayo:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service smbd restart

Since the script you are attempring to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart smbd
smbd start/running, process 958

Citaat
Probeer eens

sudo testparm

Wat zegt hij dan.

Dan zegt hij het volgende:
hayo@ubuntu-server:~$ sudo testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf
":
No such file or directory
Error loading services

Offline tap

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #11 Gepost op: 2011/07/13, 17:04:28 »
PM mij even je mail adres, dan krijg je een orginele .conf file, daar kun je dan mee verder.

Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #12 Gepost op: 2011/07/14, 15:22:04 »
Ik denk dat het alleen een probleem wordt om die config op mijn server te krijgen. Het hele probleem is namelijk niet zo zeer dat ik samba niet aan de praat krijg maar dat ik niet weet hoe ik spullen op mijn server zet.

Samba is natuurlijk wel het makkelijks als dat werkt. ;)

Offline tap

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #13 Gepost op: 2011/07/14, 16:13:40 »
Kunnen we je bij helpen. Zal er vanavond even naar kijken.

Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #14 Gepost op: 2011/07/14, 16:49:32 »
Ik heb al iets bedacht, gewoon apache op xp geinstalleerd en dan via localhost met wget downloaden.

Dus op zich is mijn probleem dan opgelost. Maar samba is wel een beetje een principe kwestie geworden. Dus dat geef ik nog niet op.  =D

Als iemand trouwens iets beter weet om spullen op men server te zetten hoor ik dat ook graag.  ;)

Offline tap

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #15 Gepost op: 2011/07/14, 17:09:13 »
Dat is ook wel een omweg.
Hoe communiceer je nu met je server? Via ssh?

Probeer het volgende eens.
Maak een file aan in /etc/samba

Dat kan op de volgende manier.

sudo nano /etc/samba/smb.conf

Niks invullen en weer afsluiten en opslaan met ctrl-w

Dan samba herstarten en kijken of hij de conf opnieuw opgebouwd heeft omdat die leeg is

Nogmaals het commando hierboven gebruiken en kijken of hij hem gevuld heeft.
Als dit ook niet lukt stuur ik mijn backup file naar je toe.


Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #16 Gepost op: 2011/07/14, 18:15:46 »
Citaat
Dat is ook wel een omweg.
Hoe communiceer je nu met je server? Via ssh?
Dat is inderdaad wel een beetje een omweg, maar ik wist eve niks anders. =D
Ik communiceer nu gewoon rechtstreeks met men server. Hij staat hier namelijk naast me XD
Dus van dat zou usb of cd makkelijker zijn. Ik heb alleen geen cd speler er in zitten. En usb wou niet echt lukken. Moest volgens mij weer drivers installeren voor men usb. Gedoe en samba is dan toch makkelijker.
Citaat
Probeer het volgende eens.
Maak een file aan in /etc/samba

Dat kan op de volgende manier.

Code:

sudo nano /etc/samba/smb.conf


Niks invullen en weer afsluiten en opslaan met ctrl-w
Dat ging wel, kreeg inderdaad schermpje vervolgens opgeslagen (wel met ctrl-o inplaats van ctrl-w, w is namelijk zoeken)
Citaat
Dan samba herstarten en kijken of hij de conf opnieuw opgebouwd heeft omdat die leeg is

Nogmaals het commando hierboven gebruiken en kijken of hij hem gevuld heeft.
Als dit ook niet lukt stuur ik mijn backup file naar je toe.
Als ik samba wil herstarten krijg ik onderstaande:
hayo@ubuntu-server: ~$ sudo restart smbd
restart: Unknown instance:
hayo@ubuntu-server: ~$
« Laatst bewerkt op: 2011/07/14, 18:17:20 door Hayo »

Offline tap

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #17 Gepost op: 2011/07/14, 18:53:28 »
sudo /etc/init.d/samba restart


Offline Hayo

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #18 Gepost op: 2011/07/14, 21:09:02 »
hayo@ubuntu-server: ~$ sudo /etc/init.d/samba restart
sudo: /etc/init.d/samba: command not found

Offline tap

  • Lid
Re: Bestanden naar server plaatsen via Samba
« Reactie #19 Gepost op: 2011/07/14, 21:19:23 »
Oeps, blijf tikfouten in de haast maken

sudo /etc/init.d/smbd restart

of

sudo service smbd restart