SAMBA on a Ubuntu Box

The Borg

Senior member
Apr 9, 2006
494
0
0
Hi all,

I have a lot of questions regarding a RADI setup. You guys helped a lot via this thread.

Now I have a few more questions relating to using GSAMBAD 0.1.9 to set up connections to the Storage Raid drives I have set up and mounted.

Please help.

First off, I cannot see the Ubuntu box via the Windows machine. A comment in the above thread mentioned something about now user logon. I want to be able to connect to the Storage space form any machine to save data.

Is there any info I should post to help?

 

SleepWalkerX

Platinum Member
Jun 29, 2004
2,649
0
0
I've never used gsambad and there's no need to imho. So in Ubuntu, you right-clicked on a folder, went to sharing options, and successfully added the share? I assume you want to set it up to where guest users can freely read/write without having to login?

If so, just edit your smb.conf file (sudo gedit /etc/samba/smb.conf). Scroll down a little bit and you should see an option that says "workgroup = <workgroup name>". Set this to be equal to your windows box's workgroup name so your windows machine can easily see your ubuntu machine. Next, scroll down until you get to the authentication part. It should say "; security = user". Change it to say "security = share" (make sure to remove the semi colon or else it'll comment the line out). This will make it so you don't have to login to the ubuntu box to access its samba shares. Then scroll down all the way to the bottom. You should see your share you've added. Make sure you add "guest ok = yes" if you want guests to be able to access your share and add "read only = no" if you want guests to be able to write to your share.

Now save the file and from the command line type "sudo /etc/init.d/samba restart". See if everything works now.
 

Kakumba

Senior member
Mar 13, 2006
610
0
0
Please post your /etc/samba/smb.conf (I expect it to be there, but if not, please just do a search for smb.conf). Also, do you want to use a password to connect, or do you want to simply have it "open"?

To allow open access, it would be like:

useradd sambaguest (creates the UNIX acount sambaguest)
(as root, or sudo) smbpasswd -s sambaguest (it then asks for a password, this sets up the samba user sambaguest)
set the share to allow the guest user
connect to the share
 

The Borg

Senior member
Apr 9, 2006
494
0
0
I did most of what SWX said. Just have problems with the permissions to allow writing. Herewith the smb.conf file.

Basically I want a storage space (it is a RAID-5 drive of about 78 gig) to use as remote (on another machine) storage to make sure I have backup of critical data like pictures and personal files. I wan tto be able to access it from any machine on my home network


[global]
netbios name = Matrix
server string =
workgroup = HOME
security =share
hosts allow = 127. 192.168.0. 10.0.0.
interfaces = 127.0.0.1/8 192.168.0.0/24
remote announce = 10.0.0.255
remote browse sync = 10.0.0.255
printcap name = /etc/printcap
load printers = no
cups options = raw
printing = cups
guest account = smbguest
log file = /var/log/samba/samba.log
max log size = 1000
null passwords = no
username level = 8
password level = 8
encrypt passwords = yes
unix password sync = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
domain master = no
preferred master = no
domain logons = no
os level = 33
logon drive = m:
logon home = \\%L\homes\%u
logon path = \\%L\profiles\%u
logon script = %G.bat
time server = no
name resolve order = wins lmhosts bcast
wins support = no
wins server =
wins proxy = no
dns proxy = no
preserve case = no
client use spnego = no
client signing = no
client schannel = no
server signing = no
server schannel = no
nt pipe support = yes
nt status support = yes
allow trusted domains = no
obey pam restrictions = yes
enable spoolss = yes
client plaintext auth = yes
disable netbios = no
follow symlinks = no
update encrypted = yes
pam password change = no
passwd chat timeout = 120
hostname lookups = no
username map = /etc/samba/smbusers
smb passwd file = /etc/samba/smbpasswd
passwd program = /usr/bin/passwd '%u'
passwd chat = *New*password* %n\n *ReType*new*password* %n\n *passwd*changed*\n
add user script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null '%u'
add user to group script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null -g '%g' '%u'
add group script = /usr/sbin/groupadd '%g'
delete user script = /usr/sbin/userdel '%u'
delete user from group script = /usr/sbin/userdel '%u' '%g'
delete group script = /usr/sbin/groupdel '%g'
add machine script = /usr/sbin/useradd -d /dev/null -g sambamachines -c 'Samba Machine Account' -s /dev/null -M '%u'
machine password timeout = 120
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /dev/null
winbind use default domain = yes
winbind separator = @
winbind cache time = 360
winbind trusted domains only = yes
winbind nested groups = no
winbind nss info = no
winbind refresh tickets = no
winbind offline logon = no
usershare owner only = False
guest ok = yes

