View Full Version : Ok guys Samba question


Cajun Mike
03-08-2007, 07:56 AM
I have a printer on my file server, from my windows box I have it installed and actually see the printer so I know cups is ok. I cannot print to it. I tried adding a user but samba fusses about user not being a unix user.

my question is if I adduser --system computername will that just make the shell false
cause i just want to use system not login as a real user

Buickman
03-08-2007, 08:41 AM
Here's what I did, and it eventually worked. I set up an Epson on my wife's computer which has Edgy on it. (I'm at work, so I don't remember the exact steps without walking myself through it) I had to set it up to network share, don't remember exactly how I did that. But the thing that kept me from printing to it from my xp system was the firewall. I had to open firestarter and allow the IP from my xp system and opened port 663(or 668, again can't remember) and also forwarded that port in the router to her IP. I have a logon in her system, and that's the one I think I used.

Just be warned, I tend to stumble along when I'm doing things until they start working, then usually forget how I did it in the first place. I'll be lost if we ever lose some of these threads here. I'm sure eaux-yeah can help with this a lot better than I can.

eaux-yeah
03-08-2007, 05:54 PM
my question is if I adduser --system computername will that just make the shell false cause i just want to use system not login as a real user
You do not need to add the computername (machinename) unless you are trying to setup a PDC.

Just setup a new user:
useradd -d /home/username -s /bin/false -m usernameIf you want to change a shell, say /bin/false?, for a user already setup:
usermod -s /bin/false usernameThen make sure and add the Samba user/password:
smbpasswd -a username (drop the '-a' if just changing a users' password)

I recommend that you 'SYNC' the UNIX and Samba passwords so that after a user is added, you can just change the Samba password and it will change the UNIX users password, as well.

Add this to your smb.conf file and restart Samba:

unix password sync = Yes

passwd program = /usr/bin/passwd %u

passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*au$

Cajun Mike
03-10-2007, 07:45 AM
did that no go for username is that the name of the computer. any ideas

eaux-yeah
03-10-2007, 12:38 PM
What errors are you receiving? I'm sure it's something simple. Samba is too stinkin' easy to mess up.

Just to make sure, you did do this in order?:

1) Created a new user with /bin/false as the shell? Use the same user name that you use when logging on to the Windoze box.
2) Added that user into the Samba database using 'smbpasswd -a'?


Is the Win box set to the same WORKGROUP as Samba? You may need to enter WORKGROUP\username in the user field.

Samba has some very nice ways of finding problems built-in.
Add this line in your /etc/samba/smb.conf below the 'log file =' line:
log level = 3 passdb:5 auth:10 winbind:2Then look at the /var/log/samba/log.smbd file. That will give us a direction to go. This is temporary and will only be used for debugging and will create large log files. Remove it when the problem is fixed.

Also remember to use the command that will go through and tell you if your smb.conf file is using correct syntax:
testparm -s

Buickman
03-10-2007, 03:22 PM
I guess I just don't understand what you're trying to do. I didn't have to do any of that to print to a cups printer from xp.

Cajun Mike
03-11-2007, 06:05 PM
From Windows error a StartDocPrinter Call was not issued

log file from server
[2007/03/11 12:14:36, 3] smbd/process.c:process_smb(1194)
Transaction 39648 of length 140
[2007/03/11 12:14:36, 3] smbd/process.c:switch_message(993)
switch message SMBwriteX (pid 30730) conn 0x83d74a8
[2007/03/11 12:14:36, 3] smbd/sec_ctx.c:set_sec_ctx(288)
setting sec ctx (1000, 1000) - sec_ctx_stack_ndx = 0
[2007/03/11 12:14:36, 3] rpc_server/srv_pipe.c:api_pipe_bind_req(1506)
api_pipe_bind_req: \PIPE\spoolss -> \PIPE\spoolss
[2007/03/11 12:14:36, 3] rpc_server/srv_pipe.c:check_bind_req(959)
check_bind_req for \PIPE\spoolss
[2007/03/11 12:14:36, 3] smbd/pipes.c:reply_pipe_write_and_X(207)
writeX-IPC pnum=709b nwritten=72
[2007/03/11 12:14:36, 3] smbd/process.c:process_smb(1194)
Transaction 39649 of length 63
[2007/03/11 12:14:36, 3] smbd/process.c:switch_message(993)
switch message SMBreadX (pid 30730) conn 0x83d74a8
[2007/03/11 12:14:36, 3] smbd/pipes.c:reply_pipe_read_and_X(252)
readX-IPC pnum=709b min=1024 max=1024 nread=68
[2007/03/11 12:14:36, 3] smbd/process.c:process_smb(1194)
Transaction 39650 of length 1008
[2007/03/11 12:14:36, 3] smbd/process.c:switch_message(993)
switch message SMBtrans (pid 30730) conn 0x83d74a8
[2007/03/11 12:14:36, 3] smbd/ipc.c:reply_trans(539)
trans <\PIPE\> data=920 params=0 setup=2
[2007/03/11 12:14:36, 3] smbd/ipc.c:named_pipe(334)
named pipe command on <> name

Cajun Mike
03-11-2007, 07:13 PM
Here i testparm -s


root@server1:/var/log/samba# testparm -s
Load smb config files from /etc/samba/smb.conf
Processing section "[printers]"
Global parameter guest account found in service section!
Processing section "[homes]"
Processing section "[Storage]"
Loaded services file OK.
WARNING: passdb expand explicit = yes is deprecated
Server role: ROLE_STANDALONE
[global]
server string = %h server (Samba, Ubuntu)
obey pam restrictions = Yes
passdb backend = tdbsam
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*au$
unix password sync = Yes
log level = 3 passdb:5 auth:10 winbind:2
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = cups
os level = 69
dns proxy = No
wins support = Yes
default service = global
message command = /bin/sh -c '/usr/bin/linpopup
panic action = /usr/share/samba/panic-action %d
path = /media/storage
invalid users = root
hosts allow = 192.168.1., 127.
printing = cups
print command =
lpq command = %p
lprm command =
printer name = EpsonR300M

[printers]
path = /home/smbprint
create mask = 0700
guest only = Yes
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

[homes]
comment = Home Directories
guest ok = Yes

[Storage]
comment = Storage
write list = mike, mikey, michael, jackie, cajun
read only = No
guest ok = Yes

eaux-yeah
03-12-2007, 12:11 AM
!!!!!!! :scratch:
Global parameter guest account found in service section!Samba shouldn't even start with that smb.conf file! Does it?


Did you add stuff in the 'global' section by hand or something else?


You do not have a WORKGROUP or NETBIOS NAME defined.
workgroup = whateveryoursis
netbios name = yoursystemname


wins support = Yes
Should be No unless authenticating to PDC, change it or better yet, remove the entire line.

path = /media/storage goes in the [Storage] section, not [global]

printer name = EpsonR300M
Goes in the [printer] section

hosts allow = 192.168.1., 127.
should be:
hosts allow = 192.168.1. 127.

message command = /bin/sh -c '/usr/bin/linpopup
Remove that. It's no good.

In your [printers] section:
path = /home/smbprint What is that?




You can't just inadvertently enter lines in the smb.conf file. Each has it's place.

There is a perfect Samba example config file for you to use as a template:
/usr/share/samba/smb.conf



man smb.conf

I repeat

man smb.conf

Cajun Mike
03-12-2007, 08:17 AM
Hey got that off of a forum???