Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 11/05/2007, à 16:06

glop

Samba

Bonjour,

Je vais surement poser une question bête mais bon j'y vais...

Voila j'ai créé sur mon PC (feisty) un dossier partagé avec samba afin d'avoir un dossier en commun avec mon XP qui tourne sur la même machine via Virtualbox.

Tout fonctionne bien, pour me connecter au dossier partagé sous Xp j'ai du donné mon login et mot de passe (défini lors du paramètrage de samba)

Et puis je me suis dit, tiens ça serai cool de pouvoir également avoir acces à ce dossier depuis mon portable (qui est connecté en wifi au même routeur que mon PC) ( il tourne sous edgy)

Et là horreur, via le menu serveur réseau j'ai accès au dossier partagé sans qu'aucun mot de passe ne me soit demandé !!!

Est-ce normal ?

(nb pour la création du dossier partagé j'ai suivi ce tuto http://doc.ubuntu-fr.org/virtualbox_partage?s=samba%20virtualbox

#2 Le 11/05/2007, à 21:22

vincentced

Re : Samba

Salut,

dossier patagé, il est où (sous XP ou Feisty)

Sous Feisty, tu définis un dossier partagé par Système -> Administartion -> Dossier partagé

puis dans un terminal, tu tapes
sudo smbpasswd -a utilisateur

Ensuite à partir d'un autre PC, tu auras accès après la saisie du mot de passe

#3 Le 11/05/2007, à 21:49

figaro

Re : Samba

glop a écrit :

Bonjour,

Je vais surement poser une question bête mais bon j'y vais...

Voila j'ai créé sur mon PC (feisty) un dossier partagé avec samba afin d'avoir un dossier en commun avec mon XP qui tourne sur la même machine via Virtualbox.

Tout fonctionne bien, pour me connecter au dossier partagé sous Xp j'ai du donné mon login et mot de passe (défini lors du paramètrage de samba)

Et puis je me suis dit, tiens ça serai cool de pouvoir également avoir acces à ce dossier depuis mon portable (qui est connecté en wifi au même routeur que mon PC) ( il tourne sous edgy)

Et là horreur, via le menu serveur réseau j'ai accès au dossier partagé sans qu'aucun mot de passe ne me soit demandé !!!

Est-ce normal ?

(nb pour la création du dossier partagé j'ai suivi ce tuto http://doc.ubuntu-fr.org/virtualbox_partage?s=samba%20virtualbox

Sur ce PC client ton nom utilisateur est-il le même que sur le PC serveur ? Alors c'est normal.


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#4 Le 12/05/2007, à 08:43

glop

Re : Samba

Le dossier partagé est sous Feisty.

Oui j'ai le même nom d'utilisateur sur les 2 PC.

Y'a t'il un moyen de protéger ce dossier partagé ?

Bon c'est surtout par principe, car je n'ai rien de top secret et je suis en campagne, alors avant que quelqu'un se connecte à mon Wifi il faut déja qu'il se gare dans ma cour ET la je sort de suite le 12 (et oui on est comme ça à la campagne...)

Ceci dit j'aimerai bien avoir un dossier partagé sur mon PC de bureau et pouvoir y accèder mais avec un mot de passe obligatoire !! D'autant plus que j'aimerai pouvoir y accéder via FTP

Samba ne fait peut-être pas ça ?

Je suis pas très bon en paramétrage réseau.

#5 Le 12/05/2007, à 08:49

figaro

Re : Samba

La réponse est là, il suffit de mettre un valid users au dossier concerné dans le smb.conf.


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#6 Le 12/05/2007, à 09:14

glop

Re : Samba

Merci bcp Figaro.

Maintenant on me demande mon mot de passe...

Je ne voudrai pas abuser... mais maintenant si je veut y accéder d'un poste exterieur via internet ?

En ftp ? ou autrement ?

#7 Le 12/05/2007, à 09:26

glop

Re : Samba

si j'ai bien compris (en lisant ton blog) Samba est réserver a la création de réseau interne (windows/linux)

Et dire que c'était "si simple" et que maintenant j'ai un réseau domestique privée.

Il y a quelques années sous Windows je n'y étais jamais parvenu correctement. (je voulais connecté 3 PC en Wifi et partager des dossiers différents selon les utilisateurs)

Qui a dit que linux était difficile ?

Il suffit d'avoir le "Figaro" !!

#8 Le 12/05/2007, à 10:33

figaro

Re : Samba

Petite explication :

Windows utilise depuis longtemps un protocole intégré (smb) qui permet de faire communiquer entre des PC sous windows sur un même réseau.

Samba a été développé pour que les PC sous Linux puissent se joindre à ceux qui sont sont sous Windows sur le réseau. Dans SaMBa tu retrouves smb. smile

On peut utiliser Samba pour connecter également des PC sous Linux entre eux.

Pour les accés par internet il faut que tu ais une adresse Ip internet fixe et ensuite que tu définisses 'accés à distance mais c'est un tout autre problème et sujet. Je ne peux pas te guider pour cela.

Voilà bonne continuation. smile


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#9 Le 12/05/2007, à 10:58

glop

Re : Samba

Merci de tes réponses.

Pour ce qui est du bureau à distance, je l'ai déja paramétré.


Par contre de mon portable, je n'ai plus accès a mon dossier partagé . Après l'icone "Reseau windows" je n'ai soit plus rien soit parfois "fred-laptop" soit parfois en plus "fred-desktop" puis dans ce dernier cas "MSHOME" et là une fenêtre avec 'imposible d'afficher l'ensemble du dossier"

C'est plutôt alléatoire.

Une idée ?

voilà mon fichier de config...

#
# 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
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentary and a ; for parts of the config file that you
# may wish to enable
#
# 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 = MSHOME

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

# 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.
   dns proxy = no

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



#### Debugging/Accounting ####

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

# Put a capping on the size of the log files (in Kb).
   max log size = 1000

# 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.
   syslog = 0

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


####### 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.
   encrypt passwords = true

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

   obey pam restrictions = yes

;   guest account = nobody
   invalid users = root

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

# 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\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\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 = no

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

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

# When using [print$], root is implicitly a 'printer admin', but you can
# also give this right to other users to add drivers and set printer
# properties
;   printer admin = @lpadmin


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

#======================= 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, \\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
;   valid users = %S

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

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

# 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

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

wins support = no
[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   public = no
   writable = no
   create mode = 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.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
;   write list = root, @ntadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
;   comment = Samba server's CD-ROM
;   writable = no
;   locking = no
;   path = /cdrom
;   public = 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


[DossierPartage]
path = /home/fred/DossierPartage
available = yes
browsable = yes
public = yes
writable = yes
valid users = fred

hosts allow = 127. 192.168.0. 10.0.2.15

#10 Le 12/05/2007, à 11:48

figaro

Re : Samba

Le hosts allow remet le dans la section [global] au début du fichier.

La fonction Réseau windows ne fonctionne pas très bien  et ne peut apparaitre qu'au bout d'un temps assez long jusqu'à 10 minutes les PC devant dialoguer sur le réseau (activité broadcast) pour se reconnaître et s'identifier, le plus simple c'est de créer une connexion directe via

 /Raccourcis/Se Connecter à un serveur

Tu auras une icone sur ton bureau te permettant de te connecter en double cliquant dessus.


PS: il faut également veiller à renseigner les fichiers hosts sur Ubuntu et sur  Windows avec les adresses Ip et le nom des PC cf §1 de mon tuto.

Dernière modification par figaro (Le 12/05/2007, à 13:44)


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#11 Le 12/05/2007, à 14:11

glop

Re : Samba

Merci pour tes réponse rapide,

Voillà j'ai suivi tes conseil et mis

[global]
hosts allow = 127. 192.168.0. 10.0.2.15     192.168.0.4

au début du fichier de configuration.

Et ça marche....

Il ne me reste plus qu'a enregistrer sur mon routeur l'adresse mac de mon portable (pour qu'il soit tjrs en 192.168.0.4)   et tout devrait marcher.

Ensuite je "m'entrainerai" a créer des dossiers partagés pour différents comptes.

Me conseilles tu d'installer MonteSMB ?

#12 Le 12/05/2007, à 14:27

figaro

Re : Samba

glop a écrit :

Me conseilles tu d'installer MonteSMB ?

Je ne sais pas ce que c'est. Un logiciel qui permet de faire un montage de dossiers partagés ?

Cela se fait simplement en ligne de commande avec

mount -t cifs //IpPCServeurSamba/DossierPartage  /media/montagePartage user,rw,uid=1000,gid=100,umask=027,file_mode=0640,dir_mode=0750,iocharset=utf8,user=nomutilisateur

Il te demandera le password sudo puis le passwd de l'utilisateur. Il faut avoir crée avant le point de montage :

sudo mkdir /media/montagePartage

Tu peux te faire des scripts pour faciliter cela et éviter de tout retaper à chaque fois.

Dernière modification par figaro (Le 12/05/2007, à 14:29)


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#13 Le 12/05/2007, à 15:11

glop

Re : Samba

monteSMB c'est ça

http://www.michel-eudes.net/blog/index.php?2007/02/15/27-samba-facile

wink

#14 Le 12/05/2007, à 15:22

figaro

Re : Samba

Ah OK j'avais oublié le nom, mais c'est pour monter un réseau assez important (20 ou 30 PCs) et constitué principalement de PC sous Windows comme dans une école par exemple ou une entreprise, pas pour un réseau familial de 5 ou 6 PC.

Cela dépend donc de ce que tu veux faire. smile


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#15 Le 12/05/2007, à 15:37

glop

Re : Samba

J'ai au plus 4 PC.

1 sous fesity
1 sous edgy
1 sous xp
1sous Win98


Mais avec ton aide j'ai déja un dossier partagé et protégé.

Merci bcp

Actuellemnt j'essaye de me créer un ftp avec pure-ftpd.

Tu ne serais pas par hasard caler aussi pour lui ?

J'ai pour l'instant un vilain : "Unable to start a standalone server: Address already in use"

J'ai suivi ce tuto http://www.supinfo-projects.com/fr/2006/serveur%5Fftp%5Flinux/4/
mais je le crois incomplet. En le suivant à la lettre ça ne fonctionne pas

#16 Le 12/05/2007, à 15:45

figaro

Re : Samba

Donc pour Samba mon tuto te suffit largement.
Pour le reste désolé, mais lance un post sur le sujet après avoir fait le tour de la documentation. smile


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne