Jump to content

Samba for the stupid?


bigjohn
 Share

Recommended Posts

Hi, bigjohn!

I (stupid, too :) ) have been struggling with a similar problem in Mandriva 2006 (x86_64). It just wouldn't print from an XP laptop. I only managed to make it print by using SWAT configure utility (address http://localhost:901, swat should be installed and enabled in MCC-> System -> Services).

 

A few remarks that may be usefull for you to resolve the problem:

 

1) You have put 'valid users = john' in your [global] section. This affect every other section, such as [printer$]. It in fact excludes Clares from any access to samba under her own login, only one user john (and guest and root perhaps) can access your Mandriva box via samba!

 

2) You don't have option 'hosts allow = <allowed ip >'. I guess it is needed, as the default (if any) may not be very welcoming. If you want a range of IPs, use notation: 192.168.2. or 127. (note the last dot).

 

3) At one point I found that one samba user in /etc/samba/smbpasswd file had wrong userID (leftover from previous incarnation). Wrong uid <=> no samba access.

 

4) MCC's wizard could never solve my problem of printer setup!

 

5) You may want to run testparm -v /etc/samba/smb.conf to verify your samba settings. Look at the warnings it produces, it may spot some contradictions in the setting that you overlook!

 

6) Have a look at your firewall settings. On my system /etc/shorewall/rules gets overwritten with a default version whenever I run in MCC "Alter miscellaneous network settings". The default shorewall setup does not let samba through!

 

7) Look at the samba log files, perhaps some clues there?

Link to comment
Share on other sites

Thanks for the reply uralmasha,

 

I shall remove myself from the valid user line, it could be that.

 

No "hosts allow" line ? This is because last time I tried using that, it wouldn't let me start SWAT with anything there i.e. it kept just giving me an error that referred to the IP I'd put in there (plus I tried localhost and the localhost IP as well as the ones for the systems I wanted to use).

 

The wrong UID? hum? again a possibility. Though I wouldn't know the right UID from the wrong one - do you know how I'd check that ?

 

MCC sets up my printer without any problems from the main part of the system (though the damn yellow colour has obviously dried out or run out - I only just found out that my digital camera will mount automatically as removable media, and Clare wanted me to print some pictures of two of our cats).

 

Testparm doesn't give me any errors - it says all is well.

 

Firewall not a problem either, I've been "switching it off" for when I'm meddling with Samba.

 

Yes, I'll surely have a look at the logs - though it's a bit of a pain, as previously I could just log into konqueror as "superuser" when I had gentoo installed. Mandriva doesn't seem to have that option - bugger! So I have to log in as root or try looking at the file(s) with VI - currently I don't know how to change the font and colours in the terminal when it's open in VI - the colours are awful and the font (times new roman) makes it vvv hard too read.

 

Again, thankyou for the response - I'll be checking those suggestions out in a short while (coffee first B) )

Link to comment
Share on other sites

Try 'kdesu konqueror'...  :)

Thanks spinynorman. I've even managed to put that into a menu entry B)

 

OK, as for more info in response to uralmashas' suggestions.

 

There was nothing that I could see in the logs that seemed to indicate why it won't connect or show shares.

 

I ended up butchering my smb.conf because it was so full of notes, as too make it unreadable (thats the colouring of the text and the TNR font - I will find out how to change that one day :D ).

 

The smb.conf now looks like this

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

[global]

 

    workgroup = myworkgroup

    netbios name = johnspc

    server string = Samba Server %v

    printcap name = cups

    load printers = yes

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

    max log size = 50

    log level = 5

    map to guest = bad user

    security = share

    encrypt passwords = yes

    smb passwd file = /etc/samba/smbpasswd

    dns proxy = no

    dos charset = 850

    unix charset = ISO8859-1

 

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

[homes]

    comment = Home Directories

    browseable = yes

    writable = yes

 

[printers]

    comment = All Printers

    path = /var/spool/samba

    browseable = yes

    guest ok = yes

    writable = no

    printable = yes

    create mode = 0700

    print command = lpr-cups -P %p -o raw %s -r # using client side printer drivers.

    use client driver = yes

 

 

[print$]

    path = /var/lib/samba/printers

    browseable = yes

    write list = @adm root

    guest ok = yes

    inherit permissions = yes

 

The little swine is still telling me that it can connect to host for smb://myworkgroup

 

Testparm /etc/samba/smb.conf seems to check out OK

 

The only thing I can't work out is the UID suggestion. How should I check that ???

 

Also, having changed the netbios name to johnspc instead of think pad, means that I now can't see "johnspc" in the network neighbourhood on the laptop. Should that be the laptops name of my pc's name ???

 

regards

 

John

Edited by bigjohn
Link to comment
Share on other sites

(1) You can check /etc/smbpasswd and /etc/passwd files to see the UIDs (UID follows the username). It may be different if you use a smb.conf file from the previous incvarnation of mandriva (created new users in different order).

 

In my previous post i meant (4) that I could not set up shared printer for samba in MCC.

 

I thought, perhaps it would help if I show my own smb.conf that works. I edited it myself a million times using online tutorials, but it never helped. Then I used MCC to set it up -- no luck (shares visible, printer don't print). This config created by SWAT works. The only difference is that my Wind. PC runs XP, and I don't setup home dirs. I also noticed that Windws caches the network neighbourhood, so I preferred to reboot the laptop after I changed samba setting.

 

There is an XP user `uralmasha' and a sambauser `uralmasha', and a Mandriva user `uralmasha'.

Hope this helps.

 

# Samba config file created using SWAT
# from 127.0.0.1 (127.0.0.1)
# Date: 2005/12/15 18:34:17

[global]
workgroup = WG
server string = Samba Server %v
password level = 8
username level = 8
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printcap cache time = 60
printcap name = cups
preferred master = Yes
domain master = Yes
dns proxy = No
hosts allow = 192.168.2., 127.

[printers]
comment = All Printers
path = /var/spool/samba
write list = uralmasha, @adm, root
printer admin = uralmasha, root
create mask = 0700
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

[print$]
path = /var/lib/samba/printers
write list = uralmasha, @adm, root
inherit permissions = Yes
guest ok = Yes

[SHAREDSPACE]
comment = Public Stuff
path = /path/to/shared
write list = uralmasha, theotheruseronXP
create mask = 0750
guest ok = Yes

#I set up only one printer from all configurations installed
[Std_IMG]
comment = 600dpi_Colour_70%__Duplex.1
path = /var/spool/samba
write list = uralmasha, @adm, root
printer admin = uralmasha, root
read only = No
create mask = 0700
guest ok = Yes
printable = Yes
printer name = Std_IMG
use client driver = Yes
share modes = No

Edited by uralmasha
Link to comment
Share on other sites

Hi John,

 

I had the problem of not being able to see my xp workgroup in smb4k and found it to be the personal firewall under Security in MCC. Through tinkering i found that if i didn't have "everything allowed" i was unable to see the windows workgroup.

 

Hope this helps although it probably won't as i'm very dim with all things Linux.

 

Ted

Link to comment
Share on other sites

Probably not as dim as I am when it comes to "things linux" Ted.

 

Thanks for the suggestion though.

 

I've currently got as far as being able to see the laptop from the linux box if I put the "smb://workgroup" entry into konqueror manually, but I still can't get "it" to see the workgroup when I check via the devices or network browsing icons - plus the bloody laptop still can't see the main PC so I can't print from it directly (I can't add the printer either).

 

It's all proving a real "pain in the bollocks". Afterall, the use of Samba is so wide spread, I sure that there must be an easier way of doing this!

 

regards

 

John

Link to comment
Share on other sites

  • 1 year later...

try checking the network for computer names.

 

the open a terminal

 

smbclient -L computername

(from this list, find the printer)

 

as root

lpadmin -p printername -v smb://computername/printerid

(printername - make it up; how identified on your system

printerid - you get this from the smbclient command)

 

lpadmin -d printername

 

 

after this, i think you can open mandriva control panel and do the rest of the printer configuration

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...