Page 58 of 106 FirstFirst ... 848565758596068 ... LastLast
Results 571 to 580 of 1059

Thread: HOWTO: Setup Samba peer-to-peer with Windows

  1. #571
    Join Date
    Dec 2007
    Beans
    6

    Re: HOWTO: Setup Samba peer-to-peer with Windows

    i got a question.. i need to share 2 directories.. /home/shares/test and /home/shares/allusers for 2 users, tom and officer

    tom can only access to the test directory, but officer can access both folders but i cant seems to make my samba do the share in this way.. below is my smb.conf file. please point out my mistakes. thank you.

    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
    #
    # 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
        username map = /etc/samba/smbusers
    
    # 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 *passwd:*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
    ;
    ; The following was the default behaviour in sarge
    ; but samba upstream reverted the default because it might induce
    ; performance issues in large organizations
    ; See #368251 for some of the consequences of *not* having
    ; this setting and smb.conf(5) for all details
    ;
    ;   winbind enum groups = yes
    ;   winbind enum users = 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
    wins support = no
    [homes]
       comment = Home Directories
       browseable = yes
    
    # 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
    
    # 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 = 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
    
    # 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
    
    [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
    
    available = yes
    browsable = yes
    
    [www]
    path = /var/www
    available = yes
    browsable = yes
    public = yes
    writable = yes
    
    [test]
     comment = tom user
     path = /home/shares/test
    ; valid users = tom
     force users = tom
     force group = tom
     create mask = 0660
     directory mask = 0771
     writable = yes
    
    [allusers]
     comment = All Users
     path = /home/shares/allusers
    ; valid users = officer 
     force users = officer 
     force group = officer 
     create mask = 0660
     directory mask = 0771
     writable = yes

  2. #572
    Join Date
    Jun 2007
    Beans
    3

    Re: HOWTO: Setup Samba peer-to-peer with Windows

    hi All,

    I am using Ubuntu 7.10.
    I am facing problem regarding Maping of share from Win XP.It giving me error of " Network Path could not found" .
    I checked every thing there is no firewall or like that install at both end.
    Please suggest me.

  3. #573
    Join Date
    Dec 2007
    Location
    Cleveland, OH
    Beans
    117
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Setup Samba peer-to-peer with Windows

    Hi Stormbringer-

    I was hoping you might be able to help me out. I started a thread here:
    http://ubuntuforums.org/showthread.php?t=738567
    Mostly because I felt shifty about posting something that long onto your thread. Anyway, I was hoping you'd be willing to look at my setup and throw out some ideas. Please feel free to leave your answeres on this thread if you prefer so that others can see them more easily; I just didn't want to bog everything down. I'm using the smb.conf from your guide, tailored to my network, and it's almost there...


    Thanks a lot for any ideas.
    Home: HP DV7-1242 Laptop, ATI, 6 GB RAM, 320GB HD, AMD TurionX2 2.1ghz
    Home: HP DV6646us Laptop, nVidia, 4 GB RAM, 32GB SSD, AMD TurionX2 1.9ghz
    Work: Lenovo ThinkPad T510, nvidia, 8 GB RAM, 500 GB HD, Core i5
    Ubuntu User # 21,107

  4. #574
    Join Date
    Oct 2007
    Beans
    95
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Setup Samba peer-to-peer with Windows

    This is an ausom setup, i managed to get both my Disk drives setup etc, which is cool, apart that you cant view "CD's" or audio disks as ubuntu calls them Via the network!!! how can i set this up?

    and also, how can i setup the network so no username or password is needed, since its all via LAN i dont need to worry about security!

    Cheers

  5. #575
    Join Date
    Jan 2008
    Location
    Between SJI & Bellevue WA
    Beans
    783
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Setup Samba peer-to-peer with Windows

    Hello Stormbringer --

    Many thanks for your HOWTO. I haven't used it myself to be honest, but I've seen how helpful it's been to many other posters on the forum.

    Over time, it appears that some things have changed, such that some of your guide unfortunately no longer applies quite correctly. I have noted a few points and conf file options that might need changing from what's listed in your template, which I describe here.

    ----------

    Quote Originally Posted by Stormbringer View Post
    1. Prerequisites

    - Your Linux box should have an static ip-address.
    In case you're getting your ip from a router/server via DHCP make sure it's configured to provide a fixed dhcp-lease. If that's no valid option you cannot use WINS ... more on this way down.
    This no longer seems to be the case. I had a DHCP setup with all dynamic addresses, but, provided I had "wins support = yes" and "preferred / domain / local master = yes" in my smb.conf file, I never needed to specify any WINS server address on the Windows side. (NB: Nor do I have winbind installed.)

    Here's the [global] section from the initial template in your original post. The bold options seem slightly problematic.
    Code:
    [global]
        ; General server settings
        netbios name = YOUR_HOSTNAME
        server string =
        workgroup = YOUR_WORKGROUP
        announce version = 5.0
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
    
        passdb backend = tdbsam
        security = user
        null passwords = true
        username map = /etc/samba/smbusers
        name resolve order = hosts wins bcast
    
        wins support = yes
    
        printing = CUPS
        printcap name = CUPS
    
        syslog = 1
        syslog only = yes
    Let's look at these bold options one by one. I link to the relevant man page section in the name of each.

    server string =
    Since this is blank, may as well leave it out for simplicity's sake (simple is good! ), and allow the server to use the default value of "Samba %v", where %v is the package version.

    announce version = 5.0
    This setting is very likely completely unnecessary. Beyond that, this value of "5.0" appears to be bogus. From the man page:
    This specifies the major and minor version numbers that nmbd will use when announcing itself as a server. The default is 4.9. Do not change this parameter unless you have a specific need to set a Samba server to be a downlevel server.

    Default: announce version = 4.9
    null passwords = true
    This strikes me as a bad idea, security-wise. This option is only relevant if you have Samba accounts for which no password has been defined, and has nothing to do with guest access. I would strongly recommend removing this option unless there is a real compelling reason to configure and then use Samba accounts with no passwords.

    username map = /etc/samba/smbusers
    This option is not a problem at all, but I was confused that you include the option but don't describe how to use it. This allows you to log in from Windows (or any other Samba client) with a username that does not actually exist on the Ubuntu machine. This can be very useful in terms of security, or simply in making things easier for the user. It's also possible to map multiple client usernames to a single server-side username. More on this below.

    printing = CUPS
    printcap name = CUPS

    Neither of these options belongs in the [global] section. They are *only* relevant within a share definition for a printer.

    syslog only = yes
    This means that most Samba server process messages are shunted to the /var/log/syslog file. While not a problem in and of itself, the syslog is already a very busy file, making it harder to sift through and find Samba-related messages. Over time I've learned that it's much easier to have Samba's logging info sent to the default /var/log/samba/log.smbd and log.nmbd files. As with anything, YMMV (your mileage may vary).


    It's worth pointing out that the following two share definitions are *only* relevant for users actually sharing a printer via Samba. If you're not doing that, remove these shares to simplify your conf file.
    Code:
    [print$]
        path = /var/lib/samba/printers
        browseable = yes
        guest ok = yes
        read only = yes
        write list = root
        create mask = 0664
        directory mask = 0775
    
    [printers]
        path = /tmp
        printable = yes
        guest ok = yes
        browseable = no

    Quote Originally Posted by Stormbringer View Post
    Ok, I already mentioned that there are a few simple things you may need to tweak; so here they are:

    -> wins support = yes

    If your box doesn't have a static ip-address, or you cannot configure your router/server to provide you with a fixed dhcp-lease, change this configuration parameter to "no".

    In this case you cannot use the benefits of WINS.
    See above description. This no longer appears to be the case; a fully-dynamic DHCP setup seems to work just fine with "wins support = yes" and no WINS server specified on the Windows side.

    Quote Originally Posted by Stormbringer View Post
    -> [MyFiles]

    This is the name of the share. Leave it as it is or adjust it to whatever you prefer. Don't use more than 31 characters and try to avoid spaces!
    Spaces are allowable, but they complicate things. In the /etc/fstab file, spaces must be replaced with \040. In mount commands, you can simply double-quote the part of the path that has spaces: //server/"share name with spaces"/subdirectory


    Quote Originally Posted by Stormbringer View Post
    -> force user = YOUR_USERNAME
    -> force group = YOUR_USERNAME

    Well, this should say it all. Replace "YOUR_USERNAME" with the name you use for login (no spaces!).
    These options are irrelevant for single-user setups. Such forcing is really only needed for shares accessed by multiple different people, where you want any files or directories created to have the owner and / or group set to YOUR_USERNAME. The Samba server uses real login usernames for any file operations, which is why you can only run smbpasswd for usernames that actually exist on the server. This also means that users accessing a share via Samba will be subject to the regular filesystem rules for Unixy systems -- any files or directories created will, by default, have that user as the owner and group, unless otherwise specified by the setuid or setgid permissions on the shared directory, or by these force user or force group options.


    Quote Originally Posted by Stormbringer View Post
    1.1 Starting samba and setting up user accounts

    ...

    Time to add yourself as an samba user.

    NOTE: You will be asked for a password - make sure you use the same as you use for login!

    Code:
    sudo smbpasswd -L -a your_username
    sudo smbpasswd -L -e your_username
    In case you need other users to be able to access the share you need to add them to your system AND samba as well. Make sure you use the very same Windows usernames and passwords!
    It is not necessary that the usernames and passwords on the server and client match -- they can be different, and for the security conscious, they even *should* be different. Note that the username you supply to the smbpasswd command *must* exist as a real Ubuntu username on the server. However, the username you use on the client side (or that you give your friends so they can access your Samba shares) does *not* need to match this same username, *provided* you use the username map option in the [global] section. Have a look at this post, particularly the "In the [global] section" portion, for a description of how username mapping works.


    Quote Originally Posted by Stormbringer View Post
    NOTE: Windows XP doesn't set passwords for its useraccount per default. If you haven't set a password on your XP box
    just press enter when prompted to enter a password for the user account you're about to create!
    This is where the null passwords option marked above comes into play. Note that null passwords are an extraordinarily bad idea in this day and age. It's awfully close to simply leaving your doors wide open for anyone to walk right in. Leave it to Windows to have null passwords as the default. Seriously, unless you have a real, compelling reason to have null passwords, do *not* do this. Set a password. There, you've been warned.


    Quote Originally Posted by Stormbringer View Post
    2. Changing network settings in Windows

    Now we should let Windows know that there's a WINS server active in the network.

    If you had to change "wins support" to "no" above skip this step!
    As described above, wins support = yes seems to work just fine on dynamic DHCP-configured networks, so there's no reason to set this option to "no", and there's no reason to go to the trouble of specifying a WINS server on the Windows side.

    ----------

    Hope this helps,

    Eiríkr

  6. #576
    Join Date
    Jan 2008
    Location
    Between SJI & Bellevue WA
    Beans
    783
    Distro
    Ubuntu 10.04 Lucid Lynx

    Lightbulb Re: HOWTO: Setup Samba peer-to-peer with Windows

    Quote Originally Posted by GodsDead View Post
    This is an ausom setup, i managed to get both my Disk drives setup etc, which is cool, apart that you cant view "CD's" or audio disks as ubuntu calls them Via the network!!! how can i set this up?

    and also, how can i setup the network so no username or password is needed, since its all via LAN i dont need to worry about security!

    Cheers
    While there is such a thing as "guest access" in Samba whereby no username or password is required, it's actually quite complicated to set up properly. If you're accessing your Samba shares via Windows, just map a network drive to the share, click the "Reconnect at logon" box in the dialog, and enter your username and password just this once when prompted. Once you've done this, the drive (i.e. share) will automagically mount every time you log in with no need to ever again enter your username or password. If you're accessing your Samba shares via Ubuntu, Nautilus (your file browser) should have a radio button option on the username and password dialog that says "Remember forever". Clicking this means you'll never again need to enter your username or password to access this share.

    HTH,

    Eiríkr

  7. #577
    Join Date
    Oct 2005
    Location
    London
    Beans
    477
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: Setup Samba peer-to-peer with Windows

    Thank you very much for the good howto guide. I was afraid of using Samba due to its complicated (at least I thought it was) configuration, but now I can use Ubuntu on my server and never even consider Windows an option. It makes my HDD parts dirty

  8. #578
    Join Date
    Jan 2008
    Beans
    80

    Re: HOWTO: Setup Samba peer-to-peer with Windows

    I want to set up a single share that all users on my network have access to, but I don't want to have separate users added to my server for each and every one of their windows logins. Is it possible to have a single user and password linked to the share and have multiple machines logging on to it?

  9. #579
    Join Date
    Sep 2007
    Location
    Caracas-Venezuela
    Beans
    52
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Unhappy Re: HOWTO: Setup Samba peer-to-peer with Windows

    Hello! first let me thank you for this guide is very detailed but even so I don't know where I mess up, I follow every step until the 2. Changing network settings in Windows, I do that part and reboot but when I try to map the network drive within Windows I get an error saying that the IP addres or the hostname and sharename can not be found, I'm trying to run an Ubuntu Pc on a Windows XP. Please help anyone I'm down to the last steep
    HP Pavilion dv5 1000us
    64-bit 2.0 GHz Centrino 2 core duo P7350
    250 GB hard drive, 4 GB RAM.
    Intel Graphics Media Accelerator X4500

  10. #580
    Join Date
    Jan 2007
    Location
    Florida
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Setup Samba peer-to-peer with Windows

    I have a guess. I was having the same problem and finally figured out it was the path. Let's say that in the smb.conf file you have the following (in the right places, of course):

    netbios name = bob-desktop
    path = /home/bob/Somewhere/
    force user = bob

    When the little window pops up in Windows when you go to map the drive, place this in it, on separate lines:

    bob-desktop\bob
    \\bob\Somewhere

    That seemed to work for me (with different settings, of course).

    I'm trying to figure out how to access a second drive on Ubuntu from Windows.
    Lee

    "Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened." - Sir Winston Churchill

Page 58 of 106 FirstFirst ... 848565758596068 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •