Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = HOSTNAME
lanman auth = yes
client lanman auth = yes
directory mask = 0777
force directory mode = 0777
directory security mask = 0777
force directory mode = 0777
create mask = 0777
force create mode = 0777
security mask = 0777
force security mode = 0777
interfaces = lo eth0 192.168.0.30/24
hosts allow = 127. 192.168.0.
# --------------------------- Logging Options -----------------------------
#
# Log File let you specify where to put logs and how to split them up.
#
# Max Log Size let you specify the max size log files should reach
# logs split per machine
log file = /var/log/samba/log.%m
# max 50KB per log file, then rotate
max log size = 50
# ----------------------- Standalone Server Options ------------------------
#
# Scurity can be set to user, share(deprecated) or server(deprecated)
#
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
security = share
passdb backend = tdbsam
# ----------------------- Domain Members Options ---------------------
# the login script name depends on the machine name
; logon script = %m.bat
# the login script name depends on the unix user used
; logon script = %u.bat
; logon path = \\%L\Profiles\%u
# disables profiles support by specifing an empty path
; 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"
# ----------------------- Browser Control Options ----------------------------
#
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
#
# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
#
# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
; local master = no
; os level = 33
; preferred master = yes
#----------------------------- Name Resolution -----------------------
; wins support = yes
; wins server = w.x.y.z
; wins proxy = yes
; dns proxy = yes
# --------------------------- Printing Options -----------------------------
# You can choose a non default printing system using the Printing option
load printers = yes
cups options = raw
; printcap name = /etc/printcap
#obtain list of printers automatically on SystemV
; printcap name = lpstat
; printing = cups
# --------------------------- Filesystem Options ---------------------------
; map archive = no
; map hidden = no
; map read only = no
; map system = no
; store dos attributes = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
# 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, but read only, except for people in
# the "staff" group
; [public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; writable = yes
; printable = no
; write list = +staff
[myshare]
comment = This is share for sales dept
path = /share/smb
valid users = tom joy @smbgrp
force group = smbgrp
public = yes
writable = yes
printable = yes
create mask =0777
read only = yes
guest only = yes
guest ok = yes
browsable = yes
[root@server ~]#vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
(also enabled smb in firewall and my selinux is enables)
[root@server ~]#smbpasswd –a tom
[root@server ~]#testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[myshare]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[root@server ~]#usermod –a –G smbgrp root
[root@server ~]#usermod –a –G tom
[root@server ~]#smbpasswd –a root
[root@server ~]#smbpasswd –a tom
[root@server ~]#service network restart
[root@server ~]#service iptables restart
[root@server ~]#service smb restart
[root@server ~]#service nmb restart
From client(where my server and client both are centos 6.3,client ip is 192.168.0.2,successul when i ping to server)
But whenever im trying to connent the samba server from client pc...i am facing this problem..
[root@client ~]#smbclient //192.168.0.30/share/smb –u root
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]
Server not using user level security and no password supplied.
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
You need to specify the share name versus the path i.e. myshare.
The are several ways to view shares but using smbclient:
smbclient -L servername (IP address)
security = share is depreciated and you should really user level. In share mode the password vs username is sent which is why you are seeing the no password sent error. You also should not use root.
and i forget to tell you that i also set smb (all booleans) on in selinux..
as your advise
[root@server /]# smbclient -L 192.168.0.30
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]
Sharename Type Comment
--------- ---- -------
myshare Printer This is share for sales dept
IPC$ IPC IPC Service (Samba Server Version 3.5.10-125.el6)
Fax:2 Printer Fax
Microsoft_XPS_Document_Writer:1 Printer Microsoft XPS Document Writer
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]
Server Comment
--------- -------
HOSTNAME Samba Server Version 3.5.10-125.el6
after your advice,i had change security = user at standalone server option and restart the service smb,nmb...when i type [root@server ~]#smbclient //192.168.0.30/share/smb -U tom
this results Enter tom's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
[root@server /]# smbclient //192.168.0.30/myshare -U tom
Enter tom's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]
smb: \>
jai ho guru....thank you very much...its working...i really dont know that..i always mention
smbclient //192.168.0.30/share/smb -U tom.
after your suggestion and advice,i came to know my mistake....thank you...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.