LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-10-2003, 05:27 PM   #1
paulvl
LQ Newbie
 
Registered: Aug 2003
Location: The Netherlands, Zoetermeer (15Km East from The Hague)
Distribution: Red Hat Linux release 9 (Shrike) (Kernel 2.4.20-8 on an i686)
Posts: 27

Rep: Reputation: 15
SAMBA -> Config problem RedHat-Win98


This is a new thread because the last thread (with the same name) became a little chaotic.
From the start:

============================================================

The installed packages on my redhat:
Code:
[Applications]
	[Text-based Internet]
		fetchmail 		- A remote mail retrieval and forwarding utility
		lynx 			- A text-based Web browser
		mutt 			- A text mode mail user agent
		ncftp 			- An improved FTP client
[Servers]
	[Web Server]
		httpd 			- The httpd Web server
		php 			- The PHP HTML-embedded scripting support for the Apache Web server
		php-imap 		- An Apache module for PHP applications that use IMAP
		php-ldap 		- A module for PHP applications that use LDAP
		php-mysql 		- A module for PHP applications that use MySQL databases
		php-odbc 		- A module for PHP applications that use ODBC databases
		php-pgsql 		- A PostgreSQL database module for PHP
		squid 			- The Squid proxy caching server
		tux 			- User-space component of TUX kernel-based threaded HTTP server
	[Mail Server]
		sendmail 		- A widely used Mail Transport Agent (MTA)
		imap 			- Server daemons for IMAP and POP network mail protocols
		mailman 		- Mailing list manager with built in Web access
		sendmail-cf 		- The files needed to reconfigure Sendmail
		spamassassin 		- The is SpamAssassin, a spam filter for email which can be invoked from mail delivery agents
		squirrelmail 		- SquirrelMail webmail client
	[Windows File Server]
		samba 			- The Samba SMB server
		samba-client	 	- Samba (SMB) client programs
	[FTP Server]
		vsftpd 			- vsftpd - Very Secure Ftp Deamon
	[SQL Database Server]
		perl-DBD-Pg 		- A PostgresSQL interface for Perl
		perl-DB_File	 	- DB_File module for Perl
		postgresql-server 	- The programs needed to create and run a PostgreSQL server
		unixODBC 		- A complete ODBC driver manager for Linux
		mysql-server 		- The MySQL server and related files
	[Network Servers]
		cipe 			- A kernel module and daemon for providing an encrypted IP tunnel
		finger-server 		- The finger daemon
		rsh-server 		- Servers for remote access (rsh, rlogin, rcp)
		telnet-server 		- The server program for the telnet remote login protocol
============================================================

Ok, the partitions stuff is the (all)most simplest there is:
2 disks with 1 partion each (ext3).
/* not completely true: the hda has a second partition used for swapping, but this doesn't matter */
- 8Gb disk (hda) which is the 'systemdisk'.
- 80Gb disk (hdb) which is the 'central filedisk'.
With other words: mp3's, movies and homedirs on the hdb. All os and programs+config on the hda.