[homes]
comment = Home Directories
path = /home
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = no
printable = no
share modes = no
locking = no

[netlogon]
comment = Network Logon Service
path = /home/netlogon
read only = no
available = yes
browseable = yes
writable = no
guest ok = no
public = no
printable = no
share modes = no
locking = no

[profiles]
comment = User Profiles
path = /var/samba/profiles
read only = no
available = yes
browseable = no
writable = yes
guest ok = no
public = no
printable = no
locking = no
create mode = 0600
directory mask = 0700

[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
writable = no
guest ok = no
public = no
printable = yes
share modes = no
locking = no

[pdf-documents]
path = /home/pdf-documents
comment = Converted PDF Documents
available = yes
browseable = yes
writeable = yes
guest ok = yes

[pdf-printer]
path = /tmp
comment = PDF Printer Service
printable = yes
guest ok = yes
use client driver = yes
printing = bsd
print command = /usr/bin/gsambadpdf %s %u
lpq command =
lprm command =

[Storage]
path = /var/storage
comment = Storage
valid users = smbguest
write list = smbguest
force user = nobody
force group = no group
read only = no
available = yes
browseable = yes
writable = yes
guest ok = yes
public = yes
printable = no
share modes = no
locking = no

 

SleepWalkerX

Platinum Member
Jun 29, 2004
2,649
0
0
Oh and one thing that usually prohibits a guest account from writing to my share is my file system's permissions on my shared directory. Usually a "sudo chmod -R 777 <directory>" fixes it for me.
 

Kakumba

Senior member
Mar 13, 2006
610
0
0
I think SleepWalkerX hit it there, /var and its subdirectories would normally only be writable by root, so executing that command will take care of it. The rest of your setup seems fine, so try that and let us know.
 

The Borg

Senior member
Apr 9, 2006
494
0
0
OK, got that working. Thanks. Now I can set the writing stuff. BTW, what is the 777 mean?

Now to get Windows to see the machine and folder. If I browse the Network Neighbourhood in Windows, I don't see the Linux Machine. What now?
 

SleepWalkerX

Platinum Member
Jun 29, 2004
2,649
0
0
Originally posted by: The Borg
OK, got that working. Thanks. Now I can set the writing stuff. BTW, what is the 777 mean?

http://en.wikipedia.org/wiki/File_system_permissions

There's more information on different permissions. It is essentially read, write, and execute permissions for the owner of the file, the group associated with the file, and other users' permissions on the file.

Originally posted by: The Borg
Now to get Windows to see the machine and folder. If I browse the Network Neighbourhood in Windows, I don't see the Linux Machine. What now?

It sounds like a workgroup problem. Remember that you have to write down the Windows workgroup name (click on System from Control Panel and look around in the tabs) and set the workgroup = <workgroup name> from smb.conf in Linux.

Either way find the IP address of the linux machine (type ifconfig to find your IP address) and then connect manually from windows. (For example, if the IP address for the linux box is 192.168.2.2 then from windows point the address bar to \\192.168.2.2) It should work this way.
 

The Borg

Senior member
Apr 9, 2006
494
0
0
YES!!! It works!!! Finally got what I wanted (with a little help from my friends).

There are 4 folders:
homes - needs password
netlogon - needs password
pdf-documents
Storage - my folder!!!

Please give me a little explanation about the above.

Once again, Many thanks for the help!!!
 

MrColin

Platinum Member
May 21, 2003
2,403
3
81
looks like you got it resolved. If in the future you want a GUI to handle your samba configurations, I reccomend SWAT. once installed, use a browser and go to "http://localhost:901" put root as the username, not your username.

EDIT: Port 901 not 931
 

Kakumba

Senior member
Mar 13, 2006
610
0
0
Originally posted by: The Borg
YES!!! It works!!! Finally got what I wanted (with a little help from my friends).

There are 4 folders:
homes - needs password
netlogon - needs password
pdf-documents
Storage - my folder!!!

Please give me a little explanation about the above.

Once again, Many thanks for the help!!!

If you are wondering why some are needing passwords, take a look at the smbd.conf. If public = yes, and guest ok = yes, then you will not get prompted for a password. And you will see that those are not on homes or netlogon, hence needing a password.