LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-14-2007, 09:26 PM   #1
creznedmick
Member
 
Registered: Jul 2003
Location: Austarlia
Distribution: redhat 7.3 & 9, Mandrake
Posts: 39

Rep: Reputation: 15
Question smb set to "share", xp login asking for password


greetings
I have samba running on Ubuntu and "user = share" (better set-up for my current needs). When i try to login from xp I get asked for a password. There is no password but I am not allowed in. Any ideas
Thanks Michael
 
Old 05-14-2007, 10:26 PM   #2
combatwombat
Member
 
Registered: Apr 2003
Location: Hastings, Hawkes Bay, NZ
Distribution: Ubuntu Gutsy Gibbon
Posts: 53

Rep: Reputation: 15
xp to samba

The user "nobody" needs to have read access to the shares on the samba
http://www.debuntu.org/guest-file-sharing-with-samba
 
Old 05-14-2007, 11:00 PM   #3
creznedmick
Member
 
Registered: Jul 2003
Location: Austarlia
Distribution: redhat 7.3 & 9, Mandrake
Posts: 39

Original Poster
Rep: Reputation: 15
Greetings
Thanks; I changed "guest ok = Yes" and changed the name of my share
[Guest Share] (I don`t think that made any difference but why the hell not).
Now I get; "network access denied" you do not have permission
Here is testpram

[global]
server string = %h server (Samba, Ubuntu)
interfaces = 127.0.0.0/8, eth0, #interfaces, =, lo, eth1
security = SHARE
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
panic action = /usr/share/samba/panic-action %d
invalid users = root
read only = No

[Guest Share]
path = /media/hdc5
create mask = 0644
guest ok = Yes



[printers]
comment = All Printers
path = /var/spool/samba
read only = Yes
create mask = 0700
printable = Yes
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
read only = Yes


Thanks Michael
 
Old 05-14-2007, 11:12 PM   #4
combatwombat
Member
 
Registered: Apr 2003
Location: Hastings, Hawkes Bay, NZ
Distribution: Ubuntu Gutsy Gibbon
Posts: 53

Rep: Reputation: 15
network

try commenting out the interfaces line altogether, it is not mandatory
then restart Samba:
sudo /etc/init.d/samba restart
 
Old 05-14-2007, 11:19 PM   #5
creznedmick
Member
 
Registered: Jul 2003
Location: Austarlia
Distribution: redhat 7.3 & 9, Mandrake
Posts: 39

Original Poster
Rep: Reputation: 15
Greetings
OK back to the password request
Michael
 
Old 05-14-2007, 11:24 PM   #6
combatwombat
Member
 
Registered: Apr 2003
Location: Hastings, Hawkes Bay, NZ
Distribution: Ubuntu Gutsy Gibbon
Posts: 53

Rep: Reputation: 15
permissions

ok, u sure u got permission for nobody on /media/hdc5?

sudo chown nobody:users /media/hdc5 -R

and add to the smb.conf:
[Guest Share]
path = /media/hdc5
create mask = 0644
guest ok = Yes
browseable = yes
force user = nobody

Last edited by combatwombat; 05-14-2007 at 11:25 PM.
 
Old 05-14-2007, 11:52 PM   #7
creznedmick
Member
 
Registered: Jul 2003
Location: Austarlia
Distribution: redhat 7.3 & 9, Mandrake
Posts: 39

Original Poster
Rep: Reputation: 15
Greetings
I have just loaded Feisty Fawn and did not think of the fact I had not changed perrmisions in fstab. I did that and now the share mounts. As usual it is the obvious
Thank you very much I could have been chasing my tail for a week
Michael
 
Old 05-15-2007, 02:09 AM   #8
FreeThinkerJim
Member
 
Registered: Apr 2005
Location: Las Vegas, Nevada, USA
Distribution: Ubntu Intrepid Ibex (8.10)
Posts: 129

Rep: Reputation: 15
I had this same problem sharing stuff with WinXP and my linux boxes a while ago. The problem is that XP requires that passwords be sent encrypted over the wire as a security measure. Samba can work with this, but it needs a little bit of setup. To get around this what you have to do is set up a user and password to be used for your connections via samba.

For my box, I added a user named "jim" with this command

Code:
smbpasswd -a jim
Then just enter a password to use and you should be good to go. AFAIK the user you choose doesn't need to be one that's actually used to log onto the system; it can be any valid username. After that, be sure to restart samba to make sure the change takes effect Then, when XP asks you for a username and password, put the information in, and your share should come up.

HTH
 
Old 05-15-2007, 03:21 AM   #9
please
Member
 
Registered: Apr 2007
Posts: 195

Rep: Reputation: 30
Cool

FYI
this is enough for smb

Starting, Stopping, and Restarting Samba
Most Linux distributions come with scripts to start, stop, and restart Samba properly. If yours does not, use the commands under the Optional Commands column

Runlevel Script Optional Command
Start Samba /etc/rc.d/init.d/samba start /usr/sbin/smbd -D and /usr/sbin/nmbd -D
Stop Samba /etc/rc.d/init.d/samba stop killall -TERM smbd and killall -TERM nmbd
Restart Samba /etc/rc.d/init.d/samba restart killall -HUP smbd and killall -HUP nmbd
Samba Log Files
All Samba actions such as login attempts and file transfers can be logged in the /var/log/samba directory. Under this directory the actions are logged by machine name. For example, all actions from the machine named "Morpheus" are logged in the file /var/log/samba/log.morpheus. User actions can also be logged under two files named /var/log/log.smb and /var/log/log.nmb. This is configured in the smb.conf file using the option log file. For example, to log actions by machine name use the following line:
log file = /var/log/samba/log.%m
Windows Workgroup
You can specify which Windows Network Neighborhood Workgroup your Linux machine is seen in and the description of the machine by editing the following lines in smb.conf:
workgroup = WORKGROUPNAME
server string = MACHINE DESCRIPTION
Access Control
smb.conf can be used to allow and deny access by IP addresses. This is done by listing IP addresses or subnets on the lines beginning with hosts allow and hosts deny. Examples:
Example Explanation
hosts allow 192.168.10.0/255.255.255.0 Allow all hosts in the given network/netmask
hosts allow 160.210 EXCEPT 160.210.24.56 Allow all hosts beginning with 160.210 except 160.210.24.56
hosts allow 192.168.10 192.168.20 allow all hosts beginning with 192.168.10 or 192.168.20
hosts deny 130.74 deny all hosts beginning with 130.74


Using Samba with Windows NT 4.0 Service Pack 3 or higher
Samba can be configured to send plain-text passwords or encrypted passwords. The Microsoft SMB protocol originally used plain-text passwords. However, with Service Pack 3 or higher for Windows NT 4.0, they changed the protocol to use encrypted passwords. Samba must be configured for this to connect to Windows NT 4.0 machines. One way to do this is to modify the NT registry; however, if you choose this option all NT machines must be configured to use plain-text passwords which is time-consuming and might cause conflicts elsewhere. The easy way to handle this is to configure Samba to send encrypted passwords. This can be done with the following steps:

1. Create a separate password file for Samba based on your /etc/passwd file. This will create Samba users for every user that already exists on your system. To do this by executing the command cat /etc/passwd | mksmbpasswd.sh > /etc/smbpasswd. The script should be in the /usr/bin directory or you can get it here.
2. Make sure only root has permission to read and write to the Samba password file with the command chmod 600 smbpasswd.
3. The script does not copy the passwords. To set the Samba password for each users thus enabling their Samba accounts, use the command smbpasswd username for each user.
4. Edit the smb.conf file to include the two lines
encrypt passwords = yes
smb passwd file = /etc/smbpasswd
5. Restart Samba with /etc/rc.d/init.d/smb restart


Print Sharing from Linux to Windows
The following section is usually included in the sample smb.conf that allows printers defined in the /etc/printcap file to be shared. If not add/uncomment the following lines in smb.conf:
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no

Then, just restart Samba and add the Linux printer to a Windows machine as you would any other Window's shared printer. The printer name will be the same name specified in the /etc/printcap file such as lp.

Creating a Common Share Directory for Multiple Users
You can create a share directory more than one user has permission to view. This is similar to a Linux/Unix group definition. The best way to explain this is to show an example:
[myshare]
comment = Share for John and Sam
path = /usr/share
valid users = john sam
public = no
writable = yes
printable = no
create mask = 0765

This shares the directory /usr/share for only the users john and sam. It is writable which means both john and sam have write permissions to the shared directory. Any files/directories created in the shared directory will have the permission 0765.

Connecting to a Samba Machine in Linux
To connect to a Samba machine (Windows or Linux running Samba) from the command line, execute the command (replace MACHINENAME and sharename with the appropriate values)
smbclient //MACHINENAME/sharename

If you want to pass a different username to the Samba Server, execute the command (replace username with your username).
smbclient //MACHINENAME/sharename -U username

If a password is associated with the username, you will be prompted for it. Once you are authorized by the SMB protocol, you will be at a smb: \> prompt. This is similar to an ftp session where get, put, pwd, ls, etc. can be used to navigate. Type help for a list of commands.

Configuring Windows Machines
Connect to a Linux machine running Samba the same way you connect to any Windows machine - browse through Network Neighboorhood or Windows Explorer entering a password if required. Note: Windows 95/98 only prompts for a password and assumes the Windows Login name as the username. You need to either create a user on your Linux box with your Windows Login or create a Windows Login with the same username on your Linux machine. Optionally, you can have the Windows Login and password for Windows 95/98/NT/2000 be the same as your Linux Samba username and password and it will not prompt for a password. Obviously, this is a security issue if others have access to your system. Your call.

Thanks
Please
 
Old 05-15-2007, 07:30 AM   #10
REJC
LQ Newbie
 
Registered: Jul 2003
Location: Vancouver BC, Canada
Distribution: Ubuntu Feisty faun
Posts: 7

Rep: Reputation: 1
smb set to "share", xp login asking for password

I am running feisty faun, samba sharing to a Win2000 server, all service packs, 128k strength security. I got very tired of exactly the same problem.
I tried to use the native file samba sharing tools w/feisty, but it was hit or miss--mostly miss.

Then I used the samba configurator from Webmin--hurrah!

webmin: for feisty faun needs 4 libraries + the program

the easy way:
If you like to install and update Webmin via APT, edit the /etc/apt/sources.list file on your system and add the line :
deb http://download.webmin.com/download/repository sarge contrib
You will now be able to install with the commands : apt-get update
apt-get install webmin.
All dependencies should be resolved automatically.


the hard way:
you can search out of your synaptic installer (hint: just search on the text up to the underscore, omitting the version #... ie: ]libauthen-pam-perl)
  1. libauthen-pam-perl_0.16-1_i386.deb
  2. libio-pty-perl_1%3a1.05-2build1_i386.deb
  3. libmd5-perl_2.03-1_all.deb
  4. libnet-ssleay-perl_1.30-1_i386.deb

The latest webmin for ubuntu is found at: http://prdownloads.sourceforge.net/w..._1.340_all.deb

My experience has been that webmin does a better job of setting up both apache and samba servers than do the native ubuntu tools


Here is my smb.conf file. Try adapting it to your use--remember to save your original!!

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentary and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
#

#======================= Global Settings =======================

[global]
log file = /var/log/samba/log.%m
load printers = yes
printer = LaserJet-5L
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
obey pam restrictions = yes
socket options = TCP_NODELAY
public = yes
passwd program = /usr/bin/passwd %u
passdb backend = tdbsam
dns proxy = no
netbios name = aarc01
writeable = yes
server string = %h server (Samba, Ubuntu)
invalid users = root
path = /var/spool/cups/tmp
workgroup = aarc.net
os level = 20
syslog = 0
security = share
panic action = /usr/share/samba/panic-action %d
max log size = 1000

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of

# server string is the equivalent of the NT Description field

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
; wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = true



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects

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

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
; syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.

# Do something sensible when Samba crashes: mail the admin a backtrace


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.

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


; guest account = nobody

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
; unix password sync = no

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
; pam password change = no

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
; logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
; logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
; load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups

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


############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
; domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

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

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
; valid users = %S

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

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

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

wins support = no
[printers]
comment = All Printers
browseable = no
printable = yes
create mode = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
writeable = no
path = /var/lib/samba/printers
# Uncomment to allow remote administration of Windows print drivers.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
; write list = root, @ntadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; writable = no
; locking = no
; path = /cdrom
; public = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom


[public]
path = /public
comment = Shared files on AARC01
available = yes
browsable = yes
public = yes
writable = yes

[icv]
path = /public/our documents/faith/acic/icv
comment = Immanuel Church Vancouver
available = yes
browsable = yes
public = yes
writable = yes

[Our Documents]
path = /public/our documents
available = yes
browsable = yes
public = yes
writable = yes

Last edited by REJC; 05-15-2007 at 07:59 AM.
 
Old 05-17-2007, 04:18 AM   #11
Rameshwar
LQ Newbie
 
Registered: Apr 2007
Posts: 3

Rep: Reputation: 0
Thumbs up Make sure this stuff is there

Quote:
Originally Posted by creznedmick
greetings
I have samba running on Ubuntu and "user = share" (better set-up for my current needs). When i try to login from xp I get asked for a password. There is no password but I am not allowed in. Any ideas
Thanks Michael
Hi,

To enter in to samba .. you require a user

for example: Create a user by name sam

# adduser sam

and these parameters should be specified in smb.conf file

smb.conf file
-------------------------------------------
[Share Name]
myshare]
comment = Mary's and Fred's stuff
path = /usr/somewhere/shared
valid users = need to specify the user name (ex valied user = sam)
// public = no
writable = yes
browseable = yes
printable = no
----------------------------------------------

after editing the smb.conf

then create a samba password by using the following command

# smbpasswd -a sam

enter the password

now you can login using user name and password of sam.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between "service smb restart" and "/etc/rc.d/init.d/smb" powah Linux - Software 1 01-17-2007 05:17 PM
SMB share "does not exist" ??? litlmary Linux - Networking 3 01-02-2007 06:33 PM
I've set the "Turn off login" for root user in YaST :( lesnakupa SUSE / openSUSE 2 10-31-2006 09:09 AM
open office "input/output error" saving to smb share PK2K Linux - Software 6 03-09-2005 01:30 AM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-29-2004 11:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration