PDA

View Full Version : HOWTO: Setup Samba peer-to-peer with Windows


Pages : [1] 2 3 4 5

Stormbringer
June 23rd, 2006, 06:24 PM
HOWTO: Setup Samba peer-to-peer with Windows

As many fellow Ubuntu users seem to have trouble setting up samba peer-to-peer with Windows I decided to write a small howto on this matter.

NOTE: I am aware that there's a wiki-page as well as several other howto's around - but by looking at the constant "how do I setup samba" posts that are floating around in the forum I simply see the need for a more thourough guide on this matter.

Feel free to contribute and suggest - it'll only help to make this howto a better guide.

The goal of this howto is to have samba act like a Windows Workstation in the LAN. As a "value added bonus" we will use samba to do netbios name resolution so that you can use the names of the workstations for network drive mapping instead of their ip-addresses (i.e.: \MY_WINDOWS_BOX\SHARE) - but only for as long as your Linux box has an static ip-address and is up and running.

This guide is based on Ubuntu 6.06 LTS and intended for all architectures (i386, AMD64, ...) - if you are still using Breezy it's safe to follow this guide as there should be no differencies.

A second guide on how to setup samba as Primary Domain Controller along with several other services such as DHCP, DNS and NTP will follow later on as this topic will be a little more thourough.


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.

- You need to have samba installed.
If you haven't done so already open a terminal and type:


sudo apt-get install samba


Don't close the terminal upon installation - we still need the commandline to get several tasks done!


2. Getting samba configured

First, let us make sure samba isn't running:


sudo /etc/init.d/samba stop


As a starting point I included an smb.conf below, and there are only a few simple things you may need to tweak.

Since the installation of samba just installed a rather useless template file we're going to rename it - we keep the file just in case.


sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.template


Next we create a new empty file


sudo touch /etc/samba/smb.conf


And finally we need to open the file inside an editor


sudo gedit /etc/samba/smb.conf

NOTE: If you're on KDE replace "gedit" with "kate"

Copy / Paste the contents of the code-section below into your editor and read on ...


[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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP


Ok, I already mentioned that there are a few simple things you may need to tweak; so here they are:

-> netbios name = YOUR_HOSTNAME

Replace "YOUR_HOSTNAME" with your desired hostname (don't use spaces!). Best pratice would be to use the same name you configured upon installation.

Example:

netbios name = DAPPER

-> workgroup = YOUR_WORKGROUP

Replace "YOUR_WORKGROUP" with the name of your workgroup, but make sure you're using the same as configured in Windows.

To find out the Workgroup name in Windows follow these steps:

- Click "START"
- Click "Control Panel"
- Click "System"
- Click the 2nd Tab entitled "Computername" and find the name of the Workgroup there.

Example:

workgroup = MSHOME

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

-> [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!

-> path = /media/samba/

This suggests that you've mounted an hard drive or partition on /media/samba where all the shared files will be stored.

In case you don't have an extra hard drive/partition you may also create folder.

I assume you've been wise enough to put /home onto a separate partition having an reasonable amount of storage space.

To create the folder type (inside a new terminal) ...


sudo mkdir /home/samba


... and adjust "path =" to read ...

path = /home/samba/

Remember that this is just an example - you are free to put things wherever you like.

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

Example:

force user = stormbringer
force group = stormbringer

Now we completed the part of editing smb.conf

Save the file and close gedit.

Since we are going to share the folder with other users we should now make sure that the permissions are set. Type:


sudo chmod 0777 /media/samba

NOTE: Don't forget to correct the path to the location you chose above!

That's it - now we need to start samba ...


1.1 Starting samba and setting up user accounts

Let us fire up samba for the first time. Type:


sudo /etc/init.d/samba start


There shouldn't be any errors - if you are presented with an error message make sure everything is correct (search for typos and/or invalid paths).

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!


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!

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!

In the following example we will add an user called "mark" ...

Example:


sudo useradd -s /bin/true mark
sudo smbpasswd -L -a mark
sudo smbpasswd -L -e mark


The "-s /bin/true" in the first line prevents the users from being able to access the commandline of your linux box ("-s" stands for "shell"). I strongly advise you to follow this recommendation! Don't change that setting to a valid login-shell unless you really know what you are doing!

Repeat this step until you configured all user accounts!

Now that we configured samba and created the user accounts we are done with the Linux-part - there's one more thing to do in Windows.


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!

- Click "START"
- Click "Control Panel"
- Click "Network Connections"
- Find your "LAN Connection"
- Right-click the icon and select "Properties"
- Select the "TCP/IP" Protocol and click the "Properties" button
- Click "Advanced"
- Select the third Tab entitled "WINS"
- Click "Add"
- Type in the ip-address of your Linux box
- Click "Add"
- Select "Use NetBIOS over TCP/IP"
- Click "OK"
- Click "OK"
- Click "OK"
- Reboot Windows

Upon reboot you may now map the network drive within Windows.

With WINS enabled:
- Click "START"
- Right-click "My Computer"
- Select "Map network drive"
- Choose the drive letter
- Type \\DAPPER\MyFiles
NOTE: Adjust this to the hostname and sharename you chose above!
- Click "Finish"

With WINS disabled:
- Click "START"
- Right-click "My Computer"
- Select "Map network drive"
- Choose the drive letter
- Type \\<ip-address>\MyFiles
NOTE: To find out the ip-address of your Linux box type "ifconfig" inside a terminal and find the ip for the correct interface (i.e. eth0). Don't forget to adjust the sharename to the name you chose above.
- Click "Finish"

That's it - samba is up and running now.


3. Security consideration

This is the right time to think about security right away.

In case your computer has more than one network connection (i.e. wired and wireless ethernet) you may want to restrict access to samba.

If not especially configured samba will bind its service to all available network interfaces.

So, let us assume you only want your wired network to have access and that the network card is called eth0.

Add the following lines to the [general] section of your smb.conf to achieve that goal:


interfaces = lo, eth0
bind interfaces only = true


If you did it correctly it should look similar to this:


[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
interfaces = lo, eth0
bind interfaces only = true


Now only the local loopback interface (dubbed "lo") and eth0 are able to access samba - there's no need to fear that someone might break into your system by wireless as the interface isn't bound to the service.


4. Final words

If you happen to have any questions feel free to ask - I'll try to help as soon as possible.

If you find any mistakes in this howto please let me know so that I can fix them.

Feel free to contribute and suggest - help to make this howto a better guide.


5. Addendum: Useful links

Here are some links you may find useful.

The onsite links refer to other samba-guides and to ubuntu_daemon's "Important Links" thread.

- Onsite
Ubuntu Help: Windows Networkworking (https://help.ubuntu.com/ubuntu/serverguide/C/windows-networking.html)
Ubuntu Documentation: Setting up Samba (https://help.ubuntu.com/community/SettingUpSamba)

READ THIS FIRST prior to posting - IMPORTANT links (http://www.ubuntuforums.org/showthread.php?t=232059) (by ubuntu_daemon)


The offsite links refer to the offical Samba homepage and to a selected choice of their official documentation; these links are useful if you like to dig yourself into the mysteries of samba's configuration and usage as well as troubleshooting problems.

- Offsite
Samba Homepage (http://samba.org/)

Practical Exercises in Successful Samba Deployment (http://us3.samba.org/samba/docs/man/Samba-Guide/)
The Official Samba-3 HOWTO and Reference Guide (http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/)
Using Samba, 2nd Edition (http://us3.samba.org/samba/docs/using_samba/toc.html)

ubuntuman001
June 24th, 2006, 02:11 PM
stormbringer, wonderful guide you have created, I have a few questions though.

you say that you will make this guide more thorough later to include DHCP with samba. is that going to happen any time soon or have you not planned it yet?

also, please look at my attachment, it's a drawing of the way my network is physically setup. i just want to know if my network is safe. i use my windows desktop's shared folder as my backup folder, the folder where i backup all of my ubuntu stuff on it. my smb.conf is as generic as it can be, and i don't have a shared folder on my ubuntu desktop because i can browse, save, write to, and delete files on my windows desktop's shared folder. it never asks me for a password or anything on ubuntu. i just go to places, network servers, and go into my windows desktop's shared folder.

is it me, or does that just not sound safe at all?!

Stormbringer
June 24th, 2006, 03:10 PM
you say that you will make this guide more thorough later to include DHCP with samba. is that going to happen any time soon or have you not planned it yet?

Well - this HOWTO was a piece of cake as it aims at simple home usage. but ...

The "second part" of the guide (I guess I'll call it "HOWTO: Setup Samba as an PDC with additional services") is planned, in the early stage of becoming, but won't happen soon (read: within a couple of a few days) as it's even more complex to write.

The aim will be professional usage of Ubuntu/Samba in Office-, School- or Corporate environments (as a replacement for Windows Servers) - therefore I will need to include basic guides on how to configure DHCP, DNS and NTP to play nice altogether.

If you like to proof-read or contribute the one or another idea I'll PM you the "development draft" as it gets complete.

also, please look at my attachment, it's a drawing of the way my network is physically setup. i just want to know if my network is safe.

By looking at the drawing it looks good ... but ...

In case you have neighbors within the reach of your wireless router I hope you at least enabled encryption (WEP, 128-Bit minimum) so that no one can abuse your internet connection or exploit your data.

I can browse, save, write to, and delete files on my windows desktop's shared folder. it never asks me for a password or anything

Do you need to enter a password upon bootup of Windows?

If you need to enter a password to log into Windows then Ubuntu has saved your password in the keyring - you must not enter it anew upon connect to the shared folder.

If Windows (XP?) doesn't ask you for a password you better set one right away (START -> Control Panel -> User Accounts).

Running around without an password makes it easy to gain access to your system and data. Every scriptkiddy that's within the reach of your wireless router and able to use a wireless sniffer may gain access in a matter of minutes (that's no fiction but a fact unless you use WPA or WPAv2 encryption on your wireless link).

Storm.

ubuntuman001
June 24th, 2006, 04:05 PM
Well - this HOWTO was a piece of cake as it aims at simple home usage. but ...

The "second part" of the guide (I guess I'll call it "HOWTO: Setup Samba as an PDC with additional services") is planned, in the early stage of becoming, but won't happen soon (read: within a couple of a few days) as it's even more complex to write.

The aim will be professional usage of Ubuntu/Samba in Office-, School- or Corporate environments (as a replacement for Windows Servers) - therefore I will need to include basic guides on how to configure DHCP, DNS and NTP to play nice altogether.

If you like to proof-read or contribute the one or another idea I'll PM you the "development draft" as it gets complete.thanks for that info, and no i don't need the develpoment draft, but thank you for the offer (as i'm extremely horrible when it comes to samba!)



By looking at the drawing it looks good ... but ...

In case you have neighbors within the reach of your wireless router I hope you at least enabled encryption (WEP, 128-Bit minimum) so that no one can abuse your internet connection or exploit your data.yes i do have 128-bit encryption on my router



Do you need to enter a password upon bootup of Windows?no...

If you need to enter a password to log into Windows then Ubuntu has saved your password in the keyring - you must not enter it anew upon connect to the shared folder.

If Windows (XP?) doesn't ask you for a password you better set one right away (START -> Control Panel -> User Accounts).i just made one!

Running around without an password makes it easy to gain access to your system and data. Every scriptkiddy that's within the reach of your wireless router and able to use a wireless sniffer may gain access in a matter of minutes (that's no fiction but a fact unless you use WPA or WPAv2 encryption on your wireless link).even if you have wep encryption on your router?

Stormbringer
June 24th, 2006, 04:23 PM
even if you have wep encryption on your router?

WEP has a known design flaw in the encryption algorithm - by capturing raw pakets with an wireless sniffer (AirSnort and other auditing tools like this) you are able to "sniff" the encryption key in use.

Using 128-Bit WEP encryption will only make it a little more harder to sniff the key, but not impossible (in the end it's the software that's doing all the rocket-science for you).

- If your wireless router has an option to allow only specific MAC addresses use this option to tighten your security (input the MAC addresses of all your wireless cards). It won't protect you if the MAC gets faked by an attacker, but it's an additional step to make your wireless radio a little more secure.

- DISABLE the broadcast of your ESSID (that's the ID of the wireless router) - it'll be harder to find by using sniffers if it's "stealth" (not announcing itself to the rest of the world next to you). If you need to connect a new device you should know the name (ID) of your wireless router - so you're able to input it.

Being a little paranoid when it comes to wireless ethernet is always a good idea.

Storm.

Arisna
June 24th, 2006, 04:40 PM
Thanks for posting this, Stormbringer. Thank you also for your suggestion in the other Samba topic, although for the time being my network is made up of all trusted users (immediate family) and has no wireless access, so I do not see a security risk in allowing everyone on the LAN to see my (fairly unimportant) shared files. I should have been more specific before.

Finally, I was curious what the security advantage would be in having the "hosts allow" parameter within the share definitions versus within the global section. I understand the utility of per-share usergroup permissions. Again, thank you for helping out people like me who are inexperienced with Samba.

ubuntuman001
June 24th, 2006, 05:54 PM
WEP has a known design flaw in the encryption algorithm - by capturing raw pakets with an wireless sniffer (AirSnort and other auditing tools like this) you are able to "sniff" the encryption key in use.

Using 128-Bit WEP encryption will only make it a little more harder to sniff the key, but not impossible (in the end it's the software that's doing all the rocket-science for you).

- If your wireless router has an option to allow only specific MAC addresses use this option to tighten your security (input the MAC addresses of all your wireless cards). It won't protect you if the MAC gets faked by an attacker, but it's an additional step to make your wireless radio a little more secure.

- DISABLE the broadcast of your ESSID (that's the ID of the wireless router) - it'll be harder to find by using sniffers if it's "stealth" (not announcing itself to the rest of the world next to you). If you need to connect a new device you should know the name (ID) of your wireless router - so you're able to input it.

Being a little paranoid when it comes to wireless ethernet is always a good idea.

Storm.okay, i did disable the ESSID, but the mac address thing is a little iffy. In my router settings, I found a "MAC Address Clone" tab, and in it, it says: "In this page, you can change the WAN MAC address of this router.
User Defined WAN MAC Address: 00.00.00.00.00.00"
how am i supposed to input all of my MAC addresses when I can only input one?!
Also, how do I find my wireless devices' MAC addresses?

Stormbringer
June 24th, 2006, 07:40 PM
Finally, I was curious what the security advantage would be in having the "hosts allow" parameter within the share definitions versus within the global section. I understand the utility of per-share usergroup permissions. Again, thank you for helping out people like me who are inexperienced with Samba.

The advantage is that you can control which clients, or network, will be allowed to connect to the share in question. Hosts that don't fall into allowed-list are not able to log into the service - even if they provide valid user credentials.

It may not be that important in a typical home-setup, but it makes some sense if you run samba on a multi-homed (server with several network-cards) system.

Hope this clarifies your question.

Stormbringer
June 24th, 2006, 07:44 PM
okay, i did disable the ESSID, but the mac address thing is a little iffy. In my router settings, I found a "MAC Address Clone" tab, and in it, it says: "In this page, you can change the WAN MAC address of this router.

Don't touch this setting! It's related to the WAN interface (the interface that connects your router to the internet).

BTW: What make (manufacturer) and model is your router?

Also, how do I find my wireless devices' MAC addresses?

In Windows (2000/XP) open the command prompt and type

> ipconfig /all

Find the Network Interface that represents your Wireless radio and write down the "Hardware address" (consists of 8 pairs of Hex-values).

ubuntuman001
June 24th, 2006, 10:41 PM
BTW: What make (manufacturer) and model is your router?it is a linksys
BEFW11S4 wireless-B broadband router (it's one of the older kinds)

closeyourwindows
June 26th, 2006, 01:54 AM
This is by far the best guide I have seen. It worked on the first try and without a reboot. I have been struggling with samba for some time now and this guide is great. Thanks.

gary4gar
July 2nd, 2006, 06:50 AM
awesome tuttorial mate
keep it up, very good work done
keep more like this cumming

penguinfan
July 2nd, 2006, 11:55 AM
Thanx Stormbringer, we need more penguins like u. This is the simplest & best howto by far. I got samba working 1st time and without reboot.

Stormbringer
July 2nd, 2006, 03:02 PM
Thanks for all your cheers ... I'm glad the guide works out that smoothly as it has been a rather quick edit.

mwells
July 3rd, 2006, 05:29 PM
Hi,

Firstly many thanks for the how-to it looks awesome . .and have printed it off allready!!

I just wondered if I could ask a stupid question as there is something that I havnt quite understood (about samba, not from your tut), and that is about the passwords.

[b]
-> 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!).

Example:

force user = stormbringer
force group = stormbringer


Am i putting in the passwords for the Linux account? :oops:

I get a little confused as I know samba can take the password from the windows logon session (i think) . . and this can somehow be used to tie into a user of matching name on the linux system

For instance i want to make my home directory viewable and writable by me. . and have it password protected, but how would I do this?

hope they arn't too stupid a question to ask, and once again thanks for the how-to

/Matt

Stormbringer
July 3rd, 2006, 05:50 PM
I just wondered if I could ask a stupid question as there is something that I havnt quite understood (about samba, not from your tut), and that is about the passwords.

Am i putting in the passwords for the Linux account? :oops:

In the section you quoted from my howto you have to put in your username - not your password!


force user = mwells
force group = mwells


This assumes your useraccount on windows AND linux is actually called "mwells". Please change it to your setting.

I get a little confused as I know samba can take the password from the windows logon session (i think) . . and this can somehow be used to tie into a user of matching name on the linux system

Add your useraccount to samba (the smbpasswd thing) and Samba should grant your Windows box access automatically!

Just to stress it once again - this'll only work if both useraccounts on both computers and both OS's have the very same username/password combo. If this isn't the case then it won't work out automatically.

For instance i want to make my home directory viewable and writable by me. . and have it password protected, but how would I do this?

REMOVE the semicolons from the lines in the [homes] section (in smb.conf, everything that is written after a semicolon is considered to be a remark) ... make it look like the following example ...


[homes]
valid users = %S
create mode = 0600
directory mode = 0755
browseable = no
read only = no
veto files = /*.{*}/.*/mail/bin/


hope they arn't too stupid a question to ask

From my point of view "stupid questions" don't exist --- no one know about everything...

mwells
July 3rd, 2006, 06:53 PM
ah sorry, i meant the username, my bad.

And thanks very much for the quick reply, that helped me out a lot.

So just to clarify, if there is a user 'mwells' on linux with password 'x', and a user with exactly the same credentials on a windows box they would sail straight in . .but if the user on windows had the same name but no (or a different password), would they then get a password prompt when trying to connect to the home file?

Also the create_mode and directory mode, is it a correct assumption to make that these place the writes on the files/directories created by the accessing user? and what would the %S rule give for valid users?

Once again, many many thanks for your help .. I realise i am being increadably lazy not reseaching this myself!

/Matt

Stormbringer
July 3rd, 2006, 07:15 PM
ah sorry, i meant the username, my bad.

No problem ...

So just to clarify, if there is a user 'mwells' on linux with password 'x', and a user with exactly the same credentials on a windows box they would sail straight in.

Yap - Windows (XP) should be able to find the shared folders of your Linux box as well as your home directory automatically in the Network Neighborhood as long as both users have the same login-credentials and as long as both computers are inside the very same workgroup (sorry, forgot to mention this).

but if the user on windows had the same name but no (or a different password), would they then get a password prompt when trying to connect to the home file?

If the user has the same name but no, or different, password, Windows _should_ prompt you for the password.

Also the create_mode and directory mode, is it a correct assumption to make that these place the writes on the files/directories created by the accessing user? and what would the %S rule give for valid users?

The "create mode" and "directory mode" lines are meant to keep the modes of the files nicely ... without these, Windows would create files and directories as 775 / 775 (rwxrwxr-x).

The default directory mode - inside of /home/<username> - is 755, and having mere datafiles executable by default wouldn't make much sense.

%S hold the username of the connection - so you will automatically connected to the right user-home.

I realise i am being increadably lazy not reseaching this myself!

In case you like to do some research: man smb.conf ;-)

featherking
July 3rd, 2006, 07:33 PM
Great guide,

Dont know if anyone stumbled across this problem but i was trying to share a folder with a space in the name. "//RON/iTunes Music" is the path to the folder i was trying to access from my linux box. I couldnt get it to work with the space; however, i found after some searching that samba accepts "\040" without quotes, as a space!

So if you want to share a folder with a space try it like this //RON/iTunes\040Music and you should be good to go.

Hope that helps somebody

-The King

Stormbringer
July 3rd, 2006, 07:46 PM
Alternatively you may put the UNC-Path inside of Quotes to make it work...

i.e. "\\RON\iTunes Music"

Example from within the command-line of Windows

net use x: "\\RON\iTunes Music" /persistent:yes

Shampyon
July 12th, 2006, 07:52 AM
I'm now fully networked, write access and all, with my brother's PC. All thanks to the help recieved here, giving me the courage and the knowledge to get my hands dirty and actually set this up, where normally I would rely entirely on automated installers.

I doubt I'd be able to articulate how to do all this to anyone else, over the phone or 'net, but if anyone ever asked me to go over to their house to set up an XP/Ubuntu network I know I'd be able to do so with confidence.

I just wanted to say thank you to all the people involved in this thread for sharing your knowledge and being patient with our problems :)

AsYouWish
July 17th, 2006, 03:34 PM
So ah... didnt work.

I followed the instructions. When I go to map network drive on my winXP box, it looks but doesnt find anything. Im (really really) sure I have the ip address right and the share name right.

Could it be that I'm trying to share /home/share ? I tried changing some things according to the Wiki to be able to read/write home directories, but still, the samba share isnt being seen by my xp computer.

My xp account is Matt, and the account on my ubuntu machine is matt, with different passwords. I added matt, Matt, and just to be safe MATT, as samba users, still no effect.

I feel like I'm missing something... any clues?

Thanks

Stormbringer
July 17th, 2006, 03:49 PM
My xp account is Matt, and the account on my ubuntu machine is matt, with different passwords. I added matt, Matt, and just to be safe MATT, as samba users, still no effect.

Having different passwords across two machines for the same useraccount is a most common pitfall.

You added the useraccount to Samba (btw: there's no need for Upper-/Lowercase as Windows ignores the cases in a standard setup - so simply delete the ones having different spelling to the one of your Linux box) --- but with WHICH password?

- If you gave the user the password of your Linux box it's the wrong one. Change it with smbpasswd to the correct one.
- If you gave the user the password of your Windows box it's the right one and everything _should_ work ok.

Samba not displaying anything usually means...

...the user isn't enabled on the Linux box (sudo smbpasswd -e <username>)
...the password of the user accounts don't match.
...that one of the systems is inside the wrong workgroup.

That's all I can think of by looking at your post.

-Storm

AsYouWish
July 17th, 2006, 09:03 PM
Ok so... that didnt work. Here is my smb.conf. I've tried several differnt version but this is straight from your howto.

My smb.conf:


[global]
; General server settings
netbios name = server
server string =
workgroup = mshome
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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[Files]
path = /media/share/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = matt
force group = matt



So my ubuntu acct is matt with password1 and my winxp accoutn is Matt with password2. I set and enabled user 'matt' with password2 in smbpasswd. Still nothing. When I enter \\192.168.1.102\Files I get a pause, and then a 'could not be located' error.

Does it matter Im running this on a PPC?
Does it matter that \media\share is not actual media but just a dir I created?
Does it matter that i'm setting this up via VNC to desktop 1 (not 0)

Argh. Sorry to be a pain. Thanks.

Stormbringer
July 17th, 2006, 09:37 PM
Your smb.conf looks fine - and it shouldn't matter that you're running Ubuntu PPC.

Try the following command inside a Terminal ...

# smbclient -L localhost -U%

When asked for a password you need to type "password2".

If the command returns an error you either entered the wrong password or there's something fishy with your samba setup. You should see something like this ...


Domain=[STORMBRINGER] OS=[Unix] Server=[Samba 3.0.22-Ubuntu]

Sharename Type Comment
--------- ---- -------
netlogon Disk Network Logon Service
print$ Disk Printer Drivers
IPC$ IPC IPC Service (nebuchanezzar)
ADMIN$ IPC IPC Service (nebuchanezzar)
Domain=[MSHOME] OS=[Unix] Server=[Samba 3.0.22-Ubuntu]

Server Comment
--------- -------
NEBUCHADNEZZAR

Workgroup Master
--------- -------
STORMBRINGER NEBUCHADNEZZAR


If you get a result similar to the one from right above then samba is running and doing fine.

If not, let's see if Windows is freaking out...

Try to ping your Windows box from Linux and vice versa just to make absolutely sure that you're network connection is fine.

If this works please take a look into the Firewall control panel in Windows and make sure that the firewall is either disabled or "File- and Printersharing" is allowed to pass through the firewall.

Try to disable "Require SignOrSeal" (encrypted smb-connections) in Windows XP ...

To make this an easy job simply paste to following lines into notepad and save it as DisableReqSignOrSeal.reg (or any filename you like)


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Netlogon\Parameters]
"requiresignorseal"=dword:00000000


Open the location where you saved the file, double-click, and confirm the dialog.

Reboot and try again...

It should be sufficient to paste this line into any open Explorer windows: \\192.168.1.102\Files

If it still doesn't work, try to connect to the share from the command-line:

net use x: \\192.168.1.102\Files password2 /user:matt /persistent:yes

Try these steps and tell me how it turned out.

AsYouWish
July 17th, 2006, 09:56 PM
Yeah... I'm a retard. Forgot about ZoneAlarm... silently blocking me from the outside world. Couldnt ping the XP box from Ubuntu so I added 192.168.1.100-110 to the trusted zone and bingo. Fully functional.


Thanks so much.

PENGUIN-PC
July 18th, 2006, 01:09 PM
Well first of all I would like to say thank you very much for this post!!:KS
But Im haveing a few issues that I can't quite solve. I can ping my linux box from a windows box and vice versa, but I can't exchange any data or map a drive. I tried everything in your post, but I still get, from both boxes, that permission is required.:-k Here is my output when I type

smbclient -L localhost -U%

Domain=[WINBLOWS] OS=[Unix] Server=[Samba 3.0.22]

Sharename Type Comment
--------- ---- -------
ADMIN$ IPC IPC Service ()
IPC$ IPC IPC Service ()
MyFiles Disk
print$ Disk
Domain=[WINBLOWS] OS=[Unix] Server=[Samba 3.0.22]

Server Comment
--------- -------
DARE-DEVIL

Workgroup Master
--------- -------
WINBLOWS DARE-DEVIL


and this is my smb.cfg file setup

[global]
; General server settings
netbios name = dare-devil
server string =
workgroup = WINBLOWS
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
;interfaces = lo, eth0
;bind interfaces only = true

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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = dare-devil
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

;Uncomment if you need to share your CD-/DVD-ROM Drive
[DVD-ROM Drive]
path = /media/dvd-rw
browseable = yes
read only = yes
guest ok = yes

[MyFiles]
path = /home/dare-devil/
browseable = yes
read only = yes
guest ok = yes
create mask = 0644
directory mask = 0755
force user = dare-devil
force group = WINBLOWS

Any help would be greatly appreciated Storm!! Again thanks so much for your time you have put into making this post.

Stormbringer
July 18th, 2006, 01:33 PM
Ok, let's see if we can get your problem solved ...

- About the "permission is required" thing:
What's the exact error message and what do you do to get it?

- About your smb.conf
Wait a sec; what's that?


[MyFiles]
path = /home/dare-devil/
browseable = yes
read only = yes
guest ok = yes
create mask = 0644
directory mask = 0755
force user = dare-devil
force group = WINBLOWS


Are you trying to share your home directory? That won't work out that way.

EDIT What's the "force group" ??? "WINBLOWS"? All uppercase? That looks dead wrong unless you created such a group yourself.


force user = dare-devil
force group = dare-devil


Would be more right.
/EDIT

If you like to "share" your home, then you should do it that way instead ...


[global]
; General server settings
netbios name = dare-devil
server string =
workgroup = WINBLOWS
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
;interfaces = lo, eth0
;bind interfaces only = true

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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
[homes]
valid users = %S
create mode = 0600
directory mode = 0755
browseable = no
read only = no
veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = dare-devil
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

;Uncomment if you need to share your CD-/DVD-ROM Drive
[DVD-ROM Drive]
path = /media/dvd-rw
browseable = yes
read only = yes
guest ok = yes


The difference is that I enabled the [homes] section and removed the share you declared at the bottom of the file.

If the directory in question (/home/dare-devil) *IS NOT* the home directory of a valid user account but a badly placed data directory you like to share on the network you may have an issue with the filesystem permissions.

# sudo chmod 0777 /home/dare-devil
# sudo chown dare-devil.dare-devil /home/dare-devil

Again - DO NOT ALTER the permissions if it's the home directory of a valid user account! You may break your local login.
You've been warned.

Restart samba (sudo /etc/init.d/samba restart) and map your home-directory (commandline example):

net use h: \\dare-devil\dare-devil your_password /user:dare-devil /persistent:yes

Awaiting your answer ...

-Storm

PENGUIN-PC
July 18th, 2006, 03:48 PM
Ok...thanks for the quick reply, I expected it to be a day or two!!

Anyhow, in response, yes WINBLOWS is the name of the WORKGROUP I created on my windows box, and I just thought it would keep things simple if I used that as my force group. Did I figure wrong in my understanding of how this all works? I am new to samba, so i really appreciate all your help.

Yes, /home/dare-devil is the home directory of a valid user account. I would like to share the whole directory, and I only want to share it with my home network not anything outside of it. I would like to be able to uncomment out the following so I can use your suggestion.

;interfaces = lo, eth0
;bind interfaces only = true

Do these lines have anything to do with preventing me from being able to use the connection?

As for the exact error message I get here is the screen dump for you.

Ohh and it seems that I already kinda bokre my login on my linux box, because it was telling me that I shouldn't be sharing my home folder or something like that ahhhh](*,)

Thanks again for any, and all your help, it reall is appreciated storm, your're a great penguin!

Stormbringer
July 18th, 2006, 04:13 PM
Ok...thanks for the quick reply, I expected it to be a day or two!!

Anyhow, in response, yes WINBLOWS is the name of the WORKGROUP I created on my windows box, and I just thought it would keep things simple if I used that as my force group. Did I figure wrong in my understanding of how this all works? I am new to samba, so i really appreciate all your help.

The "force group" parameter inside the definition of the share DOES NOT, i repeat: DOES NOT, refer to a Windows-Workgroup but to the group of the local useraccount(s) on your Linux box.

So, "force group" should contain the same definition as "force user". But as you only like to share your home you won't need to bother with this directive.


Yes, /home/dare-devil is the home directory of a valid user account. I would like to share the whole directory, and I only want to share it with my home network not anything outside of it. I would like to be able to uncomment out the following so I can use your suggestion.


Kill the share you added at the bottom of the file and remove the comments at the [homes] section (remove the ";" at the beginning of the lines).


;interfaces = lo, eth0
;bind interfaces only = true

Do these lines have anything to do with preventing me from being able to use the connection?


Nope - the lines just tell samba to which network interfaces the daemon should bind by default; if it isn't specified it will bind to *any* available interface that is up.

This is a very useful directive if your box has multiple interfaces (i.e. 2 network cards, wireless, firewire, bluetooth, and so on). By giving the names of the interfaces the daemon will only bind to the ones you configured; the ones not specified will be leaved out.


As for the exact error message I get here is the screen dump for you.

You actually can share your home directory ([homes] section of smb.conf), but trying it the way you did may lead to severe problems.


Ohh and it seems that I already kinda bokre my login on my linux box, because it was telling me that I shouldn't be sharing my home folder or something like that ahhhh](*,)

That's what the screenshot of the nautilus error-message suggests.

Please type

# ls -lisa /home
# ls -lisa /home/dare-devil

inside a terminal and paste the output into a post.

PENGUIN-PC
July 18th, 2006, 04:22 PM
WOW, ok I hope your ready for this. Here it is

dare-devil@DARE-DEVIL:~$ ls -lisa /home
total 12
3244033 4 drwxr-xr-x 3 root root 4096 2006-05-16 04:41 .
2 4 drwxr-xr-x 21 root root 4096 2006-07-12 16:56 ..
3244035 4 drwxrwxrwx 67 dare-devil dare-devil 4096 2006-07-18 12:30 dare-devil
dare-devil@DARE-DEVIL:~$ ls -lisa /home/dare-devil
total 700
3244035 4 drwxrwxrwx 67 dare-devil dare-devil 4096 2006-07-18 12:30 .
3244033 4 drwxr-xr-x 3 root root 4096 2006-05-16 04:41 ..
3739484 4 drwxr-xr-x 13 dare-devil dare-devil 4096 2006-07-15 10:18 Applications
3768336 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-05-04 18:07 ARCADE
3248758 4 -rw-r--r-- 1 dare-devil dare-devil 1302 2006-07-13 03:28 .audacity
3310341 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-07-11 01:41 .avidemux
3244176 12 -rw------- 1 dare-devil dare-devil 10149 2006-07-18 13:19 .bash_history
3244037 4 -rw-r--r-- 1 dare-devil dare-devil 220 2006-05-16 04:41 .bash_logout
3244038 4 -rw-r--r-- 1 dare-devil dare-devil 414 2006-05-16 04:41 .bash_profile
3244039 4 -rw-r--r-- 1 dare-devil dare-devil 2227 2006-05-16 04:41 .bashrc3244154 4 drwxr-xr-x 4 dare-devil dare-devil 4096 2006-05-16 19:56 .bmp
3768363 4 drwxr-xr-x 6 dare-devil dare-devil 4096 2006-07-11 03:21 Business
3768413 4 drwxr-xr-x 5 dare-devil dare-devil 4096 2006-05-04 18:07 Cartoons
3244286 4 drwx------ 5 dare-devil dare-devil 4096 2006-05-24 12:35 .config3244248 36 -rw-r--r-- 1 dare-devil dare-devil 35240 2006-06-20 04:19 config.log
3244183 4 -rw-r--r-- 1 dare-devil dare-devil 39 2006-06-28 14:20 .current-song
3244117 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-07-18 12:33 Desktop3244042 4 -rw------- 1 dare-devil dare-devil 26 2006-05-16 04:49 .dmrc
3653633 4 drwxr-xr-x 13 dare-devil dare-devil 4096 2006-05-17 14:58 DOC'S
3244668 4 drwxr-xr-x 4 dare-devil dare-devil 4096 2006-07-10 23:10 .dvdcss3310330 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-07-10 23:10 .dvdrip3248756 24 -rw-r--r-- 1 dare-devil dare-devil 21716 2006-07-10 23:13 .dvdriprc
3653638 4 drwxr-xr-x 4 dare-devil dare-devil 4096 2006-05-17 14:26 DWG'S
3244056 4 -rw------- 1 dare-devil dare-devil 16 2006-05-16 04:49 .esd_auth
868391 4 drwxr-xr-x 8 dare-devil dare-devil 4096 2006-07-17 12:16 .evolution
3277212 4 drwxr-xr-x 10 dare-devil dare-devil 4096 2006-06-02 13:49 exaile
3278005 4 drwxr-xr-x 4 dare-devil dare-devil 4096 2006-06-02 14:04 .exaile3244036 0 lrwxrwxrwx 1 dare-devil dare-devil 26 2006-05-16 04:41 Examples -> /usr/share/example-content
3248847 4 -rw-r--r-- 1 dare-devil dare-devil 1043 2006-05-25 03:36 .face
3768626 4 drwxr-xr-x 6 dare-devil dare-devil 4096 2006-05-22 07:24 Flicks
3248859 16 -rw-r--r-- 1 dare-devil dare-devil 12569 2006-07-15 10:00 .fonts.cache-1
3277447 4 drwx------ 4 dare-devil dare-devil 4096 2006-07-09 21:55 .gaim
3244043 4 drwx------ 5 dare-devil dare-devil 4096 2006-07-18 12:30 .gconf
3244044 4 drwx------ 2 dare-devil dare-devil 4096 2006-07-18 13:21 .gconfd3279927 4 drwxr-xr-x 21 dare-devil dare-devil 4096 2006-07-17 04:02 .gimp-2.2
3244162 0 -rw-r----- 1 dare-devil dare-devil 0 2006-07-18 10:56 .gksu.lock
3244161 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-05-16 17:35 .gnome
3244046 4 drwx------ 16 dare-devil dare-devil 4096 2006-07-18 11:05 .gnome23244047 4 drwx------ 2 dare-devil dare-devil 4096 2006-05-16 04:49 .gnome2_private
3278255 4 drwx------ 4 dare-devil dare-devil 4096 2006-06-21 06:53 .gnomesword-2.0
3244057 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-05-23 18:47 .gstreamer-0.10
3739486 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-05-17 11:22 .gstreamer-0.8
3248905 4 -rw------- 1 dare-devil dare-devil 59 2006-06-11 18:35 .gtk-bookmarks
3244354 4 drwxr-x--- 2 dare-devil dare-devil 4096 2006-07-18 00:08 .gtk-gnutella
3244359 4 drwxr-xr-x 5 dare-devil dare-devil 4096 2006-05-16 20:20 gtk-gnutella-downloads
3244058 4 -rw-r--r-- 1 dare-devil dare-devil 92 2006-05-16 04:49 .gtkrc-1.2-gnome2
3424312 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-05-17 14:50 GUI's
3244462 4 -rw-r--r-- 1 dare-devil dare-devil 32 2006-05-24 17:23 .hwdb
3249087 4 -rw------- 1 dare-devil dare-devil 2323 2006-07-18 12:30 .ICEauthority
3277169 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-06-01 12:09 .icons
3277598 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-05-24 13:32 .java
3278350 4 drwx------ 3 dare-devil dare-devil 4096 2006-06-27 05:59 .kde
3248946 220 -rwxr-xr-x 1 dare-devil dare-devil 217311 2006-06-20 04:19 libtool3293951 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-06-28 14:21 .listen1900657 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-05-17 12:20 .local
3244463 4 drwx------ 3 dare-devil dare-devil 4096 2006-05-16 20:56 .macromedia
3244257 4 -rw-r--r-- 1 dare-devil dare-devil 2094 2006-05-24 17:14 .mailcap
3278385 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-06-27 06:10 .mcop
3248985 4 -rw------- 1 dare-devil dare-devil 31 2006-06-28 10:58 .mcoprc3244112 4 drwx------ 3 dare-devil dare-devil 4096 2006-05-16 04:49 .metacity
3244045 4 drwx------ 4 dare-devil dare-devil 4096 2006-05-17 12:56 .mozilla
3244204 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-05-16 17:48 .mplayer
3244200 4 drwxrwxrwx 181 dare-devil dare-devil 4096 2006-06-08 18:10 MUSIC
3244116 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-05-16 04:49 .nautilus
868388 4 drwxr-xr-x 20 dare-devil dare-devil 4096 2006-05-17 14:41 Old Engineering stuff
3277304 4 drwx------ 3 dare-devil dare-devil 4096 2006-07-15 10:48 .openoffice.org2
3244877 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-05-04 18:01 PDF'S
3294171 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-06-28 19:48 Photos
3244880 4 drwxr-xr-x 11 dare-devil dare-devil 4096 2006-06-20 02:27 PICS
3293955 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-06-28 14:14 Podcasts
3278348 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-06-27 06:11 .qt
3293357 4 drwxr-xr-x 4 dare-devil dare-devil 4096 2006-07-17 05:51 .quodlibet
3245318 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-07-02 18:27 Random Stuff
3248889 36 -rw------- 1 dare-devil dare-devil 34653 2006-05-24 17:27 .realplayerrc
3244228 20 -rw------- 1 dare-devil dare-devil 17267 2006-07-18 05:00 .recently-used
3245325 4 drwxr-xr-x 5 dare-devil dare-devil 4096 2006-05-17 15:40 RioSSeries
3245330 4 drwxr-xr-x 5 dare-devil dare-devil 4096 2006-05-04 18:02 School
3739281 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-05-04 18:02 screen savers
3276888 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-05-23 18:27 .subversion
3244163 0 -rw-r--r-- 1 dare-devil dare-devil 0 2006-05-16 04:51 .sudo_as_admin_successful
3278312 4 drwx------ 4 dare-devil dare-devil 4096 2006-06-21 06:53 .sword
3277168 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-06-01 12:09 .themes3244134 4 drwx------ 4 dare-devil dare-devil 4096 2006-05-17 12:12 .thumbnails
3244115 4 drwx------ 4 dare-devil dare-devil 4096 2006-07-18 06:06 .Trash
3244111 4 drwx------ 2 dare-devil dare-devil 4096 2006-05-16 04:49 .update-notifier
3293584 4 drwxr-xr-x 3 dare-devil dare-devil 4096 2006-07-17 08:34 .vlc
3244443 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-06-27 05:11 .wapi
3248751 4 -rw-r--r-- 1 dare-devil dare-devil 4 2006-05-17 12:15 .windows-label
3739417 4 drwxr-xr-x 4 dare-devil dare-devil 4096 2006-07-15 10:23 .wine
3244424 4 -rw------- 1 dare-devil dare-devil 121 2006-07-18 04:31 .Xauthority
3244203 4 drwxr-xr-x 2 dare-devil dare-devil 4096 2006-05-17 00:06 .xine
3739387 4 drwxr-xr-x 7 dare-devil dare-devil 4096 2006-05-04 18:03 XLS'S
3244120 4 drwxr-xr-x 4 dare-devil dare-devil 4096 2006-05-16 17:41 .xmms
3244040 4 -rw-r--r-- 1 dare-devil dare-devil 1322 2006-07-18 13:17 .xsession-errors
dare-devil@DARE-DEVIL:~$

mmcclure79
July 18th, 2006, 04:32 PM
I set everything up step by step and I can;t get to my windows boxes from Xubuntu. I keep getting an error dialog box with: "smb:///" is not a valid location. This is when I'm trying to browse the network.

Here's my samaba config:
[global]
; General server settings
netbios name = laptop
server string =
workgroup = 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 = no

printing = CUPS
printcap name = CUPS

syslog = 1
syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /home/Share/
browseable = yes
read only = no
guest ok = yes
create mask = 0644
directory mask = 0755
force user = michael
force group = michael


then there's this:
michael@laptop:~$ smbclient -L localhost -U%
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.22]

Sharename Type Comment
--------- ---- -------
print$ Disk
MyFiles Disk
IPC$ IPC IPC Service ()
ADMIN$ IPC IPC Service ()
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.22]

Server Comment
--------- -------
GATEWAY2000
LAPTOP
SARASUSAN Punkie's Mommie

Workgroup Master
--------- -------
WORKGROUP LAPTOP


As far as I can tell Samba is seeing everything like it should, but I can'te tell what's going on...

PENGUIN-PC
July 18th, 2006, 04:34 PM
hello

Stormbringer
July 18th, 2006, 04:51 PM
Ok, so far the permissions look good ... just switch the permissions of your home directory back to default:

chmod 0770 /home/dare-devil

As for the smb.conf ... if you followed all the other steps (creating samba user accounts) the following conf should do the trick for you:


[global]
; General server settings
netbios name = dare-devil
server string =
workgroup = WINBLOWS
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
;interfaces = lo, eth0
;bind interfaces only = true

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

[homes]
valid users = %S
create mode = 0600
directory mode = 0755
browseable = no
read only = no
veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = dare-devil
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

;Uncomment if you need to share your CD-/DVD-ROM Drive
[DVD-ROM Drive]
path = /media/dvd-rw
browseable = yes
read only = yes
guest ok = yes


In Gnome press ALT+F2 (Run Application), type

gksudo /etc/samba/smb.conf

and paste the lines from above into the file or do the modifications by hand. Save the file, open a terminal and restart samba to make changes happen (sudo /etc/init.d/samba restart). Maybe it's a good idea to reboot your Windows box as well.

To get access to the home directory from Windows:

\\dare-devil\dare-devil

If that doesn't work try to subsitute the name of your Linux box with its ip-address (type ifconfig inside a terminal)

\\192.168.0.11\dare-devil
THIS IS AN EXAMPLE - REPLACE WITH >>>YOUR<<< IP-ADDRESS !!!

(somehow a thought of a long time ago creeps through the dark edges of my memories that windows may dislike the fact that the system and username is identical)

If my fear is right, then try to change the name you configured in samba to i.e.:

netbios name = devilbox

Restart samba and try to make the connection again.

Try this and report back.

Oh, and thanks for the cheers ... your sister is right; Austria is a nice country to spend your holidays.

Stormbringer
July 18th, 2006, 04:57 PM
I set everything up step by step and I can;t get to my windows boxes from Xubuntu. I keep getting an error dialog box with: "smb:///" is not a valid location. This is when I'm trying to browse the network.

This rather sounds like some package is missing in your installation of Ubuntu.

As I have no experience with XUbuntu (running a fully fleged install of Ubuntu 6.06 AMD64) I'm only able to guess ...

Try to install "smbfs"...

sudo apt-get install smbfs

...and see if things work out. Chances are that the network browser may need that package to be installed.

PENGUIN-PC
July 18th, 2006, 05:22 PM
STORM YOU ARE AMAZING!!!! Everything works just fine now! The user name and system name being the same was not a problem. I can't thank you enough! I was able to transfer files back and forth to both computers without any troubles at all. Now I guess I need to understand how all this worked. Cheers!!

Stormbringer
July 18th, 2006, 05:27 PM
STORM YOU ARE AMAZING!!!! Everything works just fine now! The user name and system name being the same was not a problem. I can't thank you enough! I was able to transfer files back and forth to both computers without any troubles at all.

As usual I'm honored I could be of help.


Now I guess I need to understand how all this worked. Cheers!!

If you really like to dig yourself into the mysteries of samba start by reading the man-page (type "man smb.conf" inside a terminal) or take a look into Samba's website (http://samba.org/); lots of resources can be found there.

Turtle.net
July 19th, 2006, 12:02 AM
Hi,
I know you already answered this kind of question ... but it's still not clear for me.
Let say I have a desktop running Ubuntu and a laptop running XP.
If I understand well I need to have the same login/passwd for my desktop and laptop to access the share folders through samba ???
That could be easy if the desktop and the laptop have the same real user ... but what if the user are different (and then want to create different user accounts, logins, passwd...) or if you have several laptops connected to the desktop...

Sorry if you think that my questions are irrelevant...I definitely need some sleep.

cpk1
July 19th, 2006, 12:56 AM
I followed all the steps but samba still doesnt seem to be cooperating. In windows when I try to map the drive using \\roxxor\home\kateandalex\sharedsamba it just keeps on prompting me for user name and password, it doesnt say if its wrong or right, just keeps bringing up the same thing, both machines are able to ping each other as well. Any help would be greatly appreciated. Also as a side note in the force user and force group could you just add more people by seperating them with ; so they would all be able to access the same share? smbclient -L localhost -U% only gives me:
cpk1@roxxor:/etc/samba$ smbclient -L roxxor -U%
Domain=[TEAMAWESOME] OS=[Unix] Server=[Samba 3.0.22]
tree connect failed: NT_STATUS_LOGON_FAILURE
Also testparm gives me this

cpk1@roxxor:/etc/samba$ testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[print$]"
Processing section "[printers]"
Processing section "[roxxorshared]"
Loaded services file OK.
WARNING: passdb expand explicit = yes is deprecated
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
workgroup = TEAMAWESOME
server string =
null passwords = Yes
passdb backend = tdbsam
username map = /etc/samba/smbusers
syslog only = Yes
announce version = 5.0
name resolve order = hosts wins bcast
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = CUPS
wins support = Yes
valid users = %S
read only = No
create mask = 0600
printing = cups
print command =
lpq command = %p
lprm command =
veto files = /*.{*}/.*/mail/bin/
browseable = No

[print$]
path = /var/lib/samba/printers
write list = root
read only = Yes
create mask = 0664
directory mask = 0775
guest ok = Yes
browseable = Yes

[printers]
path = /tmp
guest ok = Yes
printable = Yes

[roxxorshared]
path = /home/alexandkate/sambashared
force user = alexandkate
force group = alexandkate
create mask = 0644
browseable = Yes

Stormbringer
July 19th, 2006, 01:00 AM
Hi,
I know you already answered this kind of question ... but it's still not clear for me.

Let say I have a desktop running Ubuntu and a laptop running XP.
If I understand well I need to have the same login/passwd for my desktop and laptop to access the share folders through samba ???

No, you mustn't have the same login/password - it's just a recommendation to keep things simple.

Only IF you have the same useraccounts on, to follow your example, your desktop and laptop life would be a lot easier if both accounts would have the same passwords.

That could be easy if the desktop and the laptop have the same real user ... but what if the user are different (and then want to create different user accounts, logins, passwd...) or if you have several laptops connected to the desktop...

Samba is a _server_ daemon --- where's the problem?

Just add the required useraccounts with their respective passwords by using smbpasswd and you're all set (we're using TDBSAM as our backend for user accounting; not Linux's shadow). Additionally you may need to make sure that the access right(s) to the share(s) (located in smb.conf) will fit.

Any specific scenario you are thinking about?

Stormbringer
July 19th, 2006, 01:05 AM
I followed all the steps but samba still doesnt seem to be cooperating. In windows when I try to map the drive using \\roxxor\home\kateandalex\sharedsamba<snip>

The mapping is wrong ...
Could I bug you to try again with: \\roxxor\roxxorshared

You need to use the name of the share as you specified inside the brackets...

[roxxorshared] <--- THIS ONE HERE!!!
path = /home/alexandkate/sambashared <--- *NOT* THIS!!!
force user = alexandkate
force group = alexandkate
create mask = 0644

cpk1
July 19th, 2006, 01:11 AM
thank you for the quick reply, unfortunatly \\roxxor\roxxorshared gets the same result =\

edit: sorry i forgot to mention i have swat installed but am not using it, but i am under the impression it wont change my .conf file unless i access the webpage?

Stormbringer
July 19th, 2006, 01:28 AM
Wait a moment ... I overlooked this one here ...


cpk1@roxxor:/etc/samba$ smbclient -L roxxor -U%
Domain=[TEAMAWESOME] OS=[Unix] Server=[Samba 3.0.22]
tree connect failed: NT_STATUS_LOGON_FAILURE


AND


cpk1@roxxor:/etc/samba$ testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[print$]"
Processing section "[printers]"
Processing section "[roxxorshared]"
Loaded services file OK.
WARNING: passdb expand explicit = yes is deprecated


The first error message usually only shows up when a firewall (do you have Firestarter running?) is blocking the traffic or if eth0 and/or lo isn't up.

EDIT: Did you add AND enable your useraccount in samba (NT_STATUS_LOGON_FAILURE)?

The second error message is new to me ... did you specify that parameter inside your smb.conf (testparm doesn't show everything)? Hmm ... need to look into this.

Please post the whole contents of your smb.conf!


And about the access rights ...

force group and force user has NOTHING to do with access rights to the share; it has to do with local filesystem permissions! The parameter you were thinking about is "valid users" (valid users = user1, user2, user3 ...)

Without specifying "valid users =" ALL authenticated users will be able to access the share.

-Storm

cpk1
July 19th, 2006, 01:52 AM
here is my full conf

cpk1@roxxor:/etc/samba$ cat smb.conf
[global]
; General server settings
netbios name = ROXXOR
server string =
workgroup = TEAMAWESOME
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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
valid users = %S
create mode = 0600
directory mode = 0755
browseable = no
read only = no
veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[roxxorshared]
path = /home/alexandkate/sambashared
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = alexandkate
force group = alexandkatecpk1@roxxor:/etc/samba$

not sure which account you mean when you say useraccount, i had alexandkate added and enabled when i first went through and just now added cpk1, still same output from smbclient -L roxxor -U% no firewall that I can see on ps aux, plus i think it would be blocking apache and mysql if there was one running. once again thank you for your direct help!

cpk1
July 19th, 2006, 07:43 AM
good news! got rid of everything and tried going through it all again and it worked! I think trying to use swat might have messed things up? That or I just made a typo/mistake and didnt notice it. I wasnt able to map the drive in windows by start > right click my computer > map network drive. I just found my linux box in network places and mapped it from there, login worked and everything! thank you for the help and the well written guide!

Turtle.net
July 20th, 2006, 10:45 PM
No, you mustn't have the same login/password - it's just a recommendation to keep things simple.

Only IF you have the same useraccounts on, to follow your example, your desktop and laptop life would be a lot easier if both accounts would have the same passwords.

Ok, now I think I understand the trick with the accounts.
On my home network I have a desktop (running ubuntu only) and a laptop (running XP and ubuntu in dual boot).
On my laptop, I have the same login/pswd for ubuntu and for XP (let say it's lap/xxx) and on my desktop i have the following login/pswd : desk/yyy.
My problem is : I can access the share folder I created on my desktop from my laptop under ubuntu ... but not under XP (same IP for XP and ubuntu on the laptop btw).
I really don't understand. Just to be sure I removed the firewall on my XP box ... and nothing changed.
Do you think the problem can be caused by the fact that XP is a smb server by itself ?

Turtle.net
July 20th, 2006, 11:13 PM
I have done a little bit of XP network configuration using the XP's network wizard, and I disabled all the shared folders ... then suddenly the shared folder from my desktop appeared.
So the problem was really to have XP as a smb server on the same network.
Looks like my problem is solved ;)

mac73
July 21st, 2006, 07:10 AM
hi Stormbringer

tnx 4 givin such a good help.
u make samba so easy dat any novice user can configure it .

bt i hv 1 doubt dat i want to add group.

i hv tried dat with followin commands

groupadd -r groupname
adduser -r -g trust -d/dev/null/-s/dev/null compname$

which we always use in redhat linux
bt. not workin in ubuntu

and 1 more thing i wanna make MSHOME as domain rather than workgroup.
what changes i hv to make in smb.conf?

i tried dat with



domain master = yes

bt. not getin.

pls........... help me out.
tnx

justicerulesok
July 26th, 2006, 07:00 AM
I've just found this thread & wanted to say thank you :-)

You've just solved 25% of my ubuntu issues & made me look really clever in front of my boss. :-D :-D

Cheers!

Justice

BatteryCell
July 26th, 2006, 08:49 PM
Worked great for me :-) only question is how does one tie in a mac into this server (seeing as mac sort of runs on unix)?

core
July 28th, 2006, 09:57 AM
Hi stormbringer, and thanks already for the howto. It worked great a few days ago when i followed it. I'm using vmware to emulate a virtual machine with windows xp on it, and I was mapping driver E:\ as my linux home directory. It was ok, no problems.

Still, after a few days it stopped working and I still don't know why. I'm using my pc about 3 times a week, all I've been doing is mostly those kubuntu critical updates, and I'm not sure if I changed my password.

I thought this password problem was the issue, but still to make sure it worked again i decided to run the howto all over again.

checked samba install, stopped daemon, overwritten smb.conf with yours and reconfigured it again, pointing the samba path to /home/my_user. reconfigured windows on it too, removed that netbios-wins support thingy and added my ip again, but no luck. The DAPPER network computer is detected, MyFiles folder is detected, they always are, but when I try to map a drive to it, it says (after a few seconds attemping to connect)

"The mapped network drive could not be created because the following error has occured: An extended error has occurred."

The error is different when the daemon is stopped, so I assume it has something to do with the configuration.

What am I doing wrong? Sorry for the extended crying for help :p Thanks in advance.

PS: I have static ip address but sometimes it changes on ISP maitenance. I noticed the IP changed these past few days, but I've configured it again with the new IP.

Stormbringer
July 28th, 2006, 11:58 AM
hi Stormbringer

tnx 4 givin such a good help.
u make samba so easy dat any novice user can configure it .

bt i hv 1 doubt dat i want to add group.

i hv tried dat with followin commands

groupadd -r groupname
adduser -r -g trust -d/dev/null/-s/dev/null compname$

which we always use in redhat linux
bt. not workin in ubuntu

and 1 more thing i wanna make MSHOME as domain rather than workgroup.
what changes i hv to make in smb.conf?

i tried dat with



domain master = yes

bt. not getin.

pls........... help me out.
tnx

Sorry for the late reply ... been a little busy lately.

The configuration variable "WORKGROUP =" >>> IS <<< the name of the Domain - t4|<3 4 l00|< 47 7|-|3 d0|<u 4|\|d l34|2|\| 70 3><p|2355 `/0u|2531f!

Oh --- and before you can add a user to some group you better create the group on the local system (groupadd).

Stormbringer
July 28th, 2006, 12:12 PM
The DAPPER network computer is detected, MyFiles folder is detected, they always are, but when I try to map a drive to it, it says (after a few seconds attemping to connect)

"The mapped network drive could not be created because the following error has occured: An extended error has occurred."


I love Microsoft's error messages; they are soooo informative.

As you are using VMware (no matter if it's Workstation or Server): did you install a kernel upgrade lately?

If the answer is yes, did you run "sudo vmware-config.pl" to compile the necessary modules for the new kernel? If the answer is no do it _right now_!

Otherwise ...

Please start up VMware, open a command prompt, and type:

ipconfig /all

Please post the output into a reply (or PM me if it's a public IP address).

The error is different when the daemon is stopped, so I assume it has something to do with the configuration.

When samba is stopped you should get an error saying that the network path could not be found ... no wonder though.

-Storm

franciscopaco
July 28th, 2006, 08:50 PM
Stormbringer. I just whant to say, Thanks for the howto

core
July 28th, 2006, 09:24 PM
As you are using VMware (no matter if it's Workstation or Server): did you install a kernel upgrade lately? If the answer is yes, did you run "sudo vmware-config.pl" to compile the necessary modules for the new kernel? If the answer is no do it _right now_!

Yes, but i think samba stopped working before. After I updated the kernel, VMWare stopped working, so I ran vmware-config.pl again to compile it according to my current kernel.
But still, I did it again right now, restarted windows and still the same error appears.


Otherwise ...

Please start up VMware, open a command prompt, and type:

ipconfig /all

Please post the output into a reply (or PM me if it's a public IP address).

I did so, check your PM inbox. Thanks!

Still, help from others are more than welcome.

verbatim210
July 29th, 2006, 01:52 AM
any idea why i cannot WRITE to my samba share?

Stormbringer
July 29th, 2006, 04:30 AM
any idea why i cannot WRITE to my samba share?

I bet the permissions of the folder/mountpoint in your local filesystem are wrong ...

sudo chmod 0777 /path/to/the/shared-folder
sudo /etc/init.d/samba restart

NOTE: DON'T CHANGE THE MOD OF YOUR HOME-DIRECTORY!

Stormbringer
July 29th, 2006, 04:47 AM
I did so, check your PM inbox. Thanks!

I wrote an reply to your message by PM as well ... please have a look at your inbox.

-Storm

verbatim210
July 29th, 2006, 05:35 AM
I bet the permissions of the folder/mountpoint in your local filesystem are wrong ...

sudo chmod 0777 /path/to/the/shared-folder
sudo /etc/init.d/samba restart

NOTE: DON'T CHANGE THE MOD OF YOUR HOME-DIRECTORY!

thanks storm
your bullet hit the dot!

Flyn
July 29th, 2006, 08:08 AM
Only Samba HOWTO that worked for me.
Great job!

dmizer
July 30th, 2006, 02:02 AM
you sir/madam are my personal hero.

you LITERALLY saved my job. thank you.

dmizer
July 31st, 2006, 02:38 AM
and just ran into my first snag. can't figure out how to add multiple users.

it works for the primary user on the system, but if i add users via the following example:
sudo useradd -s /bin/true NEW_USERNAME
sudo smbpasswd -L -a NEW_USERNAME
sudo smbpasswd -L -e NEW_USERNAME
i can't get the additional user to work.

for this section of my samba.conf file:
[MyFiles]
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
where do i add the additional user?

if i say "force user = YOUR_USERNAME NEW_USERNAME"
then no one can logon.
but if i configure it as follows:
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
force user = NEW_USERNAME
force group = NEW_USERGROUP
where NEW_USERGROUP is the same as NEW_USERNAME.

then i can log on with the YOUR_USERNAME, but no one else works.

EDIT:
yeah so, i reread it and figured out that new users don't have to be added to the samba.conf file. i have two users working now :)

Stormbringer
July 31st, 2006, 04:02 AM
EDIT:
yeah so, i reread it and figured out that new users don't have to be added to the samba.conf file. i have two users working now :)

Hi!

Just came across your post; sorry for the delay *gomen*

Glad you figured it out ... as it's just a matter of adding and enabling the user(s) with smbpasswd.

- Storm

P.S.: As the "force user" and "force group" parameter seems to cause confusion here's a general hint for everyone ...

The parameter refers to the user/group to whom the files inside the shared directories will belong; it has nothing to do with access rights/priviledges!

royskie
July 31st, 2006, 05:10 AM
storm....you're the man!.....I 've just started using Ubuntu....you're howto is so easy to follow that I got file sharing working in the first pass!...cheers to you dude!

dmizer
July 31st, 2006, 01:07 PM
Hi!

Just came across your post; sorry for the delay *gomen*

Glad you figured it out ... as it's just a matter of adding and enabling the user(s) with smbpasswd.

- Storm

P.S.: As the "force user" and "force group" parameter seems to cause confusion here's a general hint for everyone ...

The parameter refers to the user/group to whom the files inside the shared directories will belong; it has nothing to do with access rights/priviledges!

tondemonai.

it only took me about 20 minutes and a reread of your first post to figure it out on my own. and i actuall made good use of that "force user, force group" to resolve a problem with some sensitive "boss only" access files.

you really are the man. vielen dank!

edit:
actually, i went back through and figured out why i tripped up on adding new users. it's in this line:

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!
so no problem adding them to my system, but when you say "AND samba" i assumed you meant samba.conf.

Flavian
August 1st, 2006, 05:43 AM
Hi :)
Thanks for this great howto!
It worked out just fine.
However I got a problem with the user permissions.
I want my brother to access his folder and I want myself to access my own, but neither one of us should see the content of the others folders.

The problem is that "force user" doesn't seem to work.
Everyone can view all the folders. I tried messing around with chmod and chown, but it doesn't work out.
I also set up the users on the linux machine and did everything according to the howto!

I don't know what to do anymore. I really need user permissions, since there are files that some people should not see.

Can someone help please?
Flo

Flavian
August 1st, 2006, 05:47 AM
it has nothing to do with access rights/priviledges![/b]

Sorry, I just read your post after posting my last one!
I think I made that mistake as well.
Can you tell me than how I set up access permissions, like in windows, that would be very important!
Thanks in advance.
Flo

Stormbringer
August 1st, 2006, 06:31 AM
Hi
Thanks for this great howto!
It worked out just fine.
However I got a problem with the user permissions.
I want my brother to access his folder and I want myself to access my own, but neither one of us should see the content of the others folders.

The problem is that "force user" doesn't seem to work.
Everyone can view all the folders. I tried messing around with chmod and chown, but it doesn't work out.
I also set up the users on the linux machine and did everything according to the howto!

I don't know what to do anymore. I really need user permissions, since there are files that some people should not see.

Can someone help please?
Flo

----------------------------------------

Sorry, I just read your post after posting my last one!
I think I made that mistake as well.
Can you tell me than how I set up access permissions, like in windows, that would be very important!
Thanks in advance.
Flo

OK - let us start this way: could you please tell me what shares you configured (i.e. include the part in question into a reply)? Would make life easier as I won't have to guess.

However, let's assume the following - maybe we get a direct hit:

You and your brother have a user account on your Linux box and you want to access the HOME directories (/home/<username>)

- Open smb.conf for editing
Either type "sudo gedit /etc/samba/smb.conf" in a terminal or press ALT+F2 and input "gksudo gedit /etc/samba/smb.conf".

- Find the following section:


; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/


and change it to ...


; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
[homes]
valid users = %S
create mode = 0600
directory mode = 0755
browseable = no
read only = no
veto files = /*.{*}/.*/mail/bin/


- Save the changes

- Restart samba

Type "sudo /etc/init.d/samba restart" in a terminal


On Windows the shared home-directory (it's called by the username you have on your Linux box) should be automatically detected. If not, simply type \\<COMPUTERNAME>\<username> into the address bar of Windows Explorer - and if it doesn't work out by the name subsitute it with the ip address. Don't forget to input the correct credentials (username/password) when asked.


If you are running a different configuration I rely on your feedback ...

-Storm

Flavian
August 1st, 2006, 07:04 AM
Hi Storm thanks for your quick reply!

Here's the deal ;)
My Network at home includes 3 Pcs and a server.

My brother: windows
My Dad: Windows
Me: Windows / Linux Hybrid

Since I use linux most of the time I was planning on just setting up normal shares for everyone (like I had it before when I had my windows server running) so everyone has his own area where he can store stuff and no one else but him can access it.
And than there is a global share called "Data" where I have stored all the programs, and installs (especially for windows) which me and my brother should have write permissions to, but my dead only read because he is very computer illiterate and I don't want him to mess up or delete files by accident.

So it was when I had set up the windows server and so I was thinking to do it with linux.

I have to say that I do not really understand the benefit of the /home directory thing.
AND the home directory is also on the system partition of the linux server, which means that I would have to move it one of the bigger HDDs in the server. (I could not find how to do that, so I stuck to the idea mentioned above, by just creating single shares)

I hope you could follow my description...

Here's my smb.conf:


[global]
; General server settings
netbios name = SERVER
server string =
workgroup = WURM
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 = trues
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast

wins support = yes

printing = CUPS
printcap name = CUPS

syslog = 1
syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes


############ Fileshares begin here #############

[Data]
path = /media/hdb1
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750

[Florian]
path = /media/hdc1/Florian
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = florian
force group = florian

[Lukas]
path = /media/hdc1/Lukas
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = lukas
force group = lukas

[Hans-Jörg]
path = /media/hdc1/Hans-Jörg
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = hans-jörg
force group = hans-joerg



Thanks for your nice help :)
Flo

Stormbringer
August 1st, 2006, 08:14 AM
Here's my smb.conf:

null passwords = trues


TYPING MISTAKE ENCOUNTERED!!!!
Please correct it to read "true"


[Data]
path = /media/hdb1
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750


Although you want ALL of your family to have access here you should set "force user" and "force group" to the user account with whom you usually work on your Ubuntu box - I assume it's yours ...

Please add...

force user = florian
force group = florian

As I already stated in the thread: the "force user" and "force group" parameter has nothing to do with access priviledges but with the permissions of the local linux filesystem. All authenticated users will have access here.

EDIT
Short explaination:
Setting a forced user/group will make sure that all files and folders will belong to the user that is working on the box - so you won't have any troubles accessing the files/folders from within Ubuntu.

To figure out the difference...

Do a

ls -lisa /media/hdb1/

and

ls -lisa /media/hdc1/Lukas
or
ls -lisa /media/hdc1/hans-joerg

The difference in the file permissions should be easily spotted.
/EDIT

[Florian]
path = /media/hdc1/Florian
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = florian
force group = florian


To lock this share so that ONLY YOU will have access add the following line...

valid users = florian



[Lukas]
path = /media/hdc1/Lukas
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = lukas
force group = lukas


Same here ... if ONLY lukas should have access add ...

valid users = lukas



[Hans-Jörg]
path = /media/hdc1/Hans-Jörg
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = hans-jörg
force group = hans-joerg


Please refrain from using german umlauts - stick to plain ASCII (although Dapper supports UTF-8 without any hitches, at least for me, you better not try to trigger problems lurking in the dark corners). German Umlauts in the share declaration and/or path in the local filesystem may cause major issues. This, however, does not apply to the files you store on the share ... as long as >Windows< happily recognizes the correct characters you are fine.

Therefore, better delete the user account (from your system and with smbpasswd from samba) and make it up anew by writing is as "hans-joerg".

As soon as it's done add ...

valid users = hans-joerg

...to lock down the share for this user ONLY.


After you made the changes you need to restart samba (reloading doesn't always work out) --- sudo /etc/init.d/samba restart.

-Storm

Flavian
August 1st, 2006, 12:54 PM
Thank you very much, Storm for your nice and easy to follow answer!
You said that I should not use German Umlauts, yepp I would love not to do so :D Since it's an annoying pain, BUT I read in your first post that one should use the exact same user name and password as used for the Windows Box.
Since I was so smart to put Hans-Jörg there, I thought it might not work out with the user / password checking.

If all else fails I would have to change the windows install on my Dad's laptop I suppose :)

Thank you very much for your help again.
Flo

Stormbringer
August 1st, 2006, 12:57 PM
You said that I should not use German Umlauts, yepp I would love not to do so :D Since it's an annoying pain, BUT I read in your first post that one should use the exact same user name and password as used for the Windows Box.
Since I was so smart to put Hans-Jörg there, I thought it might not work out with the user / password checking.

Alright, if you already have the user account on your dad's Windows laptop then simply leave it as it is to spare you the hassle of reconfiguring the whole stuff.

Glad I could be of help once more.

Cheers,
Storm

Flavian
August 1st, 2006, 01:14 PM
One more little question left (sorry to bug you with that, but I am a real newbie to Linux :/ )

What do I do when I want to have

Lukas: read/write
Florian: read/write
Hans-Jörg: ONLY READ permissions

on [Data] ?

Thanks in advance.

Flo

Stormbringer
August 1st, 2006, 01:32 PM
What do I do when I want to have

Lukas: read/write
Florian: read/write
Hans-Jörg: ONLY READ permissions

on [Data] ?

Uh, it starts to get tricky ... that's an option I never had to implement (not even in a corpoprate server setup) ... hmm ...

Try it that way (but write down the current mode and ownership in case it breaks something really badly):

sudo chmod 0774 /media/hdb1
sudo chown florian.lukas /media/hdb1

To my knowledge it should give "others" read-only rights ... not really sure if samba will honor that.

andho
August 4th, 2006, 04:41 AM
gud day and amazing how-to stormbringer.
i read through this thread and cudnt figure out how to access my windows shares from the ubuntu box.
ps. i can access the ubuntu shares from the windows box.

stig
August 4th, 2006, 07:33 AM
Stormbringer, this is a brilliant howto guide and you have solved a lot of individual problems in the thread. I have had problems trying to set up a network for ages, so I decided to follow your howto instructions. But I have one last problem as shown below.

I have two Ubuntu 6.06 PCs and one Windows 98 behind a broadband NAT router, connected by cable and using DHCP. The Windows PC does not use any passwords. One Ubuntu box is used by me and the other by my wife. We use them for our home business and our leisure. My objective is to be able to copy files from one box to another so that we can back-up and transfer files to each other’s box.

I followed your instructions carefully on both Ubuntu PCs making identical smb.conf files, except for the netbios name = where I have used the individual computer name (ubuntu1 and ubuntu2), and the force user and force group which have the respective user (me on ubuntu1 and wife on ubuntu2). They have the same workgroup name, mshome. Wins support is set to “no” because I am on DHCP. I set up a home/samba folder on each box and did the permissions as you instructed.

Then I made the PC user a samba user and set the passwords as the ubuntu logon password - so my ubuntu box has me as a samba user with my password, and my wife’s box has her. I found that this allowed me to access the shared “samba” folder on my wife’s box but only using her login name and password (and vice versa for the other box). So I set each of us as a system user and samba user on the other box (as in your “mark” example) - I made my wife a user on my box and me a user on hers. This then allowed me to access the shared samba folder on her box using my name and password. I checked that I could copy files into the folders - i.e. between ubuntu boxes. And this works. So far so good!

But I cannot access the ubuntu folders from Windows. In Network Neighbourhood I get icons for the ubuntu boxes but when I try to click them open it always asks me for a password. I get:
“Enter Network Password” “You must supply a password...” “Resource: \\UBUNTU2\IPC$”
Clicking OK without a password does not work and neither of the samba/ubuntu passwords works.

It would be great if you could help me solve this final problem!

Stormbringer
August 4th, 2006, 08:10 AM
i read through this thread and cudnt figure out how to access my windows shares from the ubuntu box.

That's quite easy actually....

Method 1 - Gnome:

While in Gnome you may use "Connect to Server" (to be found in the places menu).

Change the Drop-Down to "Windows Share (smb)", enter the name or IP# of your Windows PC, enter your name and your password. You musn't fill out all of the fields.

If you done right the icon of the network drive will appear on your desktop.

Be advised that this method has the one or another drawback:

The Windows Share gets connected as a virtual filesystem (no mountpoint). Applications not using Nautilus's file-requester dialogs (OpenOffice and Skype on Ubuntu AMD64 as an example) aren't able to access the share.

The idea behind this concept is great, the realization is ... useless.


Method 2 - Mount it

You can also mount the Share(s); either on boot or manually.

First, make sure you have smbfs installed - open a terminal and type:

sudo apt-get install smbfs

As soon as it's installed you can go ahead and happily mount your shares.

Example:

- Create a mountpoint
sudo mkdir /media/WindowsShare

- Mount the share into place
sudo mount -t smbfs \\WINDOWSBOX\Share /media/WindowsShare -o username=your_username,password=your_passwd,fmask= 0644,dmask=0755

NOTE: If your username or share has SPACES type it this way

... "\\WINDOWSBOX\My Share" "/media/Windows Share" ... -o username="user name", ...

To mount the shares of your Windows box on system startup you need to create the necessary lines in /etc/fstab - example:

sudo gedit /etc/fstab

At the end of the file attach ...

\\WINDOWSBOX\Share /media/WindowsShare smbfs username=your_username,password=your_passwd,fmask= 0644,dmask=0755 0 0

Save the file.

Make sure the mountpoint(s) EXIST - then do a...

sudo mount -a

...to mount the shares you just added to fstab without rebooting.

-Storm

Stormbringer
August 4th, 2006, 08:27 AM
But I cannot access the ubuntu folders from Windows. In Network Neighbourhood I get icons for the ubuntu boxes but when I try to click them open it always asks me for a password. I get:
“Enter Network Password” “You must supply a password...” “Resource: \\UBUNTU2\IPC$”

There seems to be a problem with the InterProcess Communication...


My home network is similar to yours ... 2 PCs (1x Ubuntu, 1x Windoze) behind a NAT hardware firewalling router (Symantec VPN 100) connected to cable.

If possible try to reconfigure your router so that all of your internal PCs get the same IP address by DHCP every time ... look out for a config option called "DHCP reservation" or such. If you tell me the make and model of your router I may be able to see if there's a manual online to assist you.

But ... back to your problem ...

The error message says IPC$ (that's the administrative "share" for the interprocess communication) on UBUNTU2 cannot be reached.

As you have set WINS to no it's no real wonder as the host cannot be reached by name (there no instance that's running a name-to-address resolver).

On Windows, open the Command-Prompt (START -> "Accessories") and try to mount the share by hand:

net use z: \\192.168.0.10\Share password /user:username /persistent:no

You need to replace the ip-address with the one of Ubuntu2 (ifconfig inside a terminal); and you may also need to tweak the driver-letter, password and username.

If it works out that way: well ... think about the suggestion I made at the beginning of this post; you won't be able to "call" the Linux-boxes by name for as long as WINS is disabled.

If it doesn't work out:

- Check if your Windows box is running a firewall (or some other protective software) that is blocking the network traffic.
- Check if your router might block the traffic.

No matter what, please report back.

-Storm

stig
August 4th, 2006, 09:56 AM
If possible try to reconfigure your router so that all of your internal PCs get the same IP address by DHCP every time ... look out for a config option called "DHCP reservation" or such. If you tell me the make and model of your router I may be able to see if there's a manual online to assist you.

Thanks for the quick reply! I am using a Speedtouch 510 router but it is supplied as part of my broadband package by my ISP. The configuration is protected by a password and I would have to go through the ISP (who have the password) to get any changes made or to find out any config details.


On Windows, open the Command-Prompt (START -> "Accessories") and try to mount the share by hand:

net use z: \\192.168.0.10\Share password /user:username /persistent:no

You need to replace the ip-address with the one of Ubuntu2 (ifconfig inside a terminal); and you may also need to tweak the driver-letter, password and username.


I tried this but it said it did not recognise the username (which was the relevant one for the ubuntu box whose IP I entered, and using my ubuntu/samba password). I have Zonealarm butswitching it off does not help.

In the past, with a quite different set-up, I have managed to access shared folders on my ubuntu PC from the Windows PC. (But I had problems with copying files across which is why I had to give up that method and look for another). So it is possible for my Windows to access the Ubuntu PC - but not at present!

EDIT: I should have added that my primary objective was to get the Ubuntu PCs networked because I want to convert completely to Ubuntu very soon - and your howto has achieved that very smoothly and rapidly for me. Perhaps I am unusual in that I originally had less trouble getting Wndows networked to Ubuntu, than I did linking Ubuntu to Ububtu! So my motivation to change the DHCP settings is less because the Ubuntu networking is now going well.

Stormbringer
August 4th, 2006, 12:52 PM
Thanks for the quick reply! I am using a Speedtouch 510 router but it is supplied as part of my broadband package by my ISP. The configuration is protected by a password and I would have to go through the ISP (who have the password) to get any changes made or to find out any config details.

Isn't the SpeedTouch 510 a DSL router ?!? O_o

However, you are right - with this device you cannot change it's configuration as it has been made up by your ISP.

I tried this but it said it did not recognise the username (which was the relevant one for the ubuntu box whose IP I entered, and using my ubuntu/samba password). I have Zonealarm butswitching it off does not help.

OK, so let us "debug" the problem ...

- You are able to connect from UBUNTU1 to UBUNTU2 and vice versa.
- You are NOT able to connect from Windows to UBUNTU1 by using the very same username/password credentials you used before?
- You are NOT able to connect from Windows to UBUNTU2 by using the very same username/password credentials you used before?

What about the other way? Are you able to gain access TO Windows from UBUNTU1 and/or UBUNTU2? (sorry if you already answered or mentioned that before; I'm somewhat lost in the posts).

If you can't connect from UBUNTU1 or 2 TO Windows, then it's definitely Windows causing the issue. In this case I'm rather out of ideas ... as troubleshooting Windows is way too dependend on what software is installed.

However, I would advise you to switch your Firewall as ZoneAlarm isn't exactly known to work and operate flawlessly (same goes for Symantec's Internet Security / Firewall). Simply Google the web for "Personal Firewall Review" and read through some reviews to get the picture.

andho
August 4th, 2006, 03:05 PM
hey thanx man
so i dont even need samba to access the windows shares eh?
was it done by lisa?

ur explanations are great, real easy to follow. u rock

Stormbringer
August 4th, 2006, 03:16 PM
hey thanx man
so i dont even need samba to access the windows shares eh?

If you ONLY want to access a Windows-Share FROM your Ubuntu box you don't need samba at all, you only need "smbfs" installed in order to mount the share.

You ONLY need samba if you like to access a share on your Ubuntu box FROM Windows.


was it done by lisa?

Huh?

ur explanations are great, real easy to follow. u rock

Thanks for the cheers.

-Storm

RadioHam
August 4th, 2006, 05:42 PM
Hi Storm,

Just wanted to say thanks. I have played with Linux (mostly RH) at home for years trying to use as a server for my home network with Samba for file sharing and it never worked fully. Getting it to work reliably was always a problem.

Some one recently gave me a ubuntu cdrom for 5.1 and I am amazed how easy it was to install on a Dell laptop with a PCMCIA network connection.

But that was nothing compared to when I found your HOWTO and after printing the first pages, followed the steps inserting my specifics (username etc ) enabling WINS and blow me down. It worked first time. I have Samba up and running providing shares for my XP desktop with no problems. I am really impressed. I have moved the shares from my server running WinNT Desktop to the laptop so sure I am that it is stable.

Well done Storm, I can't tell you how impressed I have been reading this HOWTO and the hard work that you have done to help newbies like me. You are to be congratulated.

So now to the questions.

1: Is it necessary to add the 'sudo useadd and smbpasswd lines into the smb.conf file for each time so that they are there if the server is rebooted?

2: Can you please explain the printing = CUPS and printcap name = CUPS for me? Is this the name of your printserver?

Thanks in Advance.
RadioHam:D :

stig
August 5th, 2006, 06:53 AM
I've edited this post a couple of times to clarify it (see sections in EDIT tags).

Isn't the SpeedTouch 510 a DSL router ?!? O_o

However, you are right - with this device you cannot change it's configuration as it has been made up by your ISP.

Yes, it is a DSL - sorry if I didn't mention that (does it make an important difference to what we have discussed?). I have emailed the ISP to ask them if they can tell me how to set the router to either DHCP with fixed lease or static IP addresses instead.


OK, so let us "debug" the problem ...
- You are able to connect from UBUNTU1 to UBUNTU2 and vice versa.

Yes

- You are NOT able to connect from Windows to UBUNTU1 by using the very same username/password credentials you used before?
- You are NOT able to connect from Windows to UBUNTU2 by using the very same username/password credentials you used before?

EDIT: Correct. I can see the icons for the Ubuntu PCs in Network Neighbourhood but I cannot access them because it does not accept any combination of my samba/ubuntu username and password or username and no password.

Also I could not connect using the command you gave:
net use z: \\192.168.0.10\Share password /user:username /persistent:no
using the username and password together with the IP address found for the ubuntu PC at the time. But I was a bit unsure about the command you gave:
net use z: \\192.168.0.10\Share password /user:username /persistent:no

because you said I might have to "tweak the driver-letter, password and username". I put in "z" as you have in the line - is that the drive letter? Also, I left "persistent:no" as you have it, assuming I didn't need to change anything in that./EDIT

What about the other way? Are you able to gain access TO Windows from UBUNTU1 and/or UBUNTU2? (sorry if you already answered or mentioned that before; I'm somewhat lost in the posts).

Yes - this works OK.
EDIT: I noticed your reply to Ando saying:
If you ONLY want to access a Windows-Share FROM your Ubuntu box you don't need samba at all, you only need "smbfs" installed in order to mount the share. You ONLY need samba if you like to access a share on your Ubuntu box FROM Windows.
So I suppose I am accessing my Windows because of smbfs and the fault is with Samba in the other direction./EDIT

However, I would advise you to switch your Firewall as ZoneAlarm isn't exactly known to work and operate flawlessly (same goes for Symantec's Internet Security / Firewall). Simply Google the web for "Personal Firewall Review" and read through some reviews to get the picture.

I can switch the firewall off and it doesn't make any difference.

Thanks for all the help - even if I don't get the last step (access to Ubuntu from Windows) you will have given me 95% of what I need now (and 100% of what I'll need soon when I get completely migrated to Ubuntu!)

Stormbringer
August 6th, 2006, 10:57 AM
So now to the questions.

1: Is it necessary to add the 'sudo useadd and smbpasswd lines into the smb.conf file for each time so that they are there if the server is rebooted?

Huh? The "sudo useradd <username>" and "smbpasswd <options> <username>" command are to be typed into the terminal (command line) ... they are NOT supposed to written into smb.conf

Please re-read the HOWTO ... you surely misunderstood a part of it.

2: Can you please explain the printing = CUPS and printcap name = CUPS for me? Is this the name of your printserver?

Nope - it's NOT the name of a printserver.

The parameter tells samba which PRINT SPOOLING software is to be used ... and CUPS (Common UN*X Printing System) is the default print spooler used in Ubuntu.

So, the lines tell samba the your print-spooler is in fact CUPS.

-Storm

Stormbringer
August 6th, 2006, 11:12 AM
Yes, it is a DSL - sorry if I didn't mention that (does it make an important difference to what we have discussed?). I have emailed the ISP to ask them if they can tell me how to set the router to either DHCP with fixed lease or static IP addresses instead.

The only difference is as follows...

On cable you would have to buy your own broadband (firewalling) router --- something like a Netgear RP613 series or similar.

In this case you would have access to the administrative interface of the router to configure things.

EDIT: Correct. I can see the icons for the Ubuntu PCs in Network Neighbourhood but I cannot access them because it does not accept any combination of my samba/ubuntu username and password or username and no password.

So far at least the master browser is recognized by Windows.

This is nice, but it does not solve the fact that the $IPC connection gets refused for some reason.

Also I could not connect using the command you gave:
net use z: \\192.168.0.10\Share password /user:username /persistent:no
using the username and password together with the IP address found for the ubuntu PC at the time. But I was a bit unsure about the command you gave:
net use z: \\192.168.0.10\Share password /user:username

because you said I might have to "tweak the driver-letter, password and username". I put in "z" as you have in the line - is that the drive letter? Also, I left "persistent:no" as you have it, assuming I didn't need to change anything in that./EDIT/persistent:no

If you wrote "z" instead of "z:" it will not work out for sure - but I assume you did it the right way.

Tweaking the driveletter means that you should use a letter that's not occupied by any other drive - so if "Z:" isn't assigned to any device on your system it's fine.

EDIT: I noticed your reply to Ando saying: <snip>

So I suppose I am accessing my Windows because of smbfs and the fault is with Samba in the other direction./EDIT

If you connect FROM Ubuntu TO Windows you're using smbfs.
If you connect FROM Windows to Ubuntu you're dealing with samba.
If you connect FROM Ubuntu to Ubuntu you're dealing with samba on both sides (1x smbfs on the client, 1x samba on the target workstation which will either be Ubuntu1 or Ubuntu2 depending on the direction).

I can switch the firewall off and it doesn't make any difference.

As you're able to connect and transfer files between your Linux boxes I'm next to absolutely sure that the issue is caused by Windows; otherwise you would have similar issues by connecting from Linux to Linux as well.

Thanks for all the help - even if I don't get the last step (access to Ubuntu from Windows) you will have given me 95% of what I need now (and 100% of what I'll need soon when I get completely migrated to Ubuntu!)

In case you're able to create an image of your Windows box by using a program like partimage or Symantec Ghost (creates a snapshot of the currently installed system that can be restored upon need - you have to create the image on i.e. an external hard drive with sufficient space!):

Create a snapshot image of your current installation and as soon as you're done try to install a fresh plain copy of Windows (+Service Pack 2) just to see if it works out ... if it does you would know that the actual installation is causing the issue.

Then you could proceed onwards until it breaks again to find out what interferes with the network setup.

Anyway, glad I could be helpful.

-Storm

RadioHam
August 6th, 2006, 02:54 PM
Cheers Storm,

Newbie on steep learning curve! Have Samba working so now on to Printing and email serving next!!!

Thanks for the great HOWTO on Samba.

trevorv
August 6th, 2006, 04:15 PM
Hey, thanks for the great guide.

I have Ubuntu on my Thinkpad, which I can now access from my Windows box, but only connecting directly, by typing the IP. If I just double-click on the icon in Windows I get the error;

\\Trevorv-thinkpad is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.

The network path was not found.

If I try and connect to the Thinkpad from the Thinkpad (over the network), it gives

The folder contents could not be displayed.

Sorry, couldn't display all the contents of "Windows Network: mshome".

When trying to display the workgroup, but again I can connect if I go via "Connect to server" then I'm in.

So, it works, but not properly. Any ideas?

Cheers!

Kodiak3000
August 6th, 2006, 06:48 PM
Stormbringer - thanks for this great guide. Everything went smoothly until I got to mapping the network drive. I chose "U" ;) then typed in the \\Ubuntu\MyFiles (Ubuntu is the name of the machine) and got a request for user name and password! Hurray!

But then when I typed in my user name and password, it just kept returning the same dialog, requesting user name and password.

Any idea what I'm doing wrong? :-k

Thanks.

patman
August 8th, 2006, 12:05 AM
Is there any chance of getting a look at your (in development) HOWTO for join a PDC? I'm getting pretty frustrated just trying to join the domain from my windows box.

The shares work ok, but when I try to join the domain I get a
dialog box (on the windows system) that says "access is denied".

And... thanks for the great HOWTO and your willingness to be so helpful.

Pat

stevewabc
August 8th, 2006, 11:26 AM
:confused: OK I have lost it! [-o<

Help please this is what im after here then I hope you all will be able to get me up and running.
file severver with samba
and 4 other computers running XP
Now I want to have all the computers to use /home/office as the main hardrive and each user can only access the files in witch I alow.

But for now I can even get my laptop to conect to the server I can ping it and the sever can ping the laptop, I even see homefront under maping lol but can connect to it. here is my samba config. and smbaclient

[global]
; General server settings
netbios name = homefront
server string =
workgroup = homefront
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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /home/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = steve
force group = steve
__________________________________________________ ________________

root@homefront:~# smbclient -L localhost -U%
Domain=[HOMEFRONT] OS=[Unix] Server=[Samba 3.0.22]

Sharename Type Comment
--------- ---- -------
print$ Disk
MyFiles Disk
IPC$ IPC IPC Service ()
ADMIN$ IPC IPC Service ()
Domain=[HOMEFRONT] OS=[Unix] Server=[Samba 3.0.22]

Server Comment
--------- -------
HOMEFRONT
LAPTOP homefront

Workgroup Master
--------- -------
HOMEFRONT HOMEFRONT

__________________________________________________ ________________

What im I doing rong?

when I try maping im doing it like this:
Drive: H
Folder: \\home\samba
I get network name is not available
ok so next:
Folder: \\111.111.11.111\home\samba
now I get a login screen
user name: steve
Password

and that doesnt work eather

grrrrr

Fraoch
August 8th, 2006, 04:35 PM
Stormbringer, or anyone who knows - stupid question alert!

Isn't Samba pre-configured in a default Ubuntu 6.06 install?

The reason I ask is because this is the first I've seen of this guide and Samba seems to be kinda-sorta working.

I say kinda-sorta because I can see my Windows shares and my Windows shares can see my Ubuntu share, but it's S-L-O-W (often erroring out before I can see anything) and I can't transfer files of more than a few kB, that's if I can see them at all.

There seem to be 30 second pauses each step of the way and file transfers on the Windows side terminate with a "The network name cannot be found" and on the Ubuntu side with a timeout error, that strangely times out instantaneously if I hit retry.

So should I try these directions first or is Samba already running?

Thanks!

Edit: there could be something more than this going on, several network devices don't really respond to my Ubuntu machine:

- SlimServer (http://www.slimdevices.com/su_downloads.html) on my Windows machine
- my Linksys WRT54G router running DD-WRT
- my new SmoothWall (http://www.smoothwall.org) box

All these load the title of the page and the custom web page icon, but not much else. SlimServer loads a few lines of text after several minutes, the others don't load anything.

Interestingly my DSL modem works fine. This seems to point to the router being the cause, but everything looks good there as far as I can tell, and Windows LAN performance is much, much better especially for the networked devices. It's not perfect though, it often takes a long time to call up the share, and every once in a while it can't find the share, but once it's up, speed is fine.

Stormbringer
August 8th, 2006, 07:54 PM
But then when I typed in my user name and password, it just kept returning the same dialog, requesting user name and password.

Any idea what I'm doing wrong? :-k

Thanks.

Did you enable the accounts right after adding them (smbpasswd -e <username>)?

The returning dialog at least looks like it's the problem.

[@all]
Sorry for the late replies ... was kinda busy and somehow I didn't get notifications --- really sorry.
[/@all]

Stormbringer
August 8th, 2006, 08:01 PM
I have Ubuntu on my Thinkpad, which I can now access from my Windows box, but only connecting directly, by typing the IP. If I just double-click on the icon in Windows I get the error; <snip>

Did you enable WINS in samba and add the IP of your Linux box in the WINS server field inside the TCP/IP properties of Windows?

If yes, make sure your Linux system is booted before you boot your Windows box, otherwise Windows will fail to access the master browser list.

Seems to be related somewhere around these settings as you're able to connect by using the IP.

-Storm

Stormbringer
August 8th, 2006, 08:08 PM
Is there any chance of getting a look at your (in development) HOWTO for join a PDC?

Well ... if you don't mind digging yourself through 12 losely connected DIN A4 pages; sure. But there are still several holes that need to be filled and a lot of work required to get it fully written.

[QUOTE=patman;1352513]I'm getting pretty frustrated just trying to join the domain from my windows box.

The shares work ok, but when I try to join the domain I get a
dialog box (on the windows system) that says "access is denied".

And... thanks for the great HOWTO and your willingness to be so helpful.

This sounds as you haven't added and enabled root to samba or forgot to put a "Administrator = root" into username map.

In order to join the Domain you need to authenticate yourself as Administrator --- you cannot join by using the user credentials.

Mind to tell me a little more on the setup ... ? ... maybe we get it solved.

-Storm

Stormbringer
August 8th, 2006, 08:17 PM
What im I doing rong?

Let's try to find out ... at first sight the configuration as well as the output you attached to your post looks fine from my point of view.

when I try maping im doing it like this:
Drive: H
Folder: \\home\samba

Your computer is called "homefront", so ...

\\homefront\samba

... would be more accurate and might cut it.

But, as you said it even doesn't work by using the ip ...

Is there any error message or does the authentication just fail?

-Storm

Stormbringer
August 8th, 2006, 08:32 PM
Stormbringer, or anyone who knows - stupid question alert!

Isn't Samba pre-configured in a default Ubuntu 6.06 install?

So should I try these directions first or is Samba already running?

Nope --- samba isn't installed by default, and the smb.conf that will be installed together with samba is a mere template; not really fit for any use.

Be invited to follow the HOWTO and give it a try ...

The reason I ask is because this is the first I've seen of this guide and Samba seems to be kinda-sorta working.

I say kinda-sorta because I can see my Windows shares and my Windows shares can see my Ubuntu share, but it's S-L-O-W (often erroring out before I can see anything) and I can't transfer files of more than a few kB, that's if I can see them at all.

Well, I have some strange network issues with samba myself I cannot exactly work out ...

If I copy a large file, let's say 100MB+, from Windows to Linux it thunders through the network cabling with 20MB/sec+ (Gigabit). It even works that way if I copy back the file from Windows.

If I copy the same file back from Linux to Windows by smbfs it snails away with a few hundred KB up to ~5MB/sec at best.

However, so far I only get connection aborts if I try to transfer a file that is larger than 2048MB (i.e. DVD image) from Linux to Windows by using smbfs ... it freaks out as soon as the copy progresses through the aforementioned threshold.

There seem to be 30 second pauses each step of the way and file transfers on the Windows side terminate with a "The network name cannot be found" and on the Ubuntu side with a timeout error, that strangely times out instantaneously if I hit retry.

Hmm ... this rather sounds like a issue on the physical network ...

Edit: there could be something more than this going on, several network devices don't really respond to my Ubuntu machine:

- SlimServer (http://www.slimdevices.com/su_downloads.html) on my Windows machine
- my Linksys WRT54G router running DD-WRT
- my new SmoothWall (http://www.smoothwall.org) box

All these load the title of the page and the custom web page icon, but not much else. SlimServer loads a few lines of text after several minutes, the others don't load anything.

Interestingly my DSL modem works fine. This seems to point to the router being the cause, but everything looks good there as far as I can tell, and Windows LAN performance is much, much better especially for the networked devices. It's not perfect though, it often takes a long time to call up the share, and every once in a while it can't find the share, but once it's up, speed is fine.

As you seem to have done a little troubleshooting on your network it looks as the router is causing you the trouble ... and in this case I assume your router is the ShoreWall box.

On this point I'm unable to help you as I don't know ShoreWall at all ... but there are a lot of resources about it around on the net.

-Storm

hotch
August 8th, 2006, 09:02 PM
I greatly appreciate the How To on setting up Samba with Windows. I followed it and it worked. I have two Windows computers networked peer to peer through a router, and have added a Ubuntu laptop. I can now access the Ubuntu computer from my Windows one via the Network Neighborhood. Mapping the laptop as a drive does not work because Windows XP does not appreciate a mapped drive when the computer it represents is not turned on.

The problem now runs the other way. I cannot access the Windows computers and their shared folders or files from the Ubuntu one. Under Places, Network Servers, the network is there and the various computers are there. When I try to access any of the computers in the workgroup, I get a notice such as this one:

"The filename "BOB" indicates that this file is of type "desktop configuration file". The contents of the file indicate that the file is of type "x-directory/smb-share". If you open this file, the file might present a security risk to your system.

"Do not open the file unless you created the file yourself, or received the file from a trusted source. To open the file, rename the file to the correct extension for "x-directory/smb-share", then open the file normally. Alternatively, use the Open With menu to choose a specific application for the file."

Since this happens even when trying to access the Ubuntu computer shared file from the network file browser (after all, it is there), I get the feeling that the problem is in Ubuntu and not in Windows. What went wrong and what do I do about it?

hydroboy
August 8th, 2006, 10:52 PM
Great thread. Thanks all.

Fraoch
August 8th, 2006, 11:17 PM
Dangit, well although the procedure in this thread worked perfectly (no errors), my networking problems persist.

Both Windows PCs behave the same. The Samba share appears right away, with "Shared Printers" and "My Files" folders. The "My Files" folder contains the folder you had me define in the conf file.

I can copy files off my Ubuntu machine no problem at all. Maximum speed. I can even delete files off my Ubuntu machine from both Windows PCs as if it was a local drive. However I just cannot copy a file onto the Ubuntu machine. I get a long pause and "The network resource is unavailable" error.

The Ubuntu machine can barely see the Windows shares much less do anything to them - read or write usually result in timeouts.

It's like the Windows machines have write-not-read permissions and the Ubuntu machine has view-only permission. That's not the case though, and some of the other permissions act like they're trying to work.

It seems to be one of those nebulous general networking issues that's OS independent. I had high hopes that defining a WINS server would solve the issue as it appears to me like some sort of network locator isn't running properly, but that isn't it. My attention is now focused on NetBIOS but that seems to be running too.

Thanks for the great how-to though. Your instructions worked perfectly. It's something else that's causing me grief!

isharra
August 9th, 2006, 09:16 AM
I have two Ubuntu 6.06 PCs and one Windows 98 behind a broadband NAT router, connected by cable and using DHCP.

I haven't seen a resolution so forgive me if you've already fixed it.

Does the problem go away if you change from "security = user" to "security=share"?

It's been several years since I dealt with Win9x but if I recall correctly 9x only supported share security in a workgroup. You had to be logged in to a domain (nt authentication) to use user security. To do that would mean setting up one of the ubuntu machines as a PDC and that's beyond the scope of this thread.

IPC$ (inter process communication) errors are usually authentication or capability errors (wrong password, wrong encryption or wrong security type.)

I seem to remember having to set "encrypt passwords = true" in the [global] section of smb.conf but thay may have changed.

If neither of the above works, then make try again using an account with a password on the win98 machine. Null passwords required a working guest account. (I'm unsure if one is set up by the ubuntu installation, nobody used to be the default)

raja
August 9th, 2006, 09:28 AM
Looks like a great and detailed post, Stormbringer. I have one more of those 'stupid' questions for you. Does this work the same way for setting up file sharing between Ubuntu on my laptop and windows XP running on vmware? And would it work with a NAT network when both the ubuntu (host) and xp (guest)will have the same IP or will I need different IP addresses?
Thanks

Stormbringer
August 9th, 2006, 10:05 AM
I greatly appreciate the How To on setting up Samba with Windows. I followed it and it worked. I have two Windows computers networked peer to peer through a router, and have added a Ubuntu laptop. I can now access the Ubuntu computer from my Windows one via the Network Neighborhood. Mapping the laptop as a drive does not work because Windows XP does not appreciate a mapped drive when the computer it represents is not turned on.

That's right --- if the computer to which the network drive is mapped isn't powered up the drive is marked with a red "X" in "My Computer".

However, as soon as you boot up your lappy you simply need to click the mapped drive and the connection will be restored.

That's how it usually works by design ... just in case you wonder.

The problem now runs the other way. I cannot access the Windows computers and their shared folders or files from the Ubuntu one. Under Places, Network Servers, the network is there and the various computers are there. When I try to access any of the computers in the workgroup, I get a notice such as this one:

"The filename "BOB" indicates that this file is of type "desktop configuration file". The contents of the file indicate that the file is of type "x-directory/smb-share". If you open this file, the file might present a security risk to your system.

"Do not open the file unless you created the file yourself, or received the file from a trusted source. To open the file, rename the file to the correct extension for "x-directory/smb-share", then open the file normally. Alternatively, use the Open With menu to choose a specific application for the file."

Since this happens even when trying to access the Ubuntu computer shared file from the network file browser (after all, it is there), I get the feeling that the problem is in Ubuntu and not in Windows. What went wrong and what do I do about it?

Well, if you try to access a Windows-Share FROM Ubuntu (no matter is you use Nautilus's "Connect to server" or manual mount by smbfs) it has NOTHING to do with samba as samba IS ONLY REQUIRED TO GAIN ACCESS FROM WINDOWS (<-- no shouting, just to trigger attention).

So, at the best there's something square with Gnome's VFS that gets used when connecting to Windows from Nautilus.

Why not trying to install smbfs and give it a shot on the commandline?

Open a terminal and type ...

sudo apt-get install smbfs

...and try to mount the share ...

sudo mount -t smbfs //SERVER/Share /media/mountpoint -o username=windows_username,password=windows_passwor d,fmask=0666,dmask=0777,iocharset=utf8

Note: You eventually need to create the directory under /media to which you mount the share ... sudo mkdir /media/mountpoint

If it works out you have confirmation that's something wrong with Gnome and/or it's VFS.

As the connection from Linux to Windows isn't related to samba I'm not really able to assist you in troubleshooting Gnome (order KDE or whatever flavor of Ubuntu you may using).

-Storm

Stormbringer
August 9th, 2006, 10:10 AM
Dangit, well although the procedure in this thread worked perfectly (no errors), my networking problems persist.

Both Windows PCs behave the same. The Samba share appears right away, with "Shared Printers" and "My Files" folders. The "My Files" folder contains the folder you had me define in the conf file.

I can copy files off my Ubuntu machine no problem at all. Maximum speed. I can even delete files off my Ubuntu machine from both Windows PCs as if it was a local drive. However I just cannot copy a file onto the Ubuntu machine. I get a long pause and "The network resource is unavailable" error.

The Ubuntu machine can barely see the Windows shares much less do anything to them - read or write usually result in timeouts.

It's like the Windows machines have write-not-read permissions and the Ubuntu machine has view-only permission. That's not the case though, and some of the other permissions act like they're trying to work.

It seems to be one of those nebulous general networking issues that's OS independent. I had high hopes that defining a WINS server would solve the issue as it appears to me like some sort of network locator isn't running properly, but that isn't it. My attention is now focused on NetBIOS but that seems to be running too.

Thanks for the great how-to though. Your instructions worked perfectly. It's something else that's causing me grief!

Check if the "My Files" folder on Ubuntu has the appropriate rights. Issue a ...

ls -lisa /media/MyFiles

... and look out for the columns showing your the access modes, the owner and the group.

If the permissions don't look like drwxrwxrwx you forgot to issue "sudo chmod 0777 /media/MyFiles".

If the owner and group IS NOT your username you forgot to issue "sudo chown your_username:your_username /media/MyFiles"

If there's something wrong with the permissions you won't be able to copy onto the share from Windows; but it should give a message like "You don't have the appropiate permissions blah blah" instead of a networking error.

Just give it a try and remember to correct paths to match your setup.

-Storm

Stormbringer
August 9th, 2006, 10:14 AM
I haven't seen a resolution so forgive me if you've already fixed it.

Does the problem go away if you change from "security = user" to "security=share"?

It's been several years since I dealt with Win9x but if I recall correctly 9x only supported share security in a workgroup. You had to be logged in to a domain (nt authentication) to use user security. To do that would mean setting up one of the ubuntu machines as a PDC and that's beyond the scope of this thread.

IPC$ (inter process communication) errors are usually authentication or capability errors (wrong password, wrong encryption or wrong security type.)

I seem to remember having to set "encrypt passwords = true" in the [global] section of smb.conf but thay may have changed.

If neither of the above works, then make try again using an account with a password on the win98 machine. Null passwords required a working guest account. (I'm unsure if one is set up by the ubuntu installation, nobody used to be the default)

If you run Win95/98/Me the example configuration of samba in the HOWTO isn't suitable.

However, as the aforementioned operating systems aren't any longer supported by Microsoft you're better off switching to a more recent OS (i.e. Windows XP) if your Computer is capable of running it.

-Storm

Stormbringer
August 9th, 2006, 10:17 AM
Looks like a great and detailed post, Stormbringer. I have one more of those 'stupid' questions for you. Does this work the same way for setting up file sharing between Ubuntu on my laptop and windows XP running on vmware? And would it work with a NAT network when both the ubuntu (host) and xp (guest)will have the same IP or will I need different IP addresses?
Thanks

Should work fine with the VMware setup ... no idea about the NAT though.

I run VMware Server on my box, and inside of the "emulated" Windows XP I'm able to access the shares of samba running on the same box; difference is that I'm using bridged networking (the NAT to the outside world is done by my hardware router).

-Storm

stig
August 9th, 2006, 12:10 PM
If you run Win95/98/Me the example configuration of samba in the HOWTO isn't suitable.

However, as the aforementioned operating systems aren't any longer supported by Microsoft you're better off switching to a more recent OS (i.e. Windows XP) if your Computer is capable of running it.

-Storm

First, in answer to Isharra, I seem to have everything working except accessing my Ubuntu shares from the Windows 98 box - but there is a possible complication becasue I'm using DHCP. I'm going to try setting static IP addresses and see if that gets me anywhere. But as I mentioned in previous posts, I will soon switch completely to Ubuntu, so the motivation is low! (And as Stormbringer points out, Win98 is no longer supported by MS - or people like ZoneAlarm.)

Second, Stormbringer, in what way is your example config in the Howto not suitable for Win98?

Stormbringer
August 9th, 2006, 01:06 PM
(And as Stormbringer points out, Win98 is no longer supported by MS - or people like ZoneAlarm.)

I have no idea on how to interprete the line, but: Face the facts ... 9x/Me is discontinued ... and not only since yesterday's patchday.

Second, Stormbringer, in what way is your example config in the Howto not suitable for Win98?

As Isshara already pointed out:

- Win9x/Me seems to have issues with security=user (security=share should work out, but it isn't tested by me as I don't have any ancient Windows's to my avail anymore)
- Win9x/Me isn't really able to handle encrypted smb connections (this option isn't used here and defaults to unencrypted).
- In order to join into a domain (samba in PDC mode instead of stand-alone) you need to tweak some parameters to make it happen; not really sure if the parameters would also be needed in the stand-alone peer-to-peer setup).

Just take a look through the man-page or html documentation of samba and look out for remarks regarding Windows 9x ... there are some.

So, although I would really like to help in resolving Win9x/Me related issues I simply can't as I never used them (my way through Windows hell consisted of: Win3.xx -> NT 3.5x -> NT4 -> W2K -> WXP) and don't have them to my avail in order to setup a test-environment in VMware.

-Storm

jdriessen
August 9th, 2006, 03:00 PM
thankyou thankyou thankyou for this guide!!

this is the first guide that cleanly with no fuss sets up my windows installation to share files with ubuntu

this is great!

stevewabc
August 9th, 2006, 07:01 PM
ok thanks to this form my file sharing is up but my Print server is XXXX. ok This server has no gui, so to configure the printers im typing under root lynx 127.0.0.1:631/Administration/ and it shows new printer HP895C and my laserJet5 so I tab down to Add this Print
hit enter, it list the printer drivers its going to load all looks good so I tab to Add Printer, then I get not Authorized grrr then it asks for user name for cups so I tried everything and always get Authorization Failed..

this is cups 1.2.2
Please help do I need to down grade cups is it a bug? my hole damn office has no printers now ](*,)

Fraoch
August 9th, 2006, 08:27 PM
Check if the "My Files" folder on Ubuntu has the appropriate rights. Issue a ...

ls -lisa /media/MyFiles

... and look out for the columns showing your the access modes, the owner and the group.

If the permissions don't look like drwxrwxrwx you forgot to issue "sudo chmod 0777 /media/MyFiles".

If the owner and group IS NOT your username you forgot to issue "sudo chown your_username:your_username /media/MyFiles"

If there's something wrong with the permissions you won't be able to copy onto the share from Windows; but it should give a message like "You don't have the appropiate permissions blah blah" instead of a networking error.

Just give it a try and remember to correct paths to match your setup.

-Storm

Actually Stormbringer, there's no need. I've pinpointed the problem.

I was using a Slim Devices Squeezebox (http://www.slimdevices.com) as a wireless bridge.

When I wire the Ubuntu PC into my router directly, file sharing works as expected: from/to the Ubuntu machine, internal LAN webpages, everything.

This points the finger at the Squeezebox - even though Internet access was fine (I downloaded the Ubuntu updates at 315 kB/s, close to my Internet saturation speed of ~330 kB/s) it's somehow mangling filesharing bits.

The good news is this is all in firmware and the company is very responsive.

Even more good news is, of course, that Samba's working perfectly thanks to your guide. Thanks again!

whatrucrazy
August 9th, 2006, 10:24 PM
firstly thanks heaps stormbringer for the how-to but esp for the effort at anwering peoples questions, really appreciated by all!

ok, 3 questions.

1- does using samba effect the overall security of my ubuntu box? i'm not worried about accessing my windoze box from ubuntu (i know its not using samba), but it does concern me that an unsecure system like windoze can access my (hopefully) locked down ubuntu box. somehow is _worrying_. should i be concerned? if someone hacks the windoze box is my ubuntu system then an easy target, even if i have locked down permissions as best as i can??

2- does the 'Share folder' option in nautilus have anything to do with using samba, or is this a linux-linux, or user-user option? I had thought the permissions on the folder to be shared via samba just had to be set to allow access to any user, but then i noticed the nautilus option?

3- i installed firestarter, but don't initialise it at startup. this doesn't mean i don't have a firewall running though, yeah? by my understanding firestarter sets the rules and the rest just runs whenever the os is on. if this is the case, could this be why i can't get samba to run? ubuntu can read and write on the wondoze box, but the windoze cant even get any access to the ubuntu box. if that's why do i just configure firestarter to alow the windoze box's IP access?

sorry for the long post but i've been working on this for 2 days.:-k

thanks everyone who has helped in this thread, you all rock!

hotch
August 10th, 2006, 02:03 PM
Thanks again for the information. I had mentioned that I could access from Windows to Ubuntu, but not the other way around. Your suggestions sounded good, but then I discovered that the problem was not Ubuntu, it was me. The answer was right in front of me.

Instead of going through from the upper taskbar through Places/Network Servers, All I need to do is go from Places to Connect to Server, plug in the name of the Windows computer, and voila, there are all the shared folders in that computer. This apparently mounts that computer (or whatever) and puts an icon on the desktop.

ubuntu_demon
August 11th, 2006, 11:14 AM
Stormbringer I linked to this HOWTO on :

READ THIS FIRST prior to posting - IMPORTANT links
http://www.ubuntuforums.org/showthread.php?t=232059

A suggestion : link to further documentation in your first post for example :
-official samba documentation
-wiki.ubuntu.com samba documentation

tonydm
August 11th, 2006, 11:15 AM
It worked great!... @ first:(

I added an additional user and something broke. Now the drive\share I had mapped wouldn't connect. So I deleted it (windows) and tried to remap it. Now I cannot login/authenticate remap.

As part of the initial setup that I followed I set up this. Mapped and logged in from my XP Mach.

[MyFiles]
path = /home/tonydm/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = tonydm
force group = tonydm
available = no
public = no
writable = no

Then added the following to the smb.conf and issued sudo smbpasswd -L -a megan and sudo smbpasswd -L -e megan. Restarted samba. And it broke. Help Please.

[MegansFiles]
path = /home/megan/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = megan
force group = megan
available = no
public = no
writable = no

[Common]
path = /home/common
available = yes
browseable = yes
public = yes
writable = yes

dave2010
August 11th, 2006, 06:16 PM
I have gone through the HOWTO step by step.
Here is my problem:
I can see my ubuntu pc in winxp but when i try and access it it says that i might not have the right permissions.
Any ideas appreciated as this and network printing are the last hurdles before i totally switch over.
Cheers,
Dave.

jpordonez
August 12th, 2006, 01:00 PM
I read all your document and it is really very usefull. I have one additional question. My principal interest is to be able, on my Linux machine to use windows workstation names instead of their IP , when trying to connect to any windows share folder.

1) Is this samba setup enabling this ?

2) If I have more thna one Linux machine on the network what WINS ip should I enter on the Windows machine ?


Thanks for your help.

Punkie
August 12th, 2006, 01:40 PM
All well and great. With the exception that on a standard 6.06 install there is NO SAMBA. And installing it (apt-get install samba) does not work as he complains that it is not available. ubuntu however reports that smbclient and samba-common can replace the package.

Do they replace samba? If so then how can i apply the same steps to them?
If no, then can one get to install samba from the CD? or does one need internet access? (which i dont have on the ubuntubox...)

Stormbringer
August 12th, 2006, 04:28 PM
ok thanks to this form my file sharing is up but my Print server is XXXX. ok This server has no gui, so to configure the printers im typing under root lynx 127.0.0.1:631/Administration/ and it shows new printer HP895C and my laserJet5 so I tab down to Add this Print
hit enter, it list the printer drivers its going to load all looks good so I tab to Add Printer, then I get not Authorized grrr then it asks for user name for cups so I tried everything and always get Authorization Failed..

this is cups 1.2.2
Please help do I need to down grade cups is it a bug? my hole damn office has no printers now ](*,)


So I drop by in "my" thread and there are a bunch of posts ... I really wonder why the board fails to send me the "topic reply" notifications ...


You get the error on Windows, right?

In the add printer wizard select "network" as the connection type and give the UNC path to your print server - i.e. \\SERVER\HPLJ5 (you may also browse the network).

After that Windows should ask you to provide the printer driver ...

Simply select the appropriate printer driver from the list (LaserJet 5 and/or DeskJet 895C) and let it install.

Should work out fine ... I'm running an HP LJ4M on my Ubuntu 6.06.1 LTS; the distribution is up-to-date and the print-spooling works fine when I print from Windows.

Stormbringer
August 12th, 2006, 04:40 PM
ok, 3 questions.

1- does using samba effect the overall security of my ubuntu box? i'm not worried about accessing my windoze box from ubuntu (i know its not using samba), but it does concern me that an unsecure system like windoze can access my (hopefully) locked down ubuntu box. somehow is _worrying_. should i be concerned? if someone hacks the windoze box is my ubuntu system then an easy target, even if i have locked down permissions as best as i can??

As for samba: You're fine as long as you're blocking port 137, 138, 139, 445 (TCP and UDP) against access from the outside world (Internet).

If your Windows box gets pwned by a trojan or backdoor your Ubuntu box may be at risk if there's some security hole that hasn't been patched.

If you don't run things like SSH (i.e. you connect to your Ubuntu box by SSH using PuTTY with passwordless RSA-key authentication) or telnet chances are rather minimal (although I read an thread here on the forums that a box got hacked through a windows client).

2- does the 'Share folder' option in nautilus have anything to do with using samba, or is this a linux-linux, or user-user option? I had thought the permissions on the folder to be shared via samba just had to be set to allow access to any user, but then i noticed the nautilus option?

As it doesn't need to samba for operation it doesn't seem to be related to samba ... although I might be at error as I haven't used that option and haven't dug myself through the tons of documentation on Gnome.

3- i installed firestarter, but don't initialise it at startup. this doesn't mean i don't have a firewall running though, yeah? by my understanding firestarter sets the rules and the rest just runs whenever the os is on. if this is the case, could this be why i can't get samba to run? ubuntu can read and write on the wondoze box, but the windoze cant even get any access to the ubuntu box. if that's why do i just configure firestarter to alow the windoze box's IP access?

What's the layout of your network? Do you have 2 network cards in your linux box or do you connect through a hardware router?

A little more background would be nice to give it a thought ...

-Storm

Stormbringer
August 12th, 2006, 04:43 PM
Stormbringer I linked to this HOWTO on :

READ THIS FIRST prior to posting - IMPORTANT links
http://www.ubuntuforums.org/showthread.php?t=232059

A suggestion : link to further documentation in your first post for example :
-official samba documentation
-wiki.ubuntu.com samba documentation

Thanks for linking the guide into the "Important links" sticky.

Will update the first post as suggested; guess it a real good idea to link to the official samba documentation so that people are able take a look into it.

Thanks,
-Storm

Stormbringer
August 12th, 2006, 04:50 PM
It worked great!... @ first:(

I added an additional user and something broke. Now the drive\share I had mapped wouldn't connect. So I deleted it (windows) and tried to remap it. Now I cannot login/authenticate remap.

As part of the initial setup that I followed I set up this. Mapped and logged in from my XP Mach.

[MyFiles]
path = /home/tonydm/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = tonydm
force group = tonydm
available = no
public = no
writable = no

Then added the following to the smb.conf and issued sudo smbpasswd -L -a megan and sudo smbpasswd -L -e megan. Restarted samba. And it broke. Help Please.

[MegansFiles]
path = /home/megan/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = megan
force group = megan
available = no
public = no
writable = no

[Common]
path = /home/common
available = yes
browseable = yes
public = yes
writable = yes

Adding an user shouldn't affect samba ... two possibilities ...

1. Samba dislikes you for the typo: "writable" is spelled WRONG ... "writeable" is much more accurate. Please take a look into it and correct the parameter if you really happend to commit that typo in your smb.conf. Afterwards restart samba (sudo /etc/init.d/samba restart).

2. Shouldn't be required as we're using TDBSAM as user/password backend, but try to add the user to the system (in Gnome: "System" -> "Administration" -> "Users and Groups").

I would dare to bet the first one should fix your problem in case it is a typo.

-Storm

Stormbringer
August 12th, 2006, 04:58 PM
I have gone through the HOWTO step by step.
Here is my problem:
I can see my ubuntu pc in winxp but when i try and access it it says that i might not have the right permissions.
Any ideas appreciated as this and network printing are the last hurdles before i totally switch over.
Cheers,
Dave.

A little more information would be great ...

I assume you followed the guide, so the authentication error could only be related to the useraccount or samba's setup.

- Did you add your useraccount to samba and enable it (the part that deals with smbpasswd -L -a <username> and smbpasswd -L -e <username>)?

If you only added the account you still need to enable it for access.


Also, check your smb.conf for possible typos in case you didn't copy/paste ... or in case you did some modifications yourself.

-Storm

Stormbringer
August 12th, 2006, 05:09 PM
I read all your document and it is really very usefull. I have one additional question. My principal interest is to be able, on my Linux machine to use windows workstation names instead of their IP , when trying to connect to any windows share folder.

1) Is this samba setup enabling this ?

If you enabled WINS ("wins support = yes" in smb.conf) it's samba doing the job (Name to address, and vice versa, translation).

2) If I have more thna one Linux machine on the network what WINS ip should I enter on the Windows machine ?

Tricky question ... this depends on the setup of your network ...

If you run Ubuntu- and Windows as Workstations you can safely enable WINS on all boxes and provide all IPs to Windows - the WINS browsers will sync each other when all are up.

If you run Ubuntu as a server you're better off enabling WINS on the server only.

However, in Linux you may want to edit /etc/nsswitch.conf to enable WINS resolution between Linux boxes.

Find the line reading:

hosts: files dns mdns

and add "wins" at the end of the line to make it read:

hosts: files dns mdns wins

Now, if you connect from a Linux box to another Linux box by smb you may use the name instead of the IP as WINS will try to resolve the name-to-address (will only work if there's a WINS server up and available).

-Storm

Stormbringer
August 12th, 2006, 05:19 PM
All well and great. With the exception that on a standard 6.06 install there is NO SAMBA. And installing it (apt-get install samba) does not work as he complains that it is not available.

Samba is available for installation online...


stormbringer@nebuchadnezzar:~$ sudo apt-cache policy samba
samba:
Installed: 3.0.22-1ubuntu3.1
Candidate: 3.0.22-1ubuntu3.1
Version table:
*** 3.0.22-1ubuntu3.1 0
500 http://security.ubuntu.com dapper-security/main Packages
100 /var/lib/dpkg/status
3.0.22-1ubuntu3 0
500 http://archive.ubuntu.com dapper/main Packages


As you can see ... the package is called "samba", and it's located in the networking section of the main repository (you need internet access!).

"sudo apt-get install samba" will therefore only work if you're connected to the internet.

ubuntu however reports that smbclient and samba-common can replace the package.

Do they replace samba? If so then how can i apply the same steps to them?
If no, then can one get to install samba from the CD? or does one need internet access? (which i dont have on the ubuntubox...)

"samba-client" and "samba-common" are just the CLIENT packages of samba (Gnome and some other programs need these packages in order to gain access TO Windows) ... samba is the SERVER part that makes it possible to gain access TO Linux FROM i.e. Windows. So - no - these packages DO NOT replace samba or stuff as they are not related to the server part ... although it would be funny if Ubuntu really wrote stuff like that somewhere hidden in the depths of the site and/or Wiki.

Oh, and as I don't have the CD at hand I'm unable to tell you if samba is available for installation from CD ... will take a look into it on Monday and edit this post.

-Storm

ubuntu_demon
August 13th, 2006, 06:13 AM
Thanks for linking the guide into the "Important links" sticky.

Will update the first post as suggested; guess it a real good idea to link to the official samba documentation so that people are able take a look into it.

Thanks,
-Storm
Great! Thanks for adding the stuff. I already put some other Samba links in the sticky. Please PM me if you have added some links so I might add them there too.

jpordonez
August 17th, 2006, 10:56 AM
I have setup according to your directions and it all works fine. One additional question:

I have a website running on the Windows machine. I can access it from the linux machine using the IP, but I would like to browse it using the windows machine name instead of the IP. Is this possible ? How do I set this up ?

Stormbringer
August 17th, 2006, 12:48 PM
I have a website running on the Windows machine. I can access it from the linux machine using the IP, but I would like to browse it using the windows machine name instead of the IP. Is this possible ? How do I set this up ?

A WEBSITE? This has nothing to do with samba ... X_X ... I hope you're aware of that fact.

Accessing the website you're running on your Windows box by name requires the installation of a DNS-server for your intranet on a server that's inside your internal network as well.

Please take a look at this HOWTO: Howto: Setup a DNS server with bind (http://ubuntuforums.org/showthread.php?t=236093)
It's more related to your question.

rc-edens
August 17th, 2006, 02:40 PM
Nice HOWTO - very comprehensive.

I neglected to check the Ubuntu forums when I was looking for Samba setup info two days ago :( but instead used a small Samba HOWTO contained within an article I ran across at TomsHardware.com. The Samba info there starts on page 8 of the article: http://www.tomsnetworking.com/2006/08/08/diy_nas_smackdown/.

Although it's a small set of instructions, it was just what I needed for setting up an Ubuntu photo file server for my Windows XP Photoshop machines.

--- "RC" Edens

WzrdOfOost
August 18th, 2006, 10:00 AM
Too bad I did not see these forum when I wsa struggeling with samba. I just cleaned the whole smb.conf and started from scratch. I blogd my struggle here http://my-linux-server.blogspot.com

ledj0
August 21st, 2006, 12:23 PM
Hello and thanks for your efforts in helping everybody.

My problem is the following: I have a server (GATEWAY) that runs Ubuntu 6.06 and that, as it's name implies, is used as a gateway to a public network. Samba runs on this server and the firewall is configured to let Netbios and Samba ports traffic allowed from private interface. Also, I have setup all Windows workstation to use WINS over TCP using to the Gateway server IP address.

My smbpasswd user list is synchonized with my Windows user names and password for all workstations and the smbpasswd users are enabled.

I have 1 laptop that runs Win2K pro, 1 workstation that runs WinXp pro and 1 workstation that runs WinXP-home. Everything works fine from my win2K workstation. Using Windows explorer, I can navigate through the workgroup to the public share on the Gateway server. When using the WinXp ones, I simply cannot get to the shares. Here is what happens:

I open Windows Explorer and navigate to my server. When I click on Gateway, I am asked by Wndows to enter a name and a password. I enter a valid name and password (ex: jacques and mysecret where they are both entered and enabled in the smbpasswd). The password screen is then redrawn asking for a name and password this time, the user field is populated with "GATEWAY\jacques". I enter again the password but no can do. The system remains in this loop forever.

I tried the net test from the XP workstations and it worked OK (net use z: \\192.168.1.1\public mysecret /user:jacques /persistent:no and the drive is mapped correctly with the correct access rights) so it seems that it is at the password exchange level that ther is a problem.

I also get that nasty password screen when I try to install a public printer on the XP workstation while I have no problen installing on the Win2K equipment.

Here is my configuration:


[global]

workgroup = HOMELEDX
netbios name = GATEWAY
server string =
interfaces = eth1 lo
bind interfaces only = yes

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/usermap
name resolve order = hosts wins bcast
wins support = yes

encrypt passwords = yes

printing = cups
printcap name = cups

[public]
path = /exports/samba/public
read only = yes
browseable = yes
guest ok = no
force user = ledxadmin
force group = users

[printers]
comment = All printers
path = /var/spool/samba
guest ok = no
printable = yes
use client driver = yes
browsable = no

Thanks in advance for your help.

ledj0

Stormbringer
August 22nd, 2006, 02:43 AM
I open Windows Explorer and navigate to my server. When I click on Gateway, I am asked by Wndows to enter a name and a password. I enter a valid name and password (ex: jacques and mysecret where they are both entered and enabled in the smbpasswd). The password screen is then redrawn asking for a name and password this time, the user field is populated with "GATEWAY\jacques". I enter again the password but no can do. The system remains in this loop forever.

You're not the only one who reported this odd behaviour in this thread - and I tried hard to reproduce the problem inside a VMware environment (Ubuntu 6.06 Server with all patches applied, Windows XP Home Edition / Professional with SP2 and all hotfixes applied) but failed so far.

To be honest ... I have no idea what the problem might be as I cannot reproduce the behaviour at all. It always works out for me (not only in the peer-to-peer setup but in a full PDC setup as well).

I tried the net test from the XP workstations and it worked OK (net use z: \\192.168.1.1\public mysecret /user:jacques /persistent:no and the drive is mapped correctly with the correct access rights) so it seems that it is at the password exchange level that ther is a problem.

That's what I think too ... something's different in the authentication; seems as Windows Explorer handles things slight different than "net" does.

I also get that nasty password screen when I try to install a public printer on the XP workstation while I have no problen installing on the Win2K equipment.

Ah ha ... so it's related to XP only ... well ... if that's the case then Server 2003 and/or XP x64 should have a similar problem as they share the same code-base (at least that's what M$ tells).

Here is my configuration:
<snip>

Looks fine to me ... no typos and no misconfiguration.

However, as you seem to run this setup on a multi-homed firewalling server ...

Mind to post the firewall-rules of iptables you configured (just clean out any public IP with xxx.xxx.xxx.xxx)?

Does the output of "smbclient -L localhost -U%" look fine or does it show any errors?

-Storm

ledj0
August 22nd, 2006, 08:55 AM
There might have been different problems: after I posted that message, I reviewed all parameters that might influence this setup in and out Samba. I realized that I did not have Wins registration (tcp-139) and SMB/CIFS udp-445 opened. Also, I have made a change in my [public] share's force user and force group. Finally, I removed the "username map" entry as the map file did not contain anything.

I never used a Wins server in my network so this is why I overlooked the first one and the second is probably due to misreading or plain fatigue:-? .

I cannot tell exactly which of these change solved the problem. I will certainly try to isolate this some time but here's what I think:

- I don't think the firewall ports have caused that specific problem since things were working fine in 2k. I tend to think that it might have influenced the browsing speed. Also, I doubt very very much that the password exchange routine varry that much at the interfacing level from 2k to XP but hey...we never know with Bill's baby;).

- As you made it clear in this thread, the "force user" and "force group" parameters have nothing to do with login but deals with file ownership. This means that this parameter should not have made difference in this situation.

- This leaves the "username map" parameter. In my first post, I did not go into all details as did not want to write a novell. I said that my user configuration was checked, etc. Here are the details:

- the login name from the 2k workstation was exactly reproduced in the linux box with the exact same case (ex: abc - abc). There was a direct match from win to samba password.

-the login name from XP was the same name exept for the first character which was uppercase in win (ex Def - def). It is mentionned in some Samba books as well as in this thread that username case is converted to lowercase so I did not bother since this was exactly the case.

However the match was not perfect and there is a "username map" parameter so (from this point, this is only speculation from my part as I did not go through Samba's sources ) Samba goes in resolution mode. It looks at "username map" parameter and if it does not find a map there, it simply returns as if you sent an invalid name. In my opinion, removing this parameter is the key as from there, Samba will follow it's standard internal resolution algorithm.

In any case, things are (finally) working fine now. I will try to isolate exactly what fixed this and post back to this thread (after a short vacation8) ).

Big thanks again for your time and efforts, you are a champ.

ledj0

dkaplowitz
August 27th, 2006, 10:38 AM
Great guide, Stormbringer, thanks! For some reason it was looking for a non-existent file /etc/smb/smbusers. I touched that file and it solved that error. And aside from not realizing that the workgroup name was case sensitive (I assumed it wasn't), it was a breeze to set up.

Cheers!

Dave

HAL98 SE
August 27th, 2006, 11:10 AM
Thanks so much for this HOWTO. It worked first time. Now i can start to see how Samba works!

spot101
August 28th, 2006, 12:33 PM
Questions about printers in Samba.

First off thanks for the great How to. By the look of this thread it's being apprecated by lots of people.

I'd like to print using windows native drivers. (Better feature support and sometimes better quality printing)

I've done a bit of reading but I am still not clear what is required.

What changes do I need to make to smb.conf and CUPS to make this work?

I don't need to auto install drivers across the network as I have read else were. Just the bacics are needed.


Much thanks,
Spot.

Stormbringer
August 28th, 2006, 04:36 PM
Questions about printers in Samba.

First off thanks for the great How to. By the look of this thread it's being apprecated by lots of people.

I'd like to print using windows native drivers. (Better feature support and sometimes better quality printing)

I've done a bit of reading but I am still not clear what is required.

What changes do I need to make to smb.conf and CUPS to make this work?

I don't need to auto install drivers across the network as I have read else were. Just the bacics are needed.


Much thanks,
Spot.

If you want to hook your printer to your Ubuntu-Box and share it for the client on the LAN you need to install the Printer in CUPS first (in Gnome: "System" -> "Administration" -> "Printing") - there's no way around.

As soon as you installed your printer restart samba so that the newly added printer gets recognized for sure.

To add the printer to your Windows client you may either use the Network Neighborhood (browse to your Ubuntu Box, open the "Printers" Folder, right-click your printer and select "Connect") or the Add Printer Wizard in the Control Panel.

In both cases Windows will ask you to provide a driver for your printer in case it isn't directly supported by Windows. Install the driver and your're done.

The spool-file of Windows will be sent to Samba and forwarded to the appropriate CUPS-spool. If the job is already in the fitting native printer-language (PCL, PostScript, whatever) it will be put into the queue without further pre-processing and finally be printed.

In case the spool-file mismatches with the capabilities of the CUPS driver the job WILL be pre-processed to make it fit.

In the end it's CUPS that's handling your printer - not Windows or one of it's drivers.

If you have doubts you may also hook the printer to one of your Windows clients and setup a shared printer there ... in case the Windows-driver will output better quality.

-Storm

spot101
August 29th, 2006, 12:42 PM
Thanks for the ultra quick reply. I'm glad it's so straight foreward to do. I had read about having to set-up raw print queues in CUPS and wasn't sure if it needed to be that invloved. This way is automatic. Cool!!

Earlier in this thread I read about someone who needed to set-up samba for himself, his brother and father. The problem was to give read/write access to a share to himself and his brother and read only access to the father.
In my reading I came accross this and wondered if this approach would work.


Here's another example of using variables: let's say there are five clients on your network, but one client, maya, requires a slightly different [homes] configuration. With Samba, it's simple to handle this:
[homes]
...
include = /usr/local/samba/lib/smb.conf.%m
...

The include option here causes a separate configuration file for each particular NetBIOS machine (%m) to be read in addition to the current file. If the hostname of the client system is maya, and if a smb.conf.maya file exists in the /usr/local/samba/lib directory, Samba will insert that configuration file into the default one. If any configuration options are restated in smb.conf.maya, those values will override any options previously encountered in that share. Note that we say "previously." If any options are restated in the main configuration file after the include option, Samba will honor those restated values for the share in which they are defined.
From Using Samba Chapter 6 http://us2.samba.org/samba/docs/using_samba/ch06.html

You might then be able to set the share read only for one user. i.e. the father.

Any thoughts?

Thanks again for your help.

Spot.

addisor
August 31st, 2006, 10:48 AM
All went well to a point. The XP computer is a wireless laptop. When i got to the network mapping bit, i chose Z drive and //rob/myfiles, fails everytime with "an extended error has occured" any suggestions

dmizer
August 31st, 2006, 10:52 PM
what is suppose to be in the /etc/samba/smbusers file?

for some reason or another, this file has been either deleted or removed without my knowledge (an update maybe?)

my logs contain the following:
Sep 2 01:11:53 storage smbd[21960]: [2006/09/02 01:11:53, 0] lib/username.c:map_username(139)
Sep 2 01:11:53 storage smbd[21960]: can't open username map /etc/samba/smbusers. Error No such file or directory
i am VERY concerned about this. both that the file can't be found, and the fact that i'm getting write_data errors.

i am still able to log in, and everything seems to be running okay ...

jng
September 1st, 2006, 05:43 AM
New to Linux I was searching for a guide to set up Linux to work in network with Windows, and I searched through several guides to setup Samba, but I could not make it work - until I found this guide. Following your instruction it just works flawlessly.

Thank you very much for this fine guide. :D

INS_tha_rebel
September 1st, 2006, 02:56 PM
Edit

dmizer
September 1st, 2006, 07:47 PM
Not sure what to do next......any ideas??
yes.

instead of accessing the linux drive through network places do the following:

right click on my computer and select "mount network drive"
don't browse for the share. enter in the following for location: //linuxboxname/foldername

where linuxboxname is what you entered in smb.conf for the field: "netbios name ="
and foldername is what you entered between the brackets in smb.conf for: [MyFiles]

if that doesn't work, try the same again but click on the link that says "connect with a different username and password", and enter in your login information there.

then you should be able to see your network folder in "my computer" as well as in network places.

gary4gar
September 2nd, 2006, 06:35 PM
well real good guide!
pls keep writing this n00b stuff it hepls me a lot

paul.rayner
September 3rd, 2006, 07:27 AM
Great Howto Really helpful.

Bill_MI
September 3rd, 2006, 04:13 PM
First, thanks for the excellent HowTo! Working first time without a reboot, as many have reported.

Configuration questions from a techy-type climbing the Linux learning curve...

1) A good friend says they use WEBMIN to configure SAMBA shares. I've seen and tried WEBMIN, but not on this machine and not for shares. It doesn't appear in any official or community repositories. What drawbacks happen with WEBMIN? Is it not easy to get for a good reason?

2) I read how SUDO and SWAT don't work very well but ROOT can be given a password to get around it (http://ubuntuforums.org/showthread.php?t=58434&highlight=swat). The ramifications of this are still unclear. I'm glad I found THIS HowTo before going that direction.

Shouldn't SWAT either be packaged to work or removed as "supported"? Am I missing a basic definition of what "supported" means?

Insight and opinions welcomed. TIA

de4th
September 4th, 2006, 05:29 PM
Excellent how to! Thank you very much!
It worked good :cool:

dmizer
September 4th, 2006, 08:33 PM
First, thanks for the excellent HowTo! Working first time without a reboot, as many have reported.

Configuration questions from a techy-type climbing the Linux learning curve...

1) A good friend says they use WEBMIN to configure SAMBA shares. I've seen and tried WEBMIN, but not on this machine and not for shares. It doesn't appear in any official or community repositories. What drawbacks happen with WEBMIN? Is it not easy to get for a good reason?

2) I read how SUDO and SWAT don't work very well but ROOT can be given a password to get around it (http://ubuntuforums.org/showthread.php?t=58434&highlight=swat). The ramifications of this are still unclear. I'm glad I found THIS HowTo before going that direction.

Shouldn't SWAT either be packaged to work or removed as "supported"? Am I missing a basic definition of what "supported" means?

Insight and opinions welcomed. TIA

i suggest sticking to this howto for configuring samba. it's easier than trying to beat your head in over webmin. webmin is a good tool for some things but not all. if you're running a headless server, ssh is still your best friend.

don't know much about swat.

sudo is a safety net. if you run as root regularly, you can cause a system wide problem with a single stroke of a key. believe me, i've done it. especially on a server, running as root should be avoided at ALL costs ... if for no other reason than simply security sake.

maybe you meant ssh rather than sudo? there's some good ssh howto here: http://easylinux.info/wiki/Ubuntu_dapper#SSH_Server. sudo in combination with fuse can be used on a linux machine to mount remote linux file systems such that you can browse them with your filemanager.

i wouldn't suggest installing wembin via repos. there's a fantastic howto here: http://www.ubuntuforums.org/showthread.php?t=195093&highlight=webmin+dapper

really, in my opinion ... ssh and samba are necessities. webmin is a handy tool to have around on occasion.

Bill_MI
September 5th, 2006, 05:58 AM
Thanks, dmizer, I'll definitely browse your suggestions.

I didn't mean SSH - more like "the SUDO process" of default Ubuntu. I guess in further reading that setting a strong root password doesn't compromize much and essential for SWAT.

Why I was looking into SWAT: I really wanted to get more insight into SAMBA by examining a good configuration front end but it probably doesn't exist. Thus, the need for HowTos is big.

Stormbringer did a good job on this one - it has the right mix of blind steps and insightful info for something as configurable as SAMBA. :D

nef
September 9th, 2006, 02:28 AM
This is a great HOWTo storm. This is exactly what I was looking for. I just have a 2 questions. On my windows box, the usernames are have the first letter capitalized. Doing the

sudo useradd -s /bin/true User_name

it allowed me to capitalize the first letter in ubuntu. But, when I try to log into ubuntu with the fist letter capitalized it doesnt allow me. Ubuntus username syntax requires the first letter in the username to be lowercase. What I want to know, is there a way I can log into the accts in ubuntu with the first letter capitalized or will I need to change the username on the windows box to have the first letter in lowercase.

Second question. How do I connect the printer I have shared in samba to another box running ubuntu? Thanks. You rock.


Nef

Giggity
September 10th, 2006, 05:50 AM
Edit: problem now fixed...

Thanks, Storm. I followed your instructions, and everything worked perfectly. I was able to map a network drive in my virtual WinXP right off the bat.

Then I rebooted the virtual machine after installing a program. Apparently that was the stupidest thing I've done in at least a week. Upon rebooting, I tried to access the network drives, and the virtual WinXP asked me for my username and password. I entered the same things as last time ("ROB-DESKTOP\rob" for the User Name and the password set in "sudo smbpasswd -L -a rob" for the password). But this time, pressing enter just redraws the password window, ad infinitum.

I know my smb.conf is proper since all three of my desired drives mounted the first time. Does anyone have any idea how I managed to foul up a perfectly functional setup?

Solution: I replaced "ROB-DESKTOP" with "ROB_DESKTOP" (hyphens became underscores) when mapping the network drive. I'm pretty darn sure the first time it worked, it was spelled with a hyphen, just like the hostname is shown in the Konsole. Can anyone explain that?

rlgoddard
September 14th, 2006, 10:26 AM
Hi,

Got a question regarding these two lines in smb.conf:


force user = YOUR_USERNAME
force group = YOUR_USERGROUP


Does this refer to my Ubuntu user name (joey) or to my Windows MCE user name (lolita)?

Thanks for your simple to follow how-to guide!

Take care,
Russ

mango.muncher
September 14th, 2006, 07:06 PM
force user = YOUR_USERNAME
force group = YOUR_USERGROUP

I used this 'How to' and entered Ubuntu username for both, later on you will set up windows username rights.

Storm you are a Ubuntu demi god! Thanks for this guide, now i can print from my Virtual XP machine.:biggrin:

superdave7380
September 15th, 2006, 11:43 AM
Help!

Brand new Linux user here... (sorry... geez...)

Tryin' to share the following with an XP computer.

[MOVIES]
I tho
path = /home/MOVIES
browsable = yes
writable = yes
public = yes
create mask = 0775
directory mask = 0775

3 users on the XP machine
All set as administrators (I know, very secure...)

I added all 3 to linux (adduser...)
I added all 3 to samba (smbpasswd...)
Same passwords all around...

On the PC, 2 out of 3 users can see the share no prob! (amazingly enough)
No password needed. Spiffy.

Problem is: The final user has to enter his name/password for some reason.

He is the original admin on the XP machine. (coincidence?) Again, all 3 users are now adminstrators...

I thought maybe he was seen as "adminstrator" instead of his username.. so i created an "administrator" user + smb user... that didn't work... deleted that...

So again, works for 2 of 3 admins on XP. For the 3rd (original admin), he has to enter his username/password. Then, it works no prob.

Why is he different? I dunno.

Help!

And thank you.[MOVIES]
path = /home/MOVIES
browsable = yes
writable = yes
public = yes
create mask = 0775
directory mask = 0775

myname
September 15th, 2006, 05:23 PM
GREAT GUIDE!

I was able to get my samba server up and running (Kubuntu), and have my windows machine connect to it. However, I have Ubuntu on my other box, and I can't connect to either my windows server OR my Kubuntu server through Samba.

The samba client SMBCLIENT is installed, do I need anything else installed? With the base install of Ubuntu I have never been able to connect it to my windows server, BUT with the base install of Kubuntu I am able to.

If both of these are based off the same code base, shouldn't they both connect?

Any help on getting my Ubuntu box to connect via Samba would be greatly appreciated.

jfighter
September 17th, 2006, 01:33 PM
I got samba to work on my network so my Windows XP clients can now access the shared volume on my Ubuntu server.

However, I've browsed through this thread and still haven't found the answer to this one question: Can samba installed on Ubuntu server be used to enable Windows XP clients on the LAN to access shared folders residing on the hard drives of OTHER XP clients within the workgroup?

The reason I ask is that I have 10+ Windows XP client machines on my LAN and once I put the 11th computer on the LAN, Windows displays a message to the effect of "you have exceeded the 10 workstation connection limit...go buy Windows Server 2003 you poor bastard".

I know that Samba can connect up to 250 workstations on a LAN, but is it able to offer peer-to-peer file sharing between CLIENTS within the workgroup?

Thanks to Storm for his excellent contributions and all posters for any help!

myname
September 17th, 2006, 02:46 PM
I have not tried this, but, in theory it *could* work. Then again, I am a novice Linux user/recent converted to Linux from windows guy myself.

But if you mount the shares on your Linux box, can you not also share those mounts?

meaning, from your linux box, you mount your windows shares:

/mnt/windowsXP_box1
/mnt/windowsXP_box2
/mnt/windowsXP_box3
etc.

Then can you share those mounts? so from the XP machiens, you connect to the Linux box and see the shares?

Like I said, I haven't tried this, but it kinda makes sense in theory.

Any linux guru's out there know if this will work?

--kp

spot101
September 18th, 2006, 10:28 AM
I got samba to work on my network so my Windows XP clients can now access the shared volume on my Ubuntu server.

However, I've browsed through this thread and still haven't found the answer to this one question: Can samba installed on Ubuntu server be used to enable Windows XP clients on the LAN to access shared folders residing on the hard drives of OTHER XP clients within the workgroup?

The reason I ask is that I have 10+ Windows XP client machines on my LAN and once I put the 11th computer on the LAN, Windows displays a message to the effect of "you have exceeded the 10 workstation connection limit...go buy Windows Server 2003 you poor bastard".

I know that Samba can connect up to 250 workstations on a LAN, but is it able to offer peer-to-peer file sharing between CLIENTS within the workgroup?

Thanks to Storm for his excellent contributions and all posters for any help!

From my research the probelm you face is a limit on the number of inbound connections WinXP Pro can accept.This Microsoft Support Article (http://support.microsoft.com/?scid=kb;en-us;314882) suggests you reduce the auto-disconnect time to make a connection available more quickly using this command:

net config server /autodisconnect:time_before_autodisconnect_in_minut es

Maybe you should reconsider your network architecture? Making the Ubuntu/Samba system the central repository on the network with multiple shares might be an easier approach.

Hope this helps.

Spot.

mattice06082
September 18th, 2006, 05:54 PM
I'm totally new to Ubuntu and I was able to follow these instructions so that goes to show how well written it was. Thanks for sharing it with the community.

After following this HOWTO I'm able to see my windows machines using the Places -> Network Server browser. However is there a way to refer to the network machines from within the Terminal? I've tried ls //MachineName/SharedDir and ls \\MachineName\SharedDir, but haven't had any success. As I said I'm new so please don't lol.

Also tried //priviteipaddress/ShareDir, but this didn't work either.

smbmount is what I was looking for. Found it at http://www.ubuntuforums.org/showthread.php?t=255872.

jfighter
September 19th, 2006, 02:23 PM
From my research the probelm you face is a limit on the number of inbound connections WinXP Pro can accept.This Microsoft Support Article (http://support.microsoft.com/?scid=kb;en-us;314882) suggests you reduce the auto-disconnect time to make a connection available more quickly using this command:

net config server /autodisconnect:time_before_autodisconnect_in_minut es

Maybe you should reconsider your network architecture? Making the Ubuntu/Samba system the central repository on the network with multiple shares might be an easier approach.

Hope this helps.

Spot.

Very good points. I will try out myname's recommendation of mounting from the server and sharing back to clients (kinda roundabout way of doing it I must say but I guess there isn't a more elegant solution). If that way doesn't work, doing multiple shares from server as spot suggests wouldn't be a bad alternative.

I'll report on what happens as soon as I have results. If anyone has a more elegant solution, do tell. Thanks again for the suggestions! :)

dmizer
September 20th, 2006, 12:56 AM
Why is he different? I dunno.

Help!

And thank you.
i'll give it a shot.

from page one in the guide for adding users to your ubuntu samba:
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!
so your final user is loging into his windows box as "administrator" which means that you would have to add "administrator" to your ubuntu box.

there's another way though.

just go to the box that's not loging on correctly. right click on "my computer" and select "mount network drive". there's a little link below that says "log on as different user" ... select that and you can enter a different user name and password than administrator (and it will still be able to connect at boot). enter in the user name you added to samba for this individual, and you should be good to go.

superdave7380
September 20th, 2006, 10:30 PM
thanks, dmizer. i appreciate it.

MacPC
September 22nd, 2006, 02:29 AM
Hi there,

I am trying to network my Ubuntu PC to my two Windows PCs. One is a laptop and the other one is a desktop. Both Windows PCs are runnung Windows 2000 Pro. From the Ubuntu, I can access any folders on the laptop without any problem, but when I try to access the desktop, I can only access first one or level of the folder then I get this message "The folder contents could not be displayed. you do not have the permissions necessary to view the contents of 'XXXX'" For example, I choose this path: [my machine]-->WINTNT-->Web folder, every files on my laptop shows up, but when I use the same path on the desktop, once I try to open the Web folder, this message pops up. I am quite sure that on both PC, the file shareings are identical, what am I missing here? :confused: :( :sad: :-x :?: :?: :?:

Also, how can I make the Ubuntu a server? On both Windows PCs, the Ubuntu PC shows up in My Network -->Computer Near Me, but when I try to access it after typing in username and passwork, I am denied asscess, how can I fix this?

One more question, how can Ubuntu share fils with the Mac OSX Tiger?

Thanks in advance. Too many questions too little time. :eek:

MacPC

rabbit69ca
September 28th, 2006, 12:43 AM
Great how:to very helpful, but I am having some problems.

I believe it is setup correctly but when I try and map the network drive it is asking me for a username and password, I have all the UN/PWs setup the same

the SMB user the actual Ubuntu account user as well as the windows username and password. (just to prevent confusion) but for som reason when I put that into the field it doesn't accept it.

not 100% why.

anyideas?

Thanks

EDIT: Forgot to mention that my ubuntu machine is able to see and access the share folders on my 2 windows machines

And again, thanks in advance

DDM
September 28th, 2006, 11:38 AM
This HOWTO worked great, I finally have my network up and running again. Plus, network printing to my printer connected to my ubuntu box worked without any effort on the linux side. I keep forgetting about how annoying it is to hand-install drivers in Windows.

beast2k
September 28th, 2006, 08:00 PM
Nice how-to, I just followed it and it works great thanks for posting. It's alot easier to understand than alot of other samba how-to's.

dmizer
September 29th, 2006, 03:06 AM
But if you mount the shares on your Linux box, can you not also share those mounts?

meaning, from your linux box, you mount your windows shares:

/mnt/windowsXP_box1
/mnt/windowsXP_box2
/mnt/windowsXP_box3
etc.

Then can you share those mounts? so from the XP machiens, you connect to the Linux box and see the shares?

Like I said, I haven't tried this, but it kinda makes sense in theory.

Any linux guru's out there know if this will work?

--kp

just to clarify, what i think you mean is this.
linux sambashare is mounted by one single xp box.
that xp box shares the samba share and the next xp box doesn't mount the linux share directly but indirectly through the first xp box.

ie ... where windows shares a mounted linux share.

this can not be done. windows can't share a share. with the given configuration, each box will be able to see the others shares, but none will be able to see the other's mounted shares.

it's just not possible in windows. don't think it's possible in linux either.

rabbit69ca
September 29th, 2006, 03:06 PM
Never mind guys,a friend of mine helped me out, thanks anyway tho.

I got it working

It was a problem in my smb.conf file

so I used his and presto.

parradux
October 1st, 2006, 11:31 PM
Alright this guide was great, but i'am having a few problems.

I have gotten to the point where I have to map my network drive. However, when I put \\xxx\\xxx into the folder space windows tells me it cannot connect.

How do I fix this problem?

Also I have another question, through using this, how can I access my other shared folders on Windows so I can go back and forth.

dmizer
October 2nd, 2006, 01:54 PM
However, when I put \\xxx\\xxx into the folder space windows tells me it cannot connect.

it should be \\servername\foldername ... before the server name is two backslashes, and after the server name is only one.

parradux
October 2nd, 2006, 10:39 PM
Ok i'am going to be a little more specific:
And a little more background info: My account name/password is on windows is different then on my laptop. I think this may be a problem from reading some of the forum posts. So how do I fix this?


smbclient -L localhost -U% gives me:

Domain=[HOME SERVER] OS=[Unix] Server=[Samba 3.0.22]

Sharename Type Comment
--------- ---- -------
print$ Disk
MyFiles Disk
IPC$ IPC IPC Service ()
ADMIN$ IPC IPC Service ()
Domain=[HOME SERVER] OS=[Unix] Server=[Samba 3.0.22]

Server Comment
--------- -------
BORIS-LAPTOP
NESIC-SERVER

Workgroup Master
--------- -------
HOME SERVER BORIS-LAPTOP


My smb.conf is:

[global]
; General server settings
netbios name = boris-laptop
server string =
workgroup = HOME SERVER
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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /home/samba
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = boris
force group = boris

lbarosi
October 2nd, 2006, 11:22 PM
Hi,


Everithing worked fine. Getting Windows XP to see the network is a little bit har but samba documentation linked helped a lot.

However, I still have some problems:

Connecting from XP works fine. There are two users and They are correctly set up.

Connection from Ubuntu, only one user password works! I probably did sometthing wrong, but I can't figure what could be.

I have two computer XP/Ubuntu and I'm trying to set a network all transparent whatever OS they are running. Which means I'd like to have a sambafs in fstab, but I wouldn't like to type in my password in fstab. Windows files are really public, I only need to enforce privacy on the linux side.

Thanks for any help.

DDM
October 3rd, 2006, 01:19 PM
I've had this setup, and it works beautifully. However, I have two problems with my setup, which has a laptop running XP and connected with a wireless card to a router, which connects to my Ubuntu desktop which has the printer attached.

1) Printing is flaky. Once the print command is issued on the laptop, the print menu takes about a minute to show up. Sometimes, it just doesn't work whatsoever.

2) File transfers are very slow; maybe 50K/sec. If I transfer a file over the same connection with apache or a ftp server, I get full 802.11g speeds.

dannyboy79
October 3rd, 2006, 02:07 PM
lbarosi=if you are worried about adding a windows share to your fstab and not wanting to put in your username and password just use a credentials file and make it only openable by root. check this site out, it has helped everyone I have ever told about it.
http://www.justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html
DDM, are you atalking about when you transfer files and you sitting at your winxp box? or when you are sitting at your linux box. then if you're at windows, are you going thru network neighborhood or are you mapping a network drive. i noticed things go faster when you map and a network drive. also, ftp is always gonna be faster, it's a totally different protocol! maybe there is an answer here:
http://www.gatago.com/linux/samba/19227375.html

i personally use ftp when i need to transfer movies or xbox games, if it's just a small file or whatever than i use smb. i sometimes even use ssh.

Skaurecircle
October 4th, 2006, 09:39 AM
Followed the instructions at the start of this thread and Samba is working fine, I am able to browse the XP box and pull files into Ubuntu. My question is this, while I was following the instructions I got to a piont when I kept getting an error message ( Please look below). Its at the piont when you have tp put in your username with a password, Strormbringer recommends the one i used at installation which I did, howver I get the error message, thing is Samba works fine regardless, should I be worried or just write it off to good luck?

Error Message:

garth@garth-desktop:~$ sudo smbpasswd -L -a your_username
Password:
New SMB password:
Retype new SMB password:
Failed to initialise SAM_ACCOUNT for user your_username. Does this user exist in the UNIX password database ?
Failed to modify password entry for user your_username

dannyboy79
October 4th, 2006, 12:53 PM
it's telling you that whatever username you're trying to add to your smb database is NOT a linux user on the machine. since smb refers to the same database that linux uses for it's users, then in order to add a smb user you need to have already added that same user to your linux box. you can either use the gui within system, admin, users and groups or i think from the terminal it's adduser 'username'. what i find weird is that you state that samba is already working for you. why are you trying to add more users than. after I re-read your post, something is totally wrong here. there would be no way that samba would be working fine if you were unsuccessfull in adding your username to smb if your smb.conf has passwd backend=tbdsam ( i think that's what it is) also, are you using security=user or share. if you are using share than it might be working because then you're not using authentification for your file sharing and ANYONE on your lan can access see files. i am curious, are you saying that you are able to VIEW your winxp box thru nautilus and also view the shares on it. if so, please post your smb.conf. thanx. this is one thing that just will not work for me. do you have the windows xp guest account activated? thank you for posting if you do, you could help me and I can maybe help you, if you need that is.

sKuarecircle
October 4th, 2006, 01:32 PM
cooll I have no probs with that, but you got to let me know where to get, and how to get the smb.conf file.

sKuarecircle
October 4th, 2006, 02:00 PM
Nevermind dumb question, as far as the seeing other Xp Boxes on my lan, I there is only one other one, and if i go to plase, network servers i am able to browse it with no password requests.

Here is my smb.conf file:

[global]
; General server settings
netbios name = garth
server string =
workgroup = 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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /home/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = garth
force group = garth

Please offer your opinoion because I would rather have it done the right way

pcpat67
October 5th, 2006, 11:13 PM
When I enter:
sudo gedit /etc/samba/smb.conf
I get:
sudo: gedit: command not found
I also navigated to the file in the file manager and tried to edit it by opening the file from there and saving it, but it wouldn't let me save the changes. It popped up an error box that said "Can't open file to write"
What can I do?

ImpelGD
October 10th, 2006, 12:15 PM
Thanks Stormbringer - just what I needed! :KS

when I try to map a drive to it, it says (after a few seconds attemping to connect)

"The mapped network drive could not be created because the following error has occured: An extended error has occurred."

The resolution to that problem may have already been posted (I haven't read all 18 pages), but I also got that unhelpful message when I'd used my Windows username instead of my Ubuntu username in the Samba config file.

When I enter:
sudo gedit /etc/samba/smb.conf
I get:
sudo: gedit: command not found
I also navigated to the file in the file manager and tried to edit it by opening the file from there and saving it, but it wouldn't let me save the changes. It popped up an error box that said "Can't open file to write"
What can I do?

I'm no expert, but perhaps you haven't created the smb.conf file successfully? Try repeating the 'touch' command to create the file first.

jamesr
October 10th, 2006, 03:56 PM
Hi,


Code:

sudo: gedit: command not found



That is the command is not running are you running Ubuntu or Kubuntu or you could do the following

Open a terminal window and then
sudo nano /etc/samba/smb.conf

dannyboy79
October 11th, 2006, 08:02 AM
Thanks Stormbringer - just what I needed! :KS



The resolution to that problem may have already been posted (I haven't read all 18 pages), but I also got that unhelpful message when I'd used my Windows username instead of my Ubuntu username in the Samba config file.



I'm no expert, but perhaps you haven't created the smb.conf file successfully? Try repeating the 'touch' command to create the file first.

If it says COMMAND not found, that has nothing to do with the FILE, it is saying that it can't find the command. This would only occur if he is using Xubuntu or Kubuntu because those both come with different text editors. Gedit is Gnome's editor. So you can either use nano with is in most linux distributions or you mousepad if you have Xubuntu I think kate is for Kubuntu.

dannyboy79
October 11th, 2006, 08:03 AM
Nevermind dumb question, as far as the seeing other Xp Boxes on my lan, I there is only one other one, and if i go to plase, network servers i am able to browse it with no password requests.

Here is my smb.conf file:

[global]
; General server settings
netbios name = garth
server string =
workgroup = 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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /home/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = garth
force group = garth

Please offer your opinoion because I would rather have it done the right way

You're not being asked for a password because you have null passwords = true.

EssGee
October 11th, 2006, 08:37 PM
Thank you for this very well written and easy to follow How-To. I now have Samba up and running perfectly well for my needs.

From my experience, I offer a couple of points that may help others.

1) Specifying your workgroup. The method suggested is:
....To find out the Workgroup name in Windows follow these steps:

- Click "START"
- Click "Control Panel"
- Click "System"
- Click the 2nd Tab entitled "Computername" and find the name of the Workgroup there.

Example:

workgroup = MSHOME

Case matters when it comes to specifying your workgroup name in your smb.conf file. I would suggest that you check it against "My Network Places-Microsoft Windows Network" in Windows explorer and enter it exactly as shown there. In my case, Windows XP would not pick up my Linux box until I changed the entry "MYNETWORK" (shown in Contol Panel-System-Computername) to "Mynetwork" (shown in Windows Explorer).

2) Share Name
...-> [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!

-> path = /media/samba/
To reiterate, the share name in this case is "MyFiles" not " /media/samba/". So when you map your share on DAPPER (your NETBIOS name, for example) on your Windows machine/s, you would specify:
//DAPPER/MyFiles
not
//DAPPER/media/samba

Thanks again, Stormbringer for an extremely useful document.

FoggyMtn
October 13th, 2006, 08:55 PM
http://ubuntuforums.org/images/smilies/icon_biggrin.gif
:D


WHOOO HOOO!!!!!! Thank you!!!!!!!!!!!!!! I have been trying to get samba going for ages. I tried all of those other tutorials and couldn't get squat! With yours, I was up and running in 30 minutes!! Unbelievable!!!!!!!!!!!!!!!!!!!!


foggy

dannyboy79
October 15th, 2006, 10:28 AM
Thank yiou very much for this guide. it helped me setup my network of xbox's, winxp, ubuntu, and xubuntu laptop. I am curious though, you tell people to use these 2 things
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast
but you don't tell them how to set these up. DOn't people have to create a hosts file and put in there hosts? like 192.168.0.2 UBUNTU & 192.168.0.3 WINXP where the ip is the ip of the machine and the name is the hostname? I thought ubuntu only comes with a host file not hosts? Also, the smbusers file I thought was to map WINXP user names to your ubuntu usernames? like my username.map file is actually named that not smbusers also, within it would be for example: daniel = Judy Klimp which means that user on WINXP Judy Klimp is mapped to user daniel on my Ubuntu box. Am I correct on both of these things? if so, you should really add this to you howto. If I am wrong, could you maybe explain why? Thanks again as this guide along with what else I have setup has made my network great. also, a question. what does the null passwords = true mean? cause I don't want people without a password to be able to get at my shares! should i turn this off? one more thing, if someone is setting up an additional samba computer like i am using xubuntu i can't have both computers say wins support = yes because they both can't be the wins server so I had to change my xubuntu box to say, wins server = 192.168.0.3 which is the ip of the ubuntu box. am i correct with this. i hope so because it is working. oh, one other thing ha, wouldn't i want to use the valid users = $S for the share that I created if I don't want any other users to be able to use it? thanks again for the last time. ha ha

Moeru
October 16th, 2006, 12:55 PM
I'm considering redoing my file server to Linux. My only concern is my fellow users in my apartment (2x WinXP boxes) writing to the File Server and causing an error. I know NTFS was a tad shaky in the past but I'm not sure to go about this in Samba if they need to drop stuff on the file server

Beamvr6
October 16th, 2006, 09:13 PM
Many thanks for this guide stormbringer!

Some irony is that my employer installed XP still refuses to map the networkdrive although it does see the Shared folder and the printer connected to the Ubuntu box while the Gnome file browser can work with all shared files on the XP notebook. Although this works pretty OK for me I was wondering if having shared folders on the XP thingie might interfere with mapping the network drive?

TIA from a very happy Ubuntu user.

ebutton
October 17th, 2006, 07:34 PM
Thank you very much!

Your info worked perfectly. I am now able to run XP and Win2k backups to a mapped drive on my ubuntu box. Very sweet.

Good Fortune To You.

EdB

pooslinger
October 21st, 2006, 01:24 AM
I have WinXP and Win98se working through VMware accessing the same folder using SAMBA. If this works please update the main post.


I followed the original guide except I used "wins support = no"
__________________________________________________ ______________

How to: Fix Win98 "Incorrect Password" prompt when mapping drive.

1. In Win98:

Primary Network Login -> Client for MS Networks.

You will have to input a user/password on start up when you do this.

*Remember this password/username!!!


2. ^ Use the user/pass from above and make/activate an account. Case sensitive.

sudo useradd -s /bin/true "Win98 usernames"
sudo smbpasswd -L -a "Win98 username"
sudo smbpasswd -L -e "Win98 username"

3. Map network drive in Win98.

You can now access SAMBA shares through Win98.



Extra things that might have to be done before hand: I did them but I don't know if they are needed.

1. sudo /etc/init.d/samba stop

sudo gedit /etc/samba/smb.conf

Add the following to your [global] section

encrypt passwords = yes

sudo /etc/init.d/samba start

2. In Win98:
HKEY_LOCAL_MACHINE\System\Current\ControlSet\Servi ces\VxD\VNETSUP\

Select Edit->New->DWORD value from the mnu bar. Rename the entry
"new value #1" to "EnablePlainTextPassword". Set its value to 1.

3. Install Win98 unofficial service pack:

http://exuberant.ms11.net/98sesp.html

brash
October 21st, 2006, 03:53 PM
My grateful thanks to the original poster -- while I skipped over everything except the very first post, and admittedly didn't understand much of that, I now finally am able to access a shared fat32 partition and to trasnsfer files back and forth with the windows xp computers on our home network :)

(you can't imagine my relief when the IP/DHCP/WINS details turned out to be something I could safely ignore ... as a first-day Ubuntu user, I was just grateful I could handle copy-pasting the proper lines into the terminal.)

Thanks, you are a real sweetheart for doing this.

Schlupp
October 25th, 2006, 01:25 PM
Hello! First thanks a lot for this very good documentation....
I did all the stuff u proposed and it worked quite well (even one other pc (winxp) didnt enable "wins".
The problem ist now, that the connection is VERY "instable". Some times I found the other pcs in the network (including my one) sometimes not, sometimes I can only see the workgroup but not the pcs in it. Some times it works after some minutes/an hour without restarting samba or anything like this.
And some minutes ago I could find the other pcs in one network-window, but not in another, after closing both, I couldnt see the other pcs anymore....
I dont know what to do....some times it works perfectly, sometimes not....
Anyone now this problem, could help me out, what could be wrong??
thanks a lot for help!!

Schlupp

christhemonkey
October 25th, 2006, 01:32 PM
Good guide,

One suggestion, after people have made their changes to their smb.conf,
maybe you should make sure they run `sudo testparm` to check they didnt make an error?

Just my £0.02

stig
October 27th, 2006, 07:35 AM
Wow...I happened to look in Ubuntu Cafe and saw that Stormbringer's thread is now 20 (twenty!) pages long and nearly 50,000 people have viewed it.

Stormbringer's thread helped me when it was only a few long and I just want to say that he's doing a greaaaat job!

Thanks Stormbringer!:p

ric_spam
October 27th, 2006, 07:08 PM
I did a search of the forums and found some posts asking questions, so I might suggest a follow up HOWTO -- SWAT
- install, configure and then how to manage Samba via SWAT.

TIA

the_original_bluefish
October 27th, 2006, 08:12 PM
If you want to hook your printer to your Ubuntu-Box and share it for the client on the LAN you need to install the Printer in CUPS first (in Gnome: "System" -> "Administration" -> "Printing") - there's no way around.

As soon as you installed your printer restart samba so that the newly added printer gets recognized for sure.

To add the printer to your Windows client you may either use the Network Neighborhood (browse to your Ubuntu Box, open the "Printers" Folder, right-click your printer and select "Connect") or the Add Printer Wizard in the Control Panel.

In both cases Windows will ask you to provide a driver for your printer in case it isn't directly supported by Windows. Install the driver and your're done.

The spool-file of Windows will be sent to Samba and forwarded to the appropriate CUPS-spool. If the job is already in the fitting native printer-language (PCL, PostScript, whatever) it will be put into the queue without further pre-processing and finally be printed.

In case the spool-file mismatches with the capabilities of the CUPS driver the job WILL be pre-processed to make it fit.

In the end it's CUPS that's handling your printer - not Windows or one of it's drivers.

If you have doubts you may also hook the printer to one of your Windows clients and setup a shared printer there ... in case the Windows-driver will output better quality.

-Storm

Storm, thanks a million for your post. Ubuntu ought to include your simple setup as part of it's distro for samba as an example. Example files would probably provide a ton of help for us budding ubuntu users.

Just an FYI for anybody reading... I encountered a problem with windows connecting to the printer. I would get an 'Access Denied, unable to connect' status on the printer.

To fix this problem, I did the following:
1. chmod -R 777 /var/lib/samba/printers
2. Edit /etc/samba/smb.conf and added the line 'use client driver = Yes' to the [Printers] section
3. Edit /etc/cups/mime.convs and ensured that the application/octet-stream line is uncommented
4. Edit /etc/cups/mime.types and ensured that the application/octet-stream line is uncommented
5. Restarted CUPS and samba

It would appear that others were having this problem... and I found the fixes at
- http://www.linuxquestions.org/questions/showthread.php?t=322874
- http://lists.freebsd.org/pipermail/freebsd-questions/2004-January/030676.html
- http://jmatrix.net/dao/case/case.jsp?case=7F000001-17918F0-10C13CE7D87-C4

This might save some people some time. It looks like the 'use client driver = Yes' is required for windows clients (not mac) and that uncommenting the mime types is required since the windows driver sends the raw content to be dumped on the printer... so uncommenting those lines enables CUPS to hand that kind of content appropriately.

Cheers

wilberfan
October 28th, 2006, 12:23 PM
[ I just realized that this thread (http://ubuntuforums.org/showthread.php?t=286528) is the same issue I'm having ]

GREAT post, I must say...

This has allowed to get samba running on Dapper (over and over!)--but I've just installed Edgy, and I can't see my Windows XP box...

The XP box sees the Ubuntu box almost immediately (very peppy), but when I open the Network Server window in my Edgy box, it takes rather a long time (20 or 30 seconds) before it shows the "Windows Network" icon. When I open that, all I get is a 'desktop configuration file' called "Home"...

I've checked that my Windows XP firewall is off (that was the problem the LAST time I couldn't see the XP box!). Is my smb.conf file OK?

[global]
; General server settings
netbios name = DELL-Ubuntu
server string =
workgroup = HOME
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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
[homes]
valid users = %S
create mode = 0600
directory mode = 0755
browseable = no
read only = no
veto files = /*.{*}/.*/mail/bin/

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /home/me/share/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = me
force group = me


Anyone have any thoughts?

cor2y
October 28th, 2006, 03:49 PM
Can someone tell me how to get Samba working with Vmware.
I've tried setting up as the guide pointed out. On wireless networks and wired lan it works but when it comes to setting a virtual machine , the virtual machine doesn't pickup the samba partiton.
Although the user ahs been added as well as the group.
Tried both NAT and bridged connection in VMware
Can someone help?

fatsheep
October 28th, 2006, 10:32 PM
Thanks for the great guide. However I don't really like how the Windows user (in this case my family) has to enter *MY* username and password so I created a dummy account that matches the windows username and password and set that up instead.

Juzz
October 29th, 2006, 03:00 PM
I've followed the howto I even created the file that was supposed to contain the user mapping for samba, but all to no avail.
Neither me or my wife can access the shares.

When I try to connect to my samba server on ubuntu linux using smbclient:

veggerby@Juzzlaptop:~$ smbclient //192.168.1.10/musik
Password:
Domain=[MEDIECENTER] OS=[Unix] Server=[Samba 3.0.22]
tree connect failed: NT_STATUS_NO_SUCH_USER

My share looks like this:

[musik]
path = /mcenter/Music/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = ;mythtv,veggerby,benthe
force group = ;mythtv
I've only just added the ";" trying to comment out the users and group to see if that would help anything.

My Globals section looks like this:

[global]
; General server settings
netbios name = MEDIECENTER
server string =
workgroup = DV-CREW
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

I've tried to create the file in the "username map" line "sudo touch /etc/samba/smbusers", and recreate the users, but that has had no effect - the file is still 0 bytes and with nothing in it.

I've ensured that I am in the same workgroup as my samba server (in case you noticed - my media center).

Can anybody see what is going wrong here?

We really want to get those shares up and running.

JawsThemeSwimming428
October 30th, 2006, 06:00 PM
I just went through the walkthrough and I still can not get my Ubuntu machine to share with my Windows machine. I think I followed all of the instructions pretty closely and I'm not quite sure what the problem is. When I go to map the network drive in Windows I type in \\the correct name\Ubuntu and then it comes up with the path could not be found. What should I do now?

navlelo
November 1st, 2006, 03:09 PM
Great Howto! I had some problems on Edgy, but when I went back to Dapper, the Samba configuration was quick and easy, and almost problem free. I have two remaining problems and a question that I haven't managed to solve by myself:

Problem 1:
This is probably a Windows Xp issue. On my main XP account (with admin rights) I can not log in to my Ubuntu box automaticly. The mounted network drives give an error message every time I log on to the account. Another account on the same XP box logs in automaticly without any problems. I have checked many times that the user name and password are exactly the same in XP and Ubuntu/Samba.

Problem 2:
Guests can not browse my shared folder although I have set "guest ok = yes". I can not see what folders the server has without logging in with a user account that is registered in Ubuntu/Samba.

Question:
My computer is almost always on, and my guests frequently use it for browsing the Internet or my media files. They have full access to all my personal files because I don't feel it is natural or polite to make them log on as a different user. Is there a way to make an area on my network drive that is protected by an extra password prompt when I'm already logged in?

I could of course make an additional, extra private, user account on both the XP and the server, but I won't bother to log on to a different account just to add a number in a spreadsheet or something like that.

I hope someone has one or more answers for me!

ImpelGD
November 1st, 2006, 07:02 PM
Is there a way to make an area on my network drive that is protected by an extra password prompt when I'm already logged in?
I believe you could add another share with any username and password of your choosing. When you wish to access it with XP, use the 'connect as different user' option (or similar) and use your chosen details. Uncheck remember/automatically log on.

navlelo
November 2nd, 2006, 02:06 PM
I believe you could add another share with any username and password of your choosing. When you wish to access it with XP, use the 'connect as different user' option (or similar) and use your chosen details. Uncheck remember/automatically log on.
Thank you for the suggestion, but it doesn't work. If I try to log on a different folder on the same server with a different username, I get the error (translated by me from Norwegian): "More than one connection from the same user to a server or shared resource, by the help of more than one username, is not allowed. Disconnect all previous connections to the server or shared resource, and try again." I don't know if there is a way to change this limitation on the Windows side, at least I haven't found it.

As long as I am logged in to a folder on the server, I can access all other folders available to that user without being prompted for a password. The closest thing I've got now is a folder that isn't browsable, and therefore can only be accessed by typing the correct folder name. While it is better than nothing, it's neither practical nor completely safe.

I am still hoping there is a setting in Samba that forces a new login for a resource, and I still have no solution to the two other problems in the post above.

linuxguiri
November 3rd, 2006, 02:47 AM
Great howto! It would be great if you posted this on the wiki. The one that's already posted there as well as the official help guide are way over my head (and probably a lot of other users).

For the benefit of others who might have the same problem:
I ran into this error when I attempted to access the share from WinXP:
"\\linuxhostname is not accessible. You might not have permission to use..."

Apparently the solution is to open some specific ports on the ubuntu firewall. As I didn't know how to do this, I just temporarily disabled the ubuntu firewall via Firestarter. If anyone knows which ports and how to open them up, please let me know.

dannyboy79
November 10th, 2006, 05:32 PM
For the benefit of others who might have the same problem:
I ran into this error when I attempted to access the share from WinXP:
"\\linuxhostname is not accessible. You might not have permission to use..."
You are missing the share name, so if you were sharing a folder on your linuxhostname computer called dave, then in winbloz, you type in \\linuxhostname\dave. keep in mind that the user you logged in with in winbloz should be the same user and password that you did the smbpasswd -a username command.

Apparently the solution is to open some specific ports on the ubuntu firewall. As I didn't know how to do this, I just temporarily disabled the ubuntu firewall via Firestarter. If anyone knows which ports and how to open them up, please let me know.
You may be decieving others on accident, Ubuntu has a firewall installed by default (iptables) but does NOT have any rules enabled by default. So that means that there are NO PORTS being blocked going in or going out after a fresh install of ubuntu desktop version. (not sure about the lamp version or server versions) Your problem sounds weird as you say it works when you turn the firewall off, this must be because you enabled rules by default. The ports that you want to add if you'd like are netbios-ns 137/tcp # NetBIOS Name Service
netbios-ns 137/udp
netbios-dgm 138/tcp # NetBIOS Datagram Service
netbios-dgm 138/udp
netbios-ssn 139/tcp # NetBIOS Session Service
netbios-ssn 139/udp
microsoft-ds 445/tcp # Microsoft Directory Service
microsoft-ds 445/udp
which is documented here: http://troy.jdmz.net/samba/fw/ but I don't believe that's your issue unless you did previously set up your firewall.

zaziork
November 18th, 2006, 04:17 PM
Please start up VMware, open a command prompt, and type:

ipconfig /all

Please post the output into a reply (or PM me if it's a public IP address).



Firstly, thank you, Stormbringer, for the HowTo. Very much appreciate it.

May I ask either "Core" or yourself: In general terms, what was the resolution to the "an extended error has occured" error, about which you corresponded in private? I'm having exactly the same problem...

TIA.

lime4x4
November 20th, 2006, 04:46 PM
ok i followed the guide i can browse my other hard drives that are on another ubuntu box but it will not let me write to the drives here is a copy of my file that pertains to my shares
[MyFiles]
path = /media
browseable = yes
read only = yes
guest ok = yes
create mask = 0644
directory mask = 0755
force user = mythtv
force group = mythtv

i'm i correct in assuming i also need to add

write=yes

themikeflynn
November 21st, 2006, 08:30 PM
"The drive could not be mapped because no network was found."

I get this error after following the guide. Windows won't recognize the network. When i go to "My Network Places >> Entire Network >> Microsoft Windows Network" everything starts getting slow, as if it realizes something is there, but it won't go through. The connection is fine; I've had no trouble accessing my LAMP server that I have set up. But I just can't get this filesharing via Samba to work out.

Any advice?

adamkane
November 21st, 2006, 08:38 PM
The HOWTO is a wee-bit over-long. Here's how you do it:

Install samba-common.


sudo apt-get install samba-common


Right-click folder you want to share.

Enable the folder for sharing.

Add a Samba user:


sudo smbpasswd -a system_username
gksudo gedit /etc/samba/smbusers
Insert the following line into the new file


system_username = "network username"
Save the edited file

To delete network user:


sudo smbpasswd -x system_username
Done.

Kulgan
November 25th, 2006, 02:40 PM
Unless you want to be able to browse stuff on your Windows computer. That takes a little more.

I had it working fine with the original tut, but now for some reason I can't get to the shared folders in Windows. I find that really strange, as I can print to the printer on the same machine. I went to Places -> Network Servers -> Windows Network -> mshome -> DESKTOP, and got all the files from Windows. Now all I have is

Sorry, couldn't display all the contents of "Windows Network: mshome".

When I open "mshome". Odd, and I have no idea what is wrong. I can still get to the Ubuntu shared files from the Windows computer.

Any ideas?

-K

dmizer
November 28th, 2006, 08:53 AM
@kulgan ...

see the second link in my sig for mounting windows shares from ubuntu.

Kulgan
November 28th, 2006, 02:14 PM
great article, I'll try that as soon as I have finished my homework... :D

In the bit where you add "wins" to the hosts: line, I have "hosts: files dns mdns". does that matter?

featherking
November 28th, 2006, 02:22 PM
that shouldnt matter, you are just adding wins resolution to your hosts file in addition to those others

keithnorris
November 29th, 2006, 12:32 PM
:)
Thanks for a great resource. No questions. No problems. Just: Thanks.

gvsrinivasan
December 3rd, 2006, 07:27 AM
the samba guide was good ,
i want to know how can i share an internet connection available on windows xp on one system with another one having kubuntu dapper drake in it through samba or by any other possible way

i urgently need internet connection in kubuntu to carry out my day today works on it

Kulgan
December 3rd, 2006, 08:47 AM
are you talking of using the windows machine as a "router"? Like, the connection itself goes through the windows machine before into the wall or whatever?

guetrochide
December 3rd, 2006, 09:06 AM
thank you for the topic. (http://launch.groups.yahoo.com/group/DeMoNTeAM/messages/1001?viscount=100). (http://launch.groups.yahoo.com/group/DeMoNTeAM/messages/1001?viscount=100)

gvsrinivasan
December 3rd, 2006, 10:00 AM
i am having an adsl broadband connection in my amd semperon machine running windows xp and want to share it with another Intel celeron machine which has kubuntu dapper drake in it ,i want the internet connection on windows xp machine to be shared with kubuntu through any other means of achieving it so if u don't mind a router means the connection pass through windows xp before coming on to Ubuntu , if i am wrong ,then forgive me ,i am completely new to networking

Kulgan
December 3rd, 2006, 10:41 AM
The best solution for this is to just get a router. They are not that expensive, and quite easy to set up - a lot will get you free help setting up and such. See the image (http://ubuntuforums.org/attachment.php?attachmentid=20430&d=1165156794) for the difference... The router just spits the internet connection, rather than having to set up the windows machine to do it. It also means that you can expand the network...l

gvsrinivasan
December 3rd, 2006, 10:59 AM
thanks for the reply and clarification about the router, i am living in India and a router costs up to 85$ here ,so it will be good if it is possible in my current setup to achieve the internet connection sharing through crossover cables and samba is working through it only and through any software to do the internet connection sharing on Linux ,
again thanks for the reply

Kulgan
December 3rd, 2006, 12:04 PM
so you want the connection to go through the windows machine - so then you would need software for windows rather than linux. As far as I know, you would just connect to the windows machine as if it was a gateway, but you will most likely have set the windows machine up with all sorts of security settings first - windows is a little odd about that :/

I reccomend you start a new thread in the Networking section of the Forums - the mods probably like keeping things nice and tidy...

gvsrinivasan
December 3rd, 2006, 07:49 PM
ok .so i can use the windows machine as a gateway for connecting internet on Linux, it will be good if u cover some good software packages available for samba as a second part in the samba how-to guide ,u can also distribute it as a pdf file ,i will be happy if next version of Ubuntu
comes preloaded with samba installed instead of samba-common in it, thanks for patiently clarifying my various doubts on internet connection sharing

Kulgan
December 4th, 2006, 12:49 PM
All I know is that it should be POSSIBLE - and that's pretty much it. I'm sure you will get help in your new post :D

madscientist
December 4th, 2006, 06:11 PM
Hi all. I've been reading Samba howtos etc. until my eyes bleed :). None of them seem to address what I want to do, or if they do I can't see it.

I have a (small office) network which is run by Windows people using Active Directory and all that stuff. I have my little Ubuntu system sitting on my desktop. So far I am able to mount shares and all that stuff, so I have no problems there.

What I can't seem to do is publish my system's hostname so that any other systems can resolve it!

Our Windows systems use static IP, not DHCP, and apparently there's some checkbox in the Windows network config that tells it to publish its hostname. I have a static IP for my Linux box too, but I don't know how to get my Linux box's hostname to be published. The Windows admin guys do NOT set up the hostname statically (apparently): the client pushes it somehow.

I don't want to be any sort of server: my system must be 100% client. I can't be a WINS server, or NMBD server, or Samba server, etc. (I only have a vague understanding of what those are anyway).

Is there some way I can configure Samba, or something else, to publish my hostname to a Windows environment (I assume using AD)? If someone could even point to which part of Samba might be used to do such a thing I would appreciate it.

Thanks for any tips or pointers!

trietgiang
December 5th, 2006, 06:23 AM
Thank you so much for this guide. I had all working fine in the first attempt.

Just two questions please:

1) In the smb.conf file, there is a line:
username map = /etc/samba/smbusers
I checked in /etc/samba, there is not a "smbusers" directory. Is this normal?

2) I had this line in the last part of the conf file:
path = /home/samba/
Does it mean that all users connecting to this Linux will share this directory? Should individual directory is created per username? If no, how do I do that? Say I have 10 Windows users, I can create their accounts in Linux, how should I modify the smb.conf file to make individual's directories?

Thank you for your time, and keep up the great work.
Best regards,
Triet

Kulgan
December 5th, 2006, 11:27 AM
madscientist:
I'm afraid I know nothing about Active Directory (though I may use it unknowingly :-k ), and don't know much about static setups, either. Is is a workgroup or domain? What exactly are you trying to accomplish - if you don't want to have a samba server, then you don't want to host data, in which case there is no problem, is there?

madscientist
December 5th, 2006, 12:03 PM
madscientist:
I'm afraid I know nothing about Active Directory (though I may use it unknowingly :-k ), and don't know much about static setups, either. Is is a workgroup or domain? What exactly are you trying to accomplish - if you don't want to have a samba server, then you don't want to host data, in which case there is no problem, is there?I'm not sure I know the difference between a workgroup and a domain: there is a workgroup name on the windows systems that I need to use. I can mount shares using smbfs without a workgroup name though.

I need for people to be able to resolve my hostname. For example, if they have putty on their system I want them to be able to "ssh myhost" where "myhost" is my linux box, and have it work. I also plan on hosting some services such as a web browser, etc. on my box.

In the Linux/UNIX world, which is where I'm from, that would involve either (a) pushing the hostname in the DHCP response, for dynamic IP, or (b) hard-coding the hostname/IP into the local DNS system. For Windows there appears to be some way of doing a combination: the IP address is statically configured, but the hostname is not specified on the server. Somehow the client pushes its hostname, then the hostname is available through normal DNS requests (like, I can use "host windowsbox" on my Linux system and have it resolve "windowsbox" to an IP address, where "windowsbox" is a Windows system using this method of "pushing" hostnames.

Does this make any sense? Anyone have any idea what I'm referring to? I'm afraid that while I have an embarrassing number of years experience with all things UNIX, I know virtually nothing about Windows, especially Windows servers and services.

Kulgan
December 5th, 2006, 12:06 PM
I'm afraid that I can't - wish you luck finding help, though! Don't give up ;)

BabyUbuntu
December 6th, 2006, 02:45 PM
hi all....

i want to ask someting.. maybe its stupid question but its important for me

i have server mp3 ( ubuntu ) and 5 window clients + 1 laptop ubuntu
my problems are..
1. when i try to connect ubuntu from xp..have to login first. the question is.. how to connect ubuntu ( samba ) without login prompt?
2. if i playing my laptop(ubuntu) and i wanna playing mp3 from XP.. i've to copy to my local disk first.. my question is.. how to playing mp3 from xp without copy file first?

em sorry...my knowlagde bout linux very low.. i really need ur help

Kulgan
December 6th, 2006, 02:54 PM
what stops you from playing mp3s right from the XP computer?

BabyUbuntu
December 6th, 2006, 03:24 PM
lemme explain my condition
when i'm using ubuntu and i want to playing mp3s on my XP,, i have to copy mp3 files from XP to ubuntu first.. i cant playing mp3s on my XP via local area network.. how to playing mp3 from via LAN without copy file first on my ubuntu? (ubuntu as client and XP as mp3 server)

Kulgan
December 6th, 2006, 04:00 PM
If you go to Places -> Network Servers -> Windows Network -> <WORKGROUP> -> <HOSTNAME> -> Wherever you keep the files, you should be able to play them. Even if you can't write, playing them should take no more permission than copying them...

mirzmaster
December 18th, 2006, 01:39 AM
I just wanted to toss in my 2 cents of appreciation and thank the author of this guide for their hard work into writing it up. This was the perfect guide to help me setup my Samba configuration!

Thanks, again!

broughcut
December 29th, 2006, 07:58 PM
ditto.

finally working. after 6 hrs trawling this thread and google for a solution to a "can not connect" error on the map drives step I had the sense to install file and printer sharing. Surprised Windows didn't prompt me for this during the home network wizard. Anyway, seems to be working great (Windows as a guest OS under VMware server).

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!

- Click "START"
- Click "Control Panel"
- Click "Network Connections"
- Find your "LAN Connection"
- Right-click the icon and select "Properties"


- make sure Client for Microsoft networks, and File and Printer Sharing for Microsoft Networks are both checked :rolleyes: :redface:

- Select the "TCP/IP" Protocol and click the "Properties" button
- Click "Advanced"
- Select the third Tab entitled "WINS"
- Click "Add"
- Type in the ip-address of your Linux box
- Click "Add"
- Select "Use NetBIOS over TCP/IP"
- Click "OK"
- Click "OK"
- Click "OK"
- Reboot Windows

jtwadsworth
December 30th, 2006, 05:10 PM
Great writeup! I have been struggling with this for a time and it is helping...still some problems though. With this writeup my WinXP machines on the LAN can see the Ubuntu shared folder just fine and visa versa. The problem is that once I click on the share through a WinXP box, I am asked for a login and pw and nothing works.

To be clear, I am sharing out an NTFS drive from Ubuntu to the rest of the LAN (either through IDE or USB connection, I've tried two different drives).

When trying to log in with smbclient to the shared drive I get the following:

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

My smb.conf share info is here:

[MyMusic]
path = /media/'WDC 300GB'/'My Music'
browseable = yes
read only = yes
guest ok = no
create mask = 0644
directory mask = 0755
force user = UNIX_ACCOUNT
force group = UNIX_GROUP

I tested the SAMBA sharing out my home folder and it worked just fine...is there some problem with sharing out an NTFS disk through Ubnutu?

jtw

mistypotato
January 2nd, 2007, 02:25 AM
Thanks Stormbringer!!!

You finally put me out of my Samba misery :KS :KS :KS

You post finally got Samba working for me so I'm posting the link to it again here

http://www.ubuntuforums.org/showthread.php?t=202605

AEngineer
January 2nd, 2007, 11:12 PM
I agree with all the other folks who've praised what you did. Many thanks.

Of course I'm here with a problem, one I couldn't find addressed in the many posts, although it may be.

I followed the tutorial and have my windows machine seeing what I called "server1". I can start the mount process with XP, but when I get to the connect dialog box it doesn't accept my
username and password. After it refuses plain "george" (username) It offers to try using the following "P390\george" as user name, where P390 is the machine name, but that doesn't work either.


- I've checked that the user name (and password) are identical on both machines - including case.
- I've restarted the windows machine

I'm baffled what to do next to track down why it won't accept the login that is the same on both my XP and ubuntu (6.10) machine.

Thanks for any help you can give

AEngineer
January 2nd, 2007, 11:23 PM
Oops.

I restarted Ubuntu, closing a dialog box in the process and now it works as it should. I shot too soon.

Thanks again anyway.

tagra123
January 3rd, 2007, 07:18 PM
Nautilus in dapper kept giving error messages unles you manually set up the network share via connect to seerver using an ipaddress.

I found a solution that actually works.

http://www.ubuntuforums.org/showpost.php?p=1960858&postcount=18

Cogito²
January 4th, 2007, 08:52 PM
HOWTO: Setup Samba peer-to-peer with Windows

....


Warning: I know/understand very little of linux/ubuntu.

I followed the tutorial and decided to simplify it by changing very little. I used DAPPER for the host name, MSHOME for the workgroup and /home/samba/ for the path. Everything seems to go fine except I just can't map the network drive. I tried using both wins and not using wins. When not using wins, I used "\\<ip-address>\home\samba\" or "\\<ip-address>\samba\" or "\\<ip-address>\home" etc., but it always give me "The network path ... could not be found." When using wins (I went back through the tutorial setting it up with wins from the beginning), I would try using "\\DAPPER\home\samba\" or other variations as before and it would still not be able to find the network path.

So I guess this is more of a windows question than anything, but can anyone see anything that I may obviously be doing wrong? Thanks in advance for any help.

(Note: I actually only want to network the computers once...after that I don't care. I have about 30 gigs i want to transfer off my linux box across the network to a windows box before reformatting it. I haven't yet been able to link them and so far the only other solutions (eg. ftp) leave me with a ~50 KBPS speed which would take about a week to transfer...meaning that I need to use the network so I can get the network speeds cutting the time down by a factor of a hundred or so. So if my above problem isn't easily solved, I'd definitely be willing to try another completely different networking solution so that I could get these files transfered.)

tagra123
January 4th, 2007, 09:20 PM
For a quick and dirty one time method of copy look at
scp

-- google for scp examples.



_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+ _+_+_+_+_

NFS is easier to get working than samba and on my network is 3 times faster.
On the Server (computer with the files)

sudo apt-get install nfs-kernel server
mkdir /home/sharedfolder


Share the folder -- right clicking on it will give you this option.

or you can edit the /etc/exports file and add a line like this

/home/username/sharedfolder 192.168.1.0/255.255.255.0(rw)


>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<
to access it from the remote computer

on the remote computer

sudo apt-get install nfs-kernel-server
sudo mkdir /mnt/nfsshare
sudo chmod 777 /mnt/nfsshare

mount -t nfs 192.168.1.XXX:/home/username/sharedfolder /mnt/nfsshare


Now you can use nautilus to drag and drop to your hearts content.

_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+ _+_+_+_+_

For samba you can look at my earlier post #240

http://www.ubuntuforums.org/showpost.php?p=1963941&postcount=240

Samba just seem broken since breezy. There is no way anyone can justify the time it takes to set it up correctly. I like ubuntu but it took some work to get the breezy samba to work with the dapper samba.

Cogito²
January 4th, 2007, 09:45 PM
Okay thanks for the info. I'm going to try the scp method first. I'm looking into winscp for my windows box and then I'm now trying to figure out what I'd need for the linux box. I need to transfer the files from my linux box to my windows box so I'd guess I'd need to make the linux box act like a server in a sense (correct me if I'm wrong). Anyway I'm going to fiddle around with that and see if I can get it working, but if you have any words of wisdom you'd like to add, then I'm all ears. Thanks a lot.

tagra123
January 4th, 2007, 10:02 PM
Okay thanks for the info. I'm going to try the scp method first. I'm looking into winscp for my windows box and then I'm now trying to figure out what I'd need for the linux box. I need to transfer the files from my linux box to my windows box so I'd guess I'd need to make the linux box act like a server in a sense (correct me if I'm wrong). Anyway I'm going to fiddle around with that and see if I can get it working, but if you have any words of wisdom you'd like to add, then I'm all ears. Thanks a lot.


If you alread have ubuntu installed on one pc than just put the live cd in the other and mount the windows partition -- you might have to read a couple of items from google on mounting ntfs partitions -- actually I think the live cd mounts it in the tmp folder with an odd looking name.

You can still use apt-get install blah blah blah on the live cd -- it just wont remember that you installed it because its using RAM.


Might ever be easier to remove the drive dfrom the windows computer -- hook it up to the ubuntu computer boot ubuntu, mount the windows partition on the drive you've just connected and copy away

Cogito²
January 4th, 2007, 10:25 PM
Yeah I just realized that just mounting the drive in linux may be the best bet (I tried mounting the linux drive in windows earlier, but that didn't work and I forgot to try the other way). I'm going to try that first and I think that even I can do this (or at least figure it out with the documentation and everything). Thanks for your help so far. Hopefully this does it.

edit: My latest questions have moved to this thread: http://www.ubuntuforums.org/showthread.php?t=331549&page=2&highlight=mount+ntfs in case you also happen to be knowledgeable in that respect. ;)

TheOtherLinuxFreak
January 5th, 2007, 05:04 PM
great how to. very helpful!! does any one know how to do internet connection sharing with ubuntu?

prepstyles
January 8th, 2007, 04:16 AM
Not sure if Stormbringer still monitors this thread but Cheers on the guide anyway!

I <ctrl>-f 'd through the previous pages and couldn't find anything related to my problem, so forgive me if this has been covered before...

So I followed the initial post and got samba shares setup on a XUbuntu box on my lan.
I have WIRED Linux and windows boxes that can access the shares on the samba box.
However I have WIRELESS windows boxes that cannot find the shares when I attempt to map them.
I have my router set for static ip 's.

Any thoughts on why it would work for wired clients but not wireless?

Cheers!

Kulgan
January 8th, 2007, 01:45 PM
at the bottom of the original post, there is some mention of that. You may have don something similar to that by accident. **** happens :p

SQNik
January 9th, 2007, 06:50 AM
I install Samba like in HOW to : http://www.ubuntuforums.o...highlight=samba

MY SMB.conf :


[global]
; General server settings
netbios name = serwer
server string =
workgroup = GELMONT
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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = sqnik
force group = sqnik

next

sudo smbclient -L localhost
Password:
Anonymous login successful
Domain=[GELMONT] OS=[Unix] Server=[Samba 3.0.14a-Ubuntu]

Sharename Type Comment
--------- ---- -------
print$ Disk
MyFiles Disk
IPC$ IPC IPC Service ()
ADMIN$ IPC IPC Service ()
Anonymous login successful
Domain=[GELMONT] OS=[Unix] Server=[Samba 3.0.14a-Ubuntu]

Server Comment
--------- -------

Workgroup Master
--------- -------


Why don't detect my Workgroup and Server ? Please help !!

Sorry for my english :P

TheOtherLinuxFreak
January 9th, 2007, 05:39 PM
I install Samba like in HOW to : http://www.ubuntuforums.o...highlight=samba

MY SMB.conf :


[global]
; General server settings
netbios name = serwer
server string =
workgroup = GELMONT
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

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[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

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = sqnik
force group = sqnik

next

sudo smbclient -L localhost
Password:
Anonymous login successful
Domain=[GELMONT] OS=[Unix] Server=[Samba 3.0.14a-Ubuntu]

Sharename Type Comment
--------- ---- -------
print$ Disk
MyFiles Disk
IPC$ IPC IPC Service ()
ADMIN$ IPC IPC Service ()
Anonymous login successful
Domain=[GELMONT] OS=[Unix] Server=[Samba 3.0.14a-Ubuntu]

Server Comment
--------- -------

Workgroup Master
--------- -------


Why don't detect my Workgroup and Server ? Please help !!

Sorry for my english :P


mabe because u spelled server "serwer"