# Samba cannot speak to widnows no matter what

## gentoobobby

I can see my server in network nieghboorhood but cant acces it i need to have a share on my smba server that every windows uer can see and write to can any 1 explaine how i would go about doing this becaue i dont understand the cofig file would any 1 be so kind and send a copy of a smb.conf as mine is mesed up now .

For windows to be able to speak to my samba server what would  i need to do ?Last edited by gentoobobby on Thu Feb 09, 2006 10:20 am; edited 1 time in total

----------

## desktopfan

```

[global]

workgroup = MSHOME

server string = Samba Server %v

printcap name = cups

#  lock directory    = /usr/local/samba/var/lock

interfaces = lo eth0

hosts allow = 192.168.7.0/255.255.255.0 127.0.0.1

hosts deny = ALL

lanman auth = no

#bind interfaces only = yes

log file = /var/log/samba/log.%m

max log size = 50

socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192

security = share

restrict anonymous = no

domain master = no

preferred master = no

max protocol = NT

ldap ssl = No

server signing = Auto

map to guest = Bad User

guest ok = yes

wins support = no

[print$]

comment = Printer Drivers

# this path holds the driver structure

path = /etc/samba/printer

# add a username to the write list

# if you don't want root to be the only

# printer admin

write list = root

[printers]      # here all printers will be shown; this becomes the Printer]

# share/section under Network Neighborhood

comment = All Printers

path = /var/spool/samba

browseable = no

guest ok = yes

printable = yes

printer admin = printer,root

[LostSeason2]

path = /mnt/store/LOST - Season 2

available = yes

browseable = yes

public = yes

writable = no

```

there is mine

Was a pain to get it working with all my other machines. but it seems ok now.

----------

## gentoobobby

thanks for the config man i can now see the serve but i still canniot browse it any ideas why i have till 3 o clock to get my server up and running with share called accessible on to all widnows machines on the network please help !!!

----------

## gentoobobby

i just cant get into the server do i need to setup some user accounts or something i have tried to how tos and just dont understand , i really dont no hwo to make  basic share and see it

----------

## magic919

Keep your smb.conf very simple to avoid probs.

This is  a good source of Samba info.  http://www.techtown.it/public/html/Samba/

Read the client bit for info on adding users with smbpasswd.

----------

## gentoobobby

ok i can now get into the sever and see 2 folders 1 public and 1 homes but i still cant acess them is there a reason for this ?

----------

## magic919

Have you created the Samba user(s) and password(s)?  Do you expect people to log in to see the files??

----------

## gentoobobby

I just want them to see the files , i have not setup the samba user and passwords how do i i do this please and can i just have 1 user that can see everything ? 

```

[global]

workgroup = WORKGROUP

server string = Serv Samba Serv (CUNT)

printcap name = cups

#  lock directory    = /usr/local/samba/var/lock

#interfaces = lo eth0

#hosts allow = 192.168.7.0/255.255.255.0 127.0.0.1

#hosts deny = ALL

#lanman auth = no

#bind interfaces only = yes

log file = /var/log/samba/log.%m

max log size = 50

socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192

security = share

restrict anonymous = no

domain master = yes

preferred master = yes

max protocol = NT

ldap ssl = No

server signing = Auto

map to guest = Bad User

guest ok = yes

wins support = no

[print$]

comment = Printer Drivers

# this path holds the driver structure

path = /etc/samba/printer

# add a username to the write list

# if you don't want root to be the only

# printer admin

write list = root

[printers]      # here all printers will be shown; this becomes the Printer]

# share/section under Network Neighborhood

comment = All Printers

path = /var/spool/samba

browseable = no

guest ok = yes

printable = yes

printer admin = printer,root

[/home]

path = /home/bob

available = yes

browseable = yes

public = yes

writable = yes 

```

----------

## magic919

 *magic919 wrote:*   

> Keep your smb.conf very simple to avoid probs.
> 
> This is  a good source of Samba info.  http://www.techtown.it/public/html/Samba/
> 
> Read the client bit for info on adding users with smbpasswd.

 

----------

## gentoobobby

i have tried to understand that guide and i just dont 

i have been through it lots of times today , 

i just want a basic server and its so hard to get going i just wnat one share that i can read and write to by the end of day. 

i just one a share called ALL that every one can see and read and write to .can any 1 guide me through these steps with out tutuorials as m not understanding them.

----------

## DaveArb

```
[all]

  comment = every one can see and read and write to

  path = /all

  read only = no

  public = yes

```

Note that there is no slash in the share name, your [/home] could have a problem with that (might not, I've never tried it). Also, the Linux permissions need to have appropriate read/write permissions on the directory /all.

Dave

----------

## gentoobobby

what does this mean my firned sorry for being so dumb

----------

## DaveArb

Which part do you have trouble with?

The code block is the smb.conf section for a share named "all", set up as you asked for.

Then there is a caution that you probably don't want to put a slash into the name of the share, like [/home].

Then a comment that the shared directory needs proper permissions.

You cannot afford to have me actually administer your system for you.  :Wink:  You need to put in the effort to understand these parts, Samba's configuration file is actually pretty simple for what you want to do.

Dave

----------

## gentoobobby

hey man yeh i no what ur saying i think its were i have been up all night doing it for work and im so stressed it seems pretty simple i did the share all but i dont no about how to set the permissions . I have setup other things like apache and stuff and im just not getting this. Maybe i need too sleep but worrying about this for my job. 

 just want to be able to access the share all and write to it . The same as   

basically what i have done is just a samba conf file ii havent made any user or passwords does this need to be done.

----------

## DaveArb

I sympathize, I've been there too...

 *gentoobobby wrote:*   

> but i dont no about how to set the permissions

 

If you're using the same directory I showed, use "chmod 777 /all".

 *Quote:*   

> basically what i have done is just a samba conf file ii havent made any user or passwords does this need to be done.

 

No. The line "public = yes" says that no logon is required. 

After changing your smb.conf, restart Samba: /etc/init.d/samba restart

Access from Windows with Start->Run \\<ipaddress>\all

Deep breath.  :Wink: 

Dave

----------

## gentoobobby

yep man when i use the u gave me and try and chmod i get 

no such file or directory

----------

## DaveArb

(you need to create the directory, I don't need to tell you that...  :Wink: )

Dave

----------

## gentoobobby

yeh man i did asume that lol i like to make sure though u dont no how much i appricate it

----------

## DagonSphere

Instead of saying

```
chmod 777 /all
```

As stated in the example, you would have to

```
chmod 777 /home/bob
```

according to the share you have setup in your smb.conf file

That's generally not a good idea to bust open the permissions on a home directory.  But, in a closed network, that would be OK if you're not concerned about security (including from the internet)

I'd recommend changing the path of your share in your smb.conf file to

```
path = /share
```

And then create the share folder with wide open permissions

```
mkdir /share

chmod 777 /share
```

After moving the files that you want to share into the /share directory, that should work, and all other files in your home directory will not be visible.  By rights, you should not make your home directory open for the world to see.  Check out some of the files that 

```
ls -la 
```

returns and you'll see what I mean.  Particularly .bash_history.

----------

## gentoobobby

ok man this sounds right to me i no what u mean bout not having the permission on the home take a look at this 

[all]

        comment = every one can read wrote

        path = /all

        writeable = yes

        browseable = yes

        read only = no

        public = yes

i did the chmod 777 /all 

but im still not able to write to it any ideas appricate ur guys help as i have learnt so much bout samba today

----------

## DagonSphere

I'm not sure if this matters, but does your smb.conf workgroup name match your Windows workgroup name?

Also, you are restarting your samba server after modifying the the conf file, right?

----------

## DaveArb

 *gentoobobby wrote:*   

>         writeable = yes
> 
>         browseable = yes

 

To the best of my knowledge, those are unnecessary. The code block I provided earlier is from a working, production Samba server. They might not hurt anything, but my philosophy is to not include what isn't needed.

 *gentoobobby wrote:*   

> i did the chmod 777 /all 

 

Please show the output of `ls -ld /all` to confirm permissions.

 *gentoobobby wrote:*   

> but im still not able to write to it

 

Are you able to connect to it, see the files, open the files, etc.? Everything but writing?

If yes, just for confirmation might as well cut and paste the smb.conf file to confirm the rest of it is correct.

Dave

----------

## gentoobobby

i can just connect as i have nofiles in the folde ri mjust trying to write to it at the moment so i can acess just not write 

the ouput of the command was

drwxrwxrwx  2 root root 4096 Feb  9 16:04 /all

----------

## DaveArb

Please

 *DaveArb wrote:*   

> cut and paste the smb.conf file to confirm the rest of it is correct.

 

 :Wink: 

Dave

----------

## gentoobobby

```

# 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 (perhaps too

# many!) 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 commentry 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]

# workgroup = NT-Domain-Name or Workgroup-Name

   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field

   server string = Totaly Servin

# This option is important for security. It allows you to restrict

# connections to machines which are on your local network. The

# following example restricts access to two C class networks and

# the "loopback" interface. For more examples of the syntax see

# the smb.conf man page

;   hosts allow = 192.168.1. 192.168.2. 127.

# if you want to automatically load your printer list rather

# than setting them up individually then you'll need this

   printcap name = /etc/printcap

   load printers = yes

# It should not be necessary to spell out the print system type unless

# yours is non-standard. Currently supported print systems include:

# bsd, sysv, plp, lprng, aix, hpux, qnx

   printing = cups

# This option tells cups that the data has already been rasterized

   cups options = raw

# Uncomment this if you want a guest account, you must add this to /etc/passwd

# otherwise the user "nobody" is used

;   guest account = nobody

# this tells Samba to use a separate log file for each machine

# that connects

   log file = /var/log/samba/%m.log

# all log information in one file

#   log file = /var/log/samba/log.smbd

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

   max log size = 50

# Security mode. Most people will want user level security. See

# security_level.txt for details.

   security = share

# Use password server option only with security = server

;   password server = <NT-Server-Name>

# Password Level allows matching of _n_ characters of the password for

# all combinations of upper and lower case.

;  password level = 8

;  username level = 8

# You may wish to use password encryption. Please read

# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.

# Do not enable this option unless you have read those documents

;  encrypt passwords = yes

   smb passwd file = /etc/samba/smbpasswd

# The following are needed to allow password changing from Windows to

# update the Linux system password also.

# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.

# NOTE2: You do NOT need these to allow workstations to change only

#        the encrypted SMB passwords. They allow the Unix password

#        to be kept in sync with the SMB password.

;  unix password sync = Yes

;  passwd program = /usr/bin/passwd %u

;  passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*

# Unix users can map to different SMB User names

;  username map = /etc/samba/smbusers

# 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 = /etc/samba/smb.conf.%m

# Most people will find that this option gives better performance.

# See speed.txt and the manual pages for details

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# Configure Samba to use multiple interfaces

# If you have multiple network interfaces then you must list them

# here. See the man page for details.

;   interfaces = 192.168.12.2/24 192.168.13.2/24

# Configure remote browse list synchronisation here

#  request announcement to, or browse list sync from:

#   a specific host or from / to a whole subnet (see below)

;   remote browse sync = 192.168.3.25 192.168.5.255

# Cause this host to announce itself to local subnets here

   remote announce = 192.168.0.255 192.168.2.44 192.168.254.55

# Browser Control Options:

# set local master to no if you don't want Samba to become a master

# browser on your network. Otherwise the normal election rules apply

   local master = yes

# OS Level determines the precedence of this server in master browser

# elections. The default value should be reasonable

   os level = 255

# Domain Master specifies Samba to be the Domain Master Browser. This

# allows Samba to collate browse lists between subnets. Don't use this

# if you already have a Windows NT domain controller doing this job

   domain master = yes

# Preferred Master causes Samba to force a local browser election on startup

# and gives it a slightly higher chance of winning the election

   preferred master = yes

# Enable this if you want Samba to be a domain logon server for

# Windows95 workstations.

;   domain logons = yes

# if you enable domain logons then you may want a per-machine or

# per user logon script

# run a specific logon batch file per workstation (machine)

;   logon script = %m.bat

# run a specific logon batch file per username

;   logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)

#        %L substitutes for this servers netbios name, %U is username

#        You must uncomment the [Profiles] share below

;   logon path = \\%L\Profiles\%U

# All NetBIOS names must be resolved to IP Addresses

# 'Name Resolve Order' allows the named resolution mechanism to be specified

# the default order is "host lmhosts wins bcast". "host" means use the unix

# system gethostbyname() function call that will use either /etc/hosts OR

# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf

# and the /etc/resolv.conf file. "host" therefore is system configuration

# dependant. This parameter is most often of use to prevent DNS lookups

# in order to resolve NetBIOS names to IP Addresses. Use with care!

# The example below excludes use of name resolution for machines that are NOT

# on the local network segment

# - OR - are not deliberately to be known via lmhosts or via WINS.

; name resolve order = wins lmhosts bcast

# Windows Internet Name Serving Support Section:

# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server

;   wins support = yes

# 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

# WINS Proxy - Tells Samba to answer name resolution queries on

# behalf of a non WINS capable client, for this to work there must be

# at least one   WINS Server on the network. The default is NO.

;   wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names

# via DNS nslookups. The built-in default for versions 1.9.17 is yes,

# this has been changed in version 1.9.18 to no.

   dns proxy = no

# Case Preservation can be handy - system default is _no_

# NOTE: These can be set on a per share basis

;  preserve case = no

;  short preserve case = no

# Default case is normally upper case for all DOS files

;  default case = lower

# Be very careful with case sensitivity - it can break things!

;  case sensitive = no

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

   idmap uid = 16777216-33554431

   idmap gid = 16777216-33554431

   template shell = /bin/false

   winbind use default domain = no

   encrypt passwords = yes   

   guest ok = yes

[homes]

   comment = Home Directories

   browseable = yes

   writeable = yes

   share modes  true 

# Un-comment the following and create the netlogon directory for Domain Logons

; [netlogon]

;   comment = Network Logon Service

;   path = /home/netlogon

;   guest ok = yes

;   writable = no

;   share modes = no

# Un-comment the following to provide a specific roving profile share

# the default is to use the user's home directory

[printers]

   comment = All Printers

   path = /var/spool/samba

   browseable = no

# Set public = yes to allow user 'guest account' to print

;   guest ok = no

;   writeable = no

   printable = yes

# This one is useful for people to share files

[tmp]

   comment = Temporary file space

  path = /tmp

  read only = no

   public = yes

# This one is useful for people to share files

[rich]

   comment = Different one

  path = /tmp/rich

  read only = no

   public = yes

 

[bob]

   comment = bobsdir

   path = /mnt/bob

   read only = no 

   public = yes 

# A publicly accessible directory, but read only, except for people in

# the "staff" group

[public]

   write list = @staff

# Other examples.

#

# A private printer, usable only by fred. Spool data will be placed in fred's

# home directory. Note that fred must have write access to the spool directory,

# wherever it is.

[fredsprn]

   comment = Fred's Printer

   valid users = fred

   path = /homes/fred

   printer = freds_printer

   public = no

   writable = no

   printable = yes

# A private directory, usable only by fred. Note that fred requires write

# access to the directory.

[fredsdir]

   comment = Fred's Service

   path = /usr/somewhere/private

   valid users = fred

   public = no

   writable = yes

   printable = no

# a service which has a different directory for each machine that connects

# this allows you to tailor configurations to incoming machines. You could

# also use the %u option to tailor it by user name.

# The %m gets replaced with the machine name that is connecting.

[pchome]

  comment = PC Directories

  path = /usr/pc/%m

  public = no

  writable = yes

# A publicly accessible directory, read/write to all users. Note that all files

# created in the directory by users will be owned by the default user, so

# any user with access can delete any other user's files. Obviously this

# directory must be writable by the default user. Another user could of course

# be specified, in which case all files would be owned by that user instead.

[bob]   comment = Write to me bitch 

   path = /home/

   writeable = yes

   browseable = yes

   guest ok = yes

   public = yes 

[all]

   comment = every one can read wrote 

   path = /all

   writeable = yes 

   browseable = yes 

   read only = no 

   public = yes

```

hey man all urs

----------

## DagonSphere

So is the problem writing to [bob], [all], or both?

You may also want to remove the trailing `/` in /home/ -- or remove that share altogether.

 *Quote:*   

> [bob]   comment = Write to me bitch
> 
>         path = /home/
> 
>         writeable = yes
> ...

 

change to

```
[bob]   comment = Write to me bitch

        path = /home

        writeable = yes

        browseable = yes

        guest ok = yes

        public = yes 
```

Again, are you sure you're restarting your samba server every time you make changes to your conf file?

----------

## gentoobobby

yep 

deffo had so many problems today. 

getting to me loads

----------

## gentoobobby

just to the all folder 

il show u what i have doe as i keep moding as i go along 

i mande directory /all 

chmod 777 /all 

canot not write to it

----------

## gentoobobby

ok did 5 samba restarts before i went into folder still didnt work 

i then rebooted machine properly and it worked not sure whats up here

----------

## DagonSphere

1st.  Can you write to the tmp share?

I would comment out EVERY share you don't need.  Some shares are there for example only.  Leaving only the following modified shares active

This share displays the users home directory, only to that user.  So, if you're loggin in as `bob` you'll see your home directory

```
[homes]

   comment = Home Directories

   browseable = yes

   writeable = yes

```

This share should be accessable to everybody, regardless of authentication

```
# This one is useful for people to share files

[tmp]

   comment = Temporary file space

  path = /tmp

  read only = no

   public = yes 
```

This is similar to the tmp share, as everyone has access

```
[all]

   comment = every one can read wrote

   path = /all

   writeable = yes

   browseable = yes

   read only = no

   public = yes 
```

Obviously, leave all the [global] definitions in tact.  There's a lot of active shares that you may not need.  Also, do you have DNS running on the system?  I'm pretty sure it needs to be running in order for samba to function properly.

----------

## gentoobobby

i have a router that gives out dhcp 

hey mate thanks for the adive im gonba give this ago commenting out stuff i may not need

----------

## DagonSphere

Guess I jumped the gun at posting.  Well, if it works, then go with it  :Wink: 

----------

## DaveArb

 *gentoobobby wrote:*   

> im gonba give this ago commenting out stuff i may not need

 

God, for sure.

```
dave@shares ~ $ wc /etc/samba/smb.conf

 18  65 419 /etc/samba/smb.conf
```

Less is more.  :Wink: 

Dave

----------

## DagonSphere

 *DaveArb wrote:*   

> 
> 
> Less is more. 
> 
> 

 

Indeed!

----------