Since the hdb has financial administration stuff of a choir and more stuff not meant for my brothers/others I have made a directory /mnt/public/
Here I mount everything I would like to be public for all house members. This way I can add and remove shares without touching the smb.conf (think that's

less risky

So here the whole story in short (df -h & mount):
Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1             7.4G  606M  6.5G   9% /
/dev/hdb1              74G  5.5G   65G   8% /mnt/centrale
none                   62M     0   62M   0% /dev/shm
/mnt/centrale/audio    74G  5.5G   65G   8% /mnt/public/audio
/mnt/centrale/video    74G  5.5G   65G   8% /mnt/public/video


/dev/hda1 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hdb1 on /mnt/centrale ype ext3 (rw)
none on /dev/shm type tmpfs (rw)
/mnt/centrale/audio on /mnt/public/audio type none (rw,bind)
/mnt/centrale/video on /mnt/public/video type none (rw,bind)
============================================================

After installing the packages I did:
The user definitions:
Code:
groupadd vk26all
groupadd vk26parents
groupadd vk26brothers
useradd -d /mnt/centrale/homes/paul -G vk26all paul
passwd paul
useradd -d /mnt/centrale/homes/corawillem -G vk26all,vk26parents cora
passwd cora
useradd -d /mnt/centrale/homes/corawillem -G vk26all,vk26parents willem
passwd willem
useradd -d /mnt/centrale/homes/wilco -G vk26all,vk26brothers wilco
passwd wilco
useradd -d /mnt/centrale/homes/steven -G vk26all,vk26brothers steven
passwd steven
The rights-idea behind this:
  • All users in this house may read-only from the '/mnt/public map' ([VK26] in the smb.conf)
  • The users paul, wilco and steven have a centralized 'my documents' on the network ([Documenten] in the smb.conf)
  • The users cora en willem have together a centralized 'my documents' on the network ([Documenten] in the smb.conf)
  • The user paul (me) has read-write acces to the whole '/mnt/centrale' ([VK26Admin] in the smb.conf)

Making the smbpasswd:
Code:
smbpasswd -a paul
smbpasswd -a cora
smbpasswd -a willem
smbpasswd -a wilco
smbpasswd -a steven
Editing some config files:
Code:
vi /etc/services
...[edited]
...   netbios-ns    137/tcp   nbns
...   netbios-ns    137/udp   nbns
...   netbios-dgm   138/tcp   nbdgm
...   netbios-dgm   138/udp   nbdgm
...   netbios-ssn   139/tcp   nbssn
...   netbios-ssn   139/udp   nbssn
...[/edited]

vi /etc/rc.d/rc.local
...[added]
...   /mount --bind /mnt/centrale/audio /mnt/public/audio
...   /mount --bind /mnt/centrale/video /mnt/public/video
...   /etc/rc.d/init.d/smb start
...[/added]

vi /etc/samba/smb.conf
...[overwriten]
...   #=============== General settings ===============
...   [global]
...         workgroup = vk26wg
...         server string = The VK26 Server
...         security = user
...         encrypt passwords = yes
...         smb passwd file = /etc/samba/smbpasswd
...         log file = /var/samba/samba-log.txt
...         log level = 2
...   #=============== Share Definitions ===============
...   ###############################################
...   # Usefull substitutions                       #
...   #---------------------------------------------#
...   # %u = username of current service            #
...   # %g = primary group name of %u               #
...   # %m = the NetBIOS name of the client machine #
...   # %I = the IP address of the client machine   #
...   # %T = the current date and time              #
...   #                                             #
...   # %$(envvar) = the value of the environment   #
...   #              variable envvar                #
...   ###############################################
...   [VK26]
...         comment = VK26 central disk
...         path = /mnt/public
...         public = yes
...         read only = yes
...   [Documenten]
...         comment = Mijn Documenten
...         path = %H
...         valid users = %u
...         public = no
...         writable = yes
...   [VK26Admin]
...         comment = Whole central disk
...         path = /mnt/centrale
...         valid users = paul
...         public = no
...         writable = yes
...[/overwriten]
============================================================

The result (in the network neightbourhood):

Logged in as Paul:
Sees the following shares:
Documenten
  • Asks for password when opening the share (supplying the correct password, results in being asked again, and again, ....)
VK26
  • Opens correct
  • Reading files is possible
  • Complains about accessrights when trying to write
VK26Admin
  • Opens correct
  • Reading files is possible
  • Writing files is possible

Logged in as Steven:
Sees the following shares:
Documenten
  • Asks for password when opening the share (supplying the correct password, results in being asked again, and again, ....)
VK26
  • Opens correct
  • Reading files is possible
  • Complains about accessrights when trying to write
VK26Admin
  • Asks for password when opening the share (supplying the correct password, results in being asked again, and again, ....)

Everything is correct, except the [documenten] share.

The users *are* listed in the /etc/samba/smbpasswd.
The user's homedirectories *are* listed in the /etc/passwd.
So *why* do I keep getting the password prompt for the documents share?

Sight...

============================================================

In case somebody can figure this out, here is part of the samba-log.txt.
It shows the /etc/rc.d/init.d/smb start and steven trying to open (1 try) the [documenten] share

Code:
[2003/09/11 00:08:42, 2] lib/interface.c:add_interface(81)
  added interface ip=192.168.0.16 bcast=192.168.0.255 nmask=255.255.255.0
[2003/09/11 00:08:42, 2] smbd/server.c:open_sockets(215)
  waiting for a connection
[2003/09/11 00:08:47, 2] smbd/reply.c:reply_special(92)
  netbios connect: name1=VK26DELLSERVER   name2=VK26           
[2003/09/11 00:08:47, 2] smbd/reply.c:reply_special(111)
  netbios connect: local=vk26dellserver remote=vk26
[2003/09/11 00:08:49, 2] smbd/service.c:make_connection(331)
  Invalid username/password for documenten [steven]
[2003/09/11 00:08:49, 2] smbd/service.c:make_connection(331)
  Invalid username/password for documenten [steven]
[2003/09/11 00:08:55, 2] smbd/service.c:make_connection(331)
  Invalid username/password for documenten [steven]
[2003/09/11 00:08:58, 2] smbd/service.c:make_connection(331)
  Invalid username/password for documenten [steven]
[2003/09/11 00:08:58, 2] smbd/service.c:make_connection(331)
  Invalid username/password for documenten [steven]
[2003/09/11 00:08:58, 2] smbd/service.c:make_connection(331)
  Invalid username/password for documenten [steven]
[2003/09/11 00:08:58, 2] smbd/service.c:make_connection(331)
  Invalid username/password for documenten [steven]

lol, the ':' and the 'o' are interpeted as ...
... Nevermind you know what is says

============================================================

Ok, I can't *believe* I left any mistery for you.
Still *I* don't have a *clue* why things don't work out.

Please,.. enlight me!

ThNx for your time,

GrTzzz....
Paul van Leeuwen
 
Old 09-10-2003, 07:20 PM   #2
sidmark-2850
Member
 
Registered: Aug 2003
Posts: 133

Rep: Reputation: 15
Quote:
Asks for password when opening the share (supplying the correct password, results in being asked again, and again, ....)
remove the valid users = %u. You can put guest ok = no.

Quote:
Opens correct
Reading files is possible
Complains about accessrights when trying to write
Well, you do have the share configured as read only. You should also make sure that the unix permissions allow selected users or groups to write to the file. You can also put a parameter called "write list" to allow selected users to write to the share whereas everyone else can read.

Quote:
Asks for password when opening the share (supplying the correct password, results in being asked again, and again, ....)
This is the 2nd one where steven logs in. Since steven is the one logging in, even though he puts his correct password, he is not allowed to log in because he is not a valid user.

Cheers
 
Old 09-10-2003, 07:21 PM   #3
sidmark-2850
Member
 
Registered: Aug 2003
Posts: 133

Rep: Reputation: 15
BTW, what OS are you using to connect to samba?
 
Old 09-10-2003, 07:34 PM   #4
paulvl
LQ Newbie
 
Registered: Aug 2003
Location: The Netherlands, Zoetermeer (15Km East from The Hague)
Distribution: Red Hat Linux release 9 (Shrike) (Kernel 2.4.20-8 on an i686)
Posts: 27

Original Poster
Rep: Reputation: 15
Whoohoo,

the "remove the valid users = %u. You can put guest ok = no." did the trick.
I still don't get why 'valid users' was incorrect, but things are working now.

About the os question:
The main client is the Win98 pc. But since my vk26parents are asleep (2:30 here in the netherlands) I tested it on the WinXP pc. Everything works fine there so I'm confident it wil be fine for the Win98 too.

Thanks a *lot* man.

Learned some things about samba that I will benifit for quite a while.

Still a little questions pop's up in my mind: If an users creates a file on a public = yes, writable = yes share: what's the result with the linux-rights (owner and chmod stuff)?
 
Old 09-10-2003, 09:23 PM   #5
sidmark-2850
Member
 
Registered: Aug 2003
Posts: 133

Rep: Reputation: 15
If you do "testparm", there are defaults for the "create mask" and "directory mask." They are 744 and 755 respectively. So therefore a user will be able to create files, but he is the only one who can modify or delete them. If you wanted to make a public writable folder, you should first create the directory with the 777 permissions, then create the samba share as follows:
Code:
[Public]
	comment = Public Writable Share
	path = /mnt/public2
	public = yes
	read only = yes
	create mask = 0666
	directory mask = 0777
This way, all users will be able to write to the share.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Win98->Samba->Cups-HP656C printing problem shuwar Linux - Hardware 1 11-22-2003 10:54 AM
SAMBA -> Config problem RedHat-Win98 paulvl Linux - Networking 11 09-05-2003 11:00 AM
win98 Samba/nbtstat problem Froggy Linux - Networking 0 08-10-2003 03:41 PM
possible samba config problem or network config issue? rruffin Linux - Networking 3 06-03-2003 04:04 PM
Same old Problem, Win98 cannot access Samba share! mutantjazz Linux - Software 12 11-13-2002 10:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration