PDA

View Full Version : HOW-TO: Set-up SMB for XP, painlessly


vorte[x]
2004-02-14, 10:17 AM CST
This quick and dirty guide will get you up and on your feet with something like this:

http://vortex2050.dyndns.org:8080/images/smb_faq_1.PNG

Ok, let's do it! For simplicity, become root (by issuing su -) now and stay root until otherwise stated.

Task - Install/Update
It helps immensely when we have the software installed. I have tested these simple instructions on samba-3.0.0-15. To check which version of samba you have installed or to simply check whether or not it's even present, issue the rpm -q samba command. If you don't have samba installed or need to upgrade, a simple yum install samba should be sufficient.

Task - Configure Me! (General)
Ok the previous task was simple enough. Now let's dig thru some configuration files. I will be editing the file in vi, however you can use what you're most comfortable in. Let's first issue:
service stop smb to keep from people poking around. Now lets edit the samba configuration file using vi: vi /etc/samba/smb.conf Immediate hit a to throw ourselves into insert mode. Using the arrow keys to move around, edit these variables: (they are in the order of appearence although some scrolling down will be needed)

workgroup - Of which workgroup do you want this to be a part of? If you're unsure, on your XP box, right click My Computer, click Properties, click the Computer Name tab, then look for Workgroup. Set it to that.
server string - Pretty description of your samba box. Look at picture above.
hosts allow - Remove the semi-colon at the beginning of this line to enable it's usage (STRONGLY RECOMMENDED). I recommend you, on your XP box, click Start > Run > cmd (hit enter) and at the prompt type ipconfig

Jot down your Local Area Connection's IP Address, remove the last octet (example: 192.168.11.50 becomes 192.168.11.) and then append 127. to it. Put that as the value of this variable. (Ex: 192.168.11. 127.)
encrypt passwords - Remove the semi-colon at the beginning of this line and set it to yes. This will keep XP from complaining (and not working) about your authentication with the samba box.
smb passwd file - Remove the semi-colon at the beginning of this line. We'll create this file later.
os level - Remove the semi-colon at the beginning of this line and set it to 32 (max for Windows). Don't worry about this too much.

This is all that needs changing to get us up and browsing through our own home directories/printers. Let's now hit the ESC key, then press SHIFT-Z-Z to save and exit.

Task - Configure Me! (Users/Finishing Up)
This is a boring task. Configuring users. Let's get this over with by issuing cat /etc/passwd | mksmbpasswd.sh > /tmp/smbpass.tmp

This will print out your /etc/passwd file (contains users), pipe it to the mksmbpasswd script, then output an empty user template into /tmp/smbpass.tmp. When that finishes (should be quick), issue vi /tmp/smbpass.tmp

Don't be scared - You just need to be concerned about the usernames on the left hand side. Most of these users are for common services, so you don't want them to be used to access network shares. Scroll down to the line in which the unwanted user lies and hit D twice (DD) (removes line). Get rid of: root, bin, daemon, adm, lp, sync, shutdown, halt, mail, news, uucp, operator, games, gopher, ftp, nobody, rpm, vcsa, nscd, sshd, rpc, rpcuser, nfsnobody, mailnull, smmsp, pcap, mysql, should they exist. After you're left with at least one human user, hit SHIFT-Z-Z to save and exit. Let's now drop this file into it's proper place by issuing mv /tmp/smbpass.tmp /etc/samba/smbpasswd

Now that we have a valid list of samba users, we need to assign passwords (arghhh boorrringggg). Use the command [OODE]smbpasswd username[/CODE] (replacing username with a user) to assign passwords. This needs to be done for every samba user, don't try to skip it!

Task - Start er' up!
Ok phew, we're done! This is easy - Issue service smb start. You should now see what you saw above, in My Network Places > View Workgroup Computers. You'll need to authenticate as the users we set up above, to browse your home directory!

Further configuration can be done by reading the official Samba FAQ stated at the beginning of this guide.

Have fun!

~ ~ ~
February 14, 2004 @ ~12:21PM
// Initial posting.

budds
2004-09-29, 09:14 PM CDT
thanks!

this topic saved me a whole lot of time and effort.

hope you make some more!

blammo
2004-09-29, 11:13 PM CDT
This is a boring task. Configuring users. Let's get this over with by issuing cat /etc/passwd | mksmbpasswd.sh > /tmp/smbpass.tmp. This will print out your /etc/passwd file (contains users), pipe it to the mksmbpasswd script, then output an empty user template into /tmp/smbpass.tmp. When that finishes (should be quick), issue vi /tmp/smbpass.tmp. Don't be scared - You just need to be concerned about the usernames on the left hand side. Most of these users are for common services, so you don't want them to be used to access network shares. Scroll down to the line in which the unwanted user lies and hit D twice (DD) (removes line). Get rid of: root, bin, daemon, adm, lp, sync, shutdown, halt, mail, news, uucp, operator, games, gopher, ftp, nobody, rpm, vcsa, nscd, sshd, rpc, rpcuser, nfsnobody, mailnull, smmsp, pcap, mysql, should they exist. After you're left with at least one human user, hit SHIFT-Z-Z to save and exit. Let's now drop this file into it's proper place by issuing mv /tmp/smbpass.tmp /etc/samba/smbpasswd.

Instead of doing all this why not just create a blank smbpasswd file if it doesn't already exist? Change the permissions so only root can read/write to it (chmod 600 smbpasswd), and then add users to it (smbpasswd -a username).

mandrake2319
2004-09-30, 12:47 AM CDT
I have set up a samba server in fedora core 2. it allows windows xp computers to print through the network printer. is it posibble to configure the server so that both windows 98 and windows xp can use the printer? how do i do this? thanks.

mtrichardson
2004-09-30, 05:07 PM CDT
Hey,
I'm on a very large school network. How do I set up anonymous access to my shared folders for Windows and OSX users?

crackers
2004-09-30, 08:33 PM CDT
Enable the SMB "guest" account - carefully. This is tantamount to leaving those directories wide open for anyone to read/write, unless you restrict those actions.

blammo
2004-09-30, 10:07 PM CDT
I have set up a samba server in fedora core 2. it allows windows xp computers to print through the network printer. is it posibble to configure the server so that both windows 98 and windows xp can use the printer? how do i do this? thanks.

I believe you can actually create a samba share that holds the printer drivers for various OS's and then serve them up as needed. But that's much ado!

In Windows 98 you have to set up a login to Microsoft Networking (file and printer sharing), because it will send this to the Linux box. If you just hit cancel when the login screen comes up, you don't print. Also, this user has to have a system and SMB account on the Linux box with the same credentials.

Having done that, it's just a matter of installing the printer drivers on the 98 machine, mounting the printer share, and print away.

sej7278
2004-09-30, 10:18 PM CDT
Bless you!!! ;)

I've just been fighting with this after installing FC2 - of course Win2K/RedHat9 works fine, but working with WinXP is a beyatch!

Browsing the FC2 box from XP seems to work fine now. The problem I have now is browsing my XP box from the FC2 box - but I'm currently updating smbclient (have 3.0.5 currently) so maybe that will fix things.

budds
2004-10-01, 09:19 PM CDT
hi!

i've done the how-to you gave but i can't log in to FC2. i have a windows XP system running alongside my FC2. in windows, i can see my FC2 in my workgroup but when i click on it, i can't browse it.

i get an error telling me that i don't have the needed permissions. i didn't even get far enough to be asked what my user name was and my password....

please help....

JackSilb
2004-10-02, 10:44 PM CDT
Same errors here. Spent lots of time trying to make it work already. Any help will be apreciated.

Configuration:
FC2 64 bits. Firewall ports open TCP 137, 138, 139, 445.
Xp Pro.

Tried the instructions above and also using Webmin (that I like a lot for the other servers)..

Thanks,
-JACK
p.s. done it before with other Red Hat versions and W2K




hi!

i've done the how-to you gave but i can't log in to FC2. i have a windows XP system running alongside my FC2. in windows, i can see my FC2 in my workgroup but when i click on it, i can't browse it.

i get an error telling me that i don't have the needed permissions. i didn't even get far enough to be asked what my user name was and my password....

please help....

blammo
2004-10-03, 12:20 AM CDT
hi!

i've done the how-to you gave but i can't log in to FC2. i have a windows XP system running alongside my FC2. in windows, i can see my FC2 in my workgroup but when i click on it, i can't browse it.


By default the smb.conf file doesn't allow browsing for "Home Directories". If there's no other directories shared on the samba server, you'll get the permission denied error. If you logged into XP with a username that exists on the samba box then you'll see the home share. Use Windows Explorer under Tools/Map Network Drive and mount it thus:

//server/share and choose "Connect using a different user name". You should be good to go.

JackSilb
2004-10-03, 02:47 PM CDT
Hello,

Oh boy. After many hous I got it to work. Happy man now

My problem was mainly because I added the hosts allow =xxx.xxx.xxx.127
It does not work for me. I have to use xxx.xxx.xxx. [last digits blank]

If you read the man page for smb.conf you will see that they use the scheme that worked for me.

I hope this will help others.
Also, make sure the users have the right to write to the directory your are sharing (assuming you want that to happen). Easy, but you may forget.

Thanks,
-JACK

Bellow is my smb.conf file for Fedora 2
Note that you need to change *.*.*. with the real IP you are using on your network

# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
log file = /var/log/samba/%m.log
load printers = yes
idmap gid = 16777216-33554431
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
username map = /etc/samba/smbusers
encrypt passwords = yes
security = user
# nee to change *.*.*. to your real network group
hosts allow = *.*.*.
winbind use default domain = no
template shell = /bin/false
dns proxy = no
netbios name = linuxbox
idmap uid = 16777216-33554431
password server = None
workgroup = home
os level = 32
printcap name = /etc/printcap
max log size = 50

[shared_folders]
comment = shared folders with Windows
# need to put your real path bellow
path = /usr/shared_dir
# need to change the users and groups to something that is valid on your machine
valid users = rafael,@windowsgroup
public = no
writeable = yes
printable = no

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
printable = yes





:D

mustangfanatic
2004-10-18, 10:59 PM CDT
This is such a nightmare, I have tried everything you guys have posted here. At first the samba server was showing up on my windows pc but wouldn't let me connect due to permissions. Now that computer can't even access my workgroup. This is soooo frustrating!

From another pc (where the workgroup is still functional) my samba server is showing up buy it says the network path was not found. Any suggestions anyone?

JackSilb
2004-10-19, 08:28 PM CDT
This is such a nightmare, I have tried everything you guys have posted here. At first the samba server was showing up on my windows pc but wouldn't let me connect due to permissions. Now that computer can't even access my workgroup. This is soooo frustrating!

From another pc (where the workgroup is still functional) my samba server is showing up buy it says the network path was not found. Any suggestions anyone?

Sorry on the delay replying.
First relax, it will work. It has been working for lots of people.
Here is a catch

**
Also, make sure the users have the right to write to the directory your are sharing (assuming you want that to happen). Easy, but you may forget.
**
+ Make sure you are on the SAME workgroup.

Start there.

-JACK

ammar
2004-10-19, 10:44 PM CDT
Hi,

I connect to a local area network (with a proxy server) to access the net. On WIndows XP I used Microsoft ISA server.. will samba be able to do the same job? can samba do anything in my situation? I can access stuff through my browser using the proxy server but email clients and IM clients dont work.