Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have samba setup on a fedora 13 machine, and I use it to share with my xbmc client in the family room. When I set this up there no password or anything was required I merely entered in paths such as:

smb://<host>/<share> and all worked. 

Now on my ubuntu 10.04 machine when I try to access the same hosts, for example through smbmount though I receive an error.

smbmount //media/Music ~/Music/  # media is in my /etc/hosts and resolves to 
                                 # correct IP address for the machine

I receive error: operation not permitted after pressing enter when it prompts for password.

Here is my entry from /etc/samba/smb.conf:

[global]

workgroup = WORKGROUP
server string = Samba Server Version %v


# log files split per-machine:
log file = /var/log/samba/log.%m
# maximum size of 50KB per log file, then rotate:
max log size = 50



security = user
passdb backend = tdbsam


;   security = domain
;   passdb backend = tdbsam
;   realm = MY_REALM

;   password server = <NT-Server-Name>

;   security = user
;   passdb backend = tdbsam

;   domain master = yes
;   domain logons = yes

;   logon script = %m.bat
;   logon script = %u.bat
;   logon path = \\%L\Profiles\%u
;   logon path =

;   add user script = /usr/sbin/useradd "%u" -n -g users
;   add group script = /usr/sbin/groupadd "%g"
;   add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s     /bin/false "%u"
;   delete user script = /usr/sbin/userdel "%u"
;   delete user from group script = /usr/sbin/userdel "%u" "%g"
;       delete group script = /usr/sbin/groupdel "%g"

;   local master = no
    ;   os level = 33
    ;   preferred master = yes

;   wins support = yes
;   wins server = w.x.y.z
;   wins proxy = yes

;   dns proxy = yes


    load printers = yes
    cups options = raw

;   printcap name = /etc/printcap
    # obtain a list of printers automatically on UNIX System V systems:
;   printcap name = lpstat
;       printing = cups

;   map archive = no
;       map hidden = no
;   map read only = no
;   map system = no
;   store dos attributes = yes


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

[homes]
comment = Home Directories
browseable = no
writable = yes
;   valid users = %S
;   valid users = MYDOMAIN\%S


# Un-comment the following and create the netlogon directory for Domain Logons:
;   [netlogon]
;   comment = Network Logon Service
;   path = /var/lib/samba/netlogon
;   guest ok = yes
;   writable = no
;   share modes = no

# Un-comment the following to provide a specific roving profile share.
# The default is to use the user's home directory:
;   [Profiles]
;   path = /var/lib/samba/profiles
;   browseable = no
;   guest ok = yes

# A publicly accessible directory that is read only, except for users in the
# "staff" group (which have write permissions):
;   [public]
;   comment = Public Stuff
;   path = /home/samba
;   public = yes
;   writable = yes
;   printable = no
;   write list = +staff

    [tv]
comment = TV
    path = /media/Isos/tv
    public = yes
    writable = yes
    printable = no
    write list = +media

    [music]
comment = Music
    path = /media/Storage/music/ 
    public = yes
    writable = yes
    printable = no
    write list = +media


    [pictures]
    comment = Pictures
    path = /media/Storage/pictures
    public = yes
    writable = yes
    printable = no
    write list = +media
share|improve this question
add comment

3 Answers

Maybe this will help: HOW TO: Mounting smbfs Shares Permanently.

share|improve this answer
    
That document describes mounting them but uses username and password when doing smbmount. What I do not understand is why a password is being required when in XBMC all I had to do was define a location such as smb://Music/ and no username or password was provided. –  Chris Oct 6 '10 at 12:16
    
I don't know xbmc, but perhaps the way it was done there were implicit username/password, such as your login account. –  harrymc Oct 6 '10 at 12:35
    
Login on xbmc box is not a valid user on the ubuntu 10.04 running samba server. –  Chris Oct 6 '10 at 12:49
    
This might make the difference. However, with permanently mounted shares you shouldn't care. You can try experimenting with a username/password combo identical to that of the xbmc box, although I don't think SMB supports this on Linux. –  harrymc Oct 6 '10 at 13:02
add comment

Your samba is probably setup to map invalid users to the guest account. Most likely, your xbmc uses xbox which is an invalid username on your samba server. When you access from another linux box, the username probably is valid. Check the global section of your smb.conf.

[global]
# This option controls how unsuccessful authentication attempts are mapped 
# to anonymous connections
   map to guest = bad user

You can add option to specify username, if you want to access it just as xbmc do.

smbmount //media/Music ~/Music/ -o username=xbox

Note that in your current configuration, guest are granted read-only access. If you want to write, you would either:

  1. allows guest to write (potentially dangerous)

  2. add user with write access, and login as that user. Adding Users to Samba

share|improve this answer
    
This seems promising! Question, when I try smbmount from CLI on my ubuntu 10.04 machine, without a username would this not map to a bad user also? –  Chris Oct 6 '10 at 23:04
    
it would default to your username on that machine. Do you have the same username on the samba server? If so, then it'll check for valid password. –  fseto Oct 6 '10 at 23:19
    
That did not work using username=xbmc. –  Chris Oct 14 '10 at 0:50
add comment

You may want to try the Guest options, particularly if only read-only access is required.


Then you have 2 choices

1. read only for guest (no authentication) but read/write if you authenticate when you map the share
2. read/write for guest and then anybody can write to the share and change everything on it


Ah, does the user account you're running that mount command as have permission to mount directories? I suspect not. You may have to add it with the user option to your /etc/fstab file:

//media/Music /path/to/Music smbfs noauto,user,soft 0 0

That's my point - add it to fstab otherwise only root can mount the file system - that's almost certainly the source of your error.

share|improve this answer
    
Read-only is possible, but would prefer to have write abilities so I do not have to ssh to the box to make changes. –  Chris Oct 6 '10 at 12:17
    
I am not using fstab, this is just using CLI to manually mount it. And I am mounting it in my mount directory ~/Music/ for example. –  Chris Oct 14 '10 at 0:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.