PDA

View Full Version : Test Samba


namit
1st December 2005, 04:34 PM
Hey all just wondernig how do i set a samba user and also how do i test if samba is working?

mndar
1st December 2005, 06:26 PM
To add a samba user open up /etc/samba/smbusers. the format is
<system-user> = <samba user>

To set the samba password
smbpasswd <user>

Configure samba /etc/samba/smb.conf

Start samba
/etc/init.d/samba start

To view shares
smbclient -L <your-netbios-name>

To mount shares
mount -t smbfs //<your-netbios-nam>/<share-name> /some/mount/point

namit
1st December 2005, 06:36 PM

smbusers::
# Unix_name = SMB_name1 SMB_name2 ...
root = administrator admin namit
nobody = guest pcguest smbguest

smbpasswd namit
This is what i get
Failed to find entry for user namit.
Failed to modify password entry for user namit

mndar
2nd December 2005, 12:34 AM
What about
smbpasswd <unix-name>
and when you login you can use namit,admin or administrator

namit
2nd December 2005, 11:09 AM
What about
smbpasswd <unix-name>
and when you login you can use namit,admin or administrator


I get this

Failed to find entry for user namit.
Failed to modify password entry for user namit

pahoskins
2nd December 2005, 11:44 AM
smbpasswd -a <user> <password>
smbpasswd -e <user>

Aslo get webmin from www.webmin.com, web based system tools for unix/linux

namit
2nd December 2005, 12:41 PM
but surely i would have to show samba that it is /home/namit that i want to connect to?

pahoskins
2nd December 2005, 12:51 PM
but surely i would have to show samba that it is /home/namit that i want to connect to?

You'll need to setup smb.conf to say what directories your want to share. If you want to share a users home directory then

[homes]
comment = Home Directories
valid users = namit
read only = No
browseable = No

or

[webmaint]
path = /data/samba02
valid users = frank paul john
read only = No

etc

1 add the users as normal in unix
2 add using smbpasswd -a
3 enable using smbpasswd -e

There are stacks of options in smb, webmin makes it a lot easier to maintain. Check in /var/log/samba for errors etc

Cheers

pahoskins
2nd December 2005, 01:22 PM
I get this

Failed to find entry for user namit.
Failed to modify password entry for user namit

smbusers is used to map a dummy name to a real account on the server, in your case
when namit mounts the share he's gonna be root as far as the server is concerned.

You dont need to smbpasswd -a namit, you need to smbpasswd -a root <password>

Then in windoze then your login is namit password = <password>.

namit
3rd December 2005, 01:47 PM
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

# Global parameters
[global]
workgroup = JOHNS
server string = Samba Server
username map = /etc/samba/smbusers
log file = /var/log/samba/smbd.log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = /etc/printcap
dns proxy = No
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
cups options = raw

[homes]
comment = Home Directories
read only = No
browseable = No

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No

mndar
3rd December 2005, 04:24 PM
You also need in the following sections, the entries
[global]
netbios name = <some-name>
security = share
#the following line is required to set the default account in case the user is accessing the share from a windows comp
guest account = <some-unix-user>

[homes]
path = /path/to/share
valid users = <some-unix-user>
guest ok = no

namit
11th December 2005, 03:46 PM
how do i stop some users from using samba?

mndar
11th December 2005, 04:07 PM
Don't enter their usernames in the smbusers file.
If you want specific shares to be accessible only to some users and NOT to guest, check the above post.

Ken_ddi
15th December 2005, 07:06 PM
If you want to use the GUI, you can add samba users using (provided that you have added these users in the users and groups tools) the Samba GUI. You can access this tools on System Tools>Server Settings>Samba...

Ken_ddi
15th December 2005, 07:07 PM
Alternatively, If you want to stop them from accessing the files, remove them on the same tool!!