Brian Simper
2004-Sep-08 16:12 UTC
[Samba] Logging the hostname with a Samba share connection
I am new to Samba but I set up a server and I am trying to get the logging to my liking. In /var/log/samba the entries are of the format: date.ipaddress.ipaddress I would prefer the logging to be: date.ipaddress:hostname I tried to do this with the /etc/samba/smb.conf setting: log file = /var/log/samba/%m:%M:%I.log The man page seems to indicate that either %m or %M should include the hostname but I keep just getting the IP address only. I have tried setting "security = user" and I then get the hostname but it asks for a password to connect the share. With "security = share" I don't get the password request but it then only logs the IP address. This is supposed to be a publicly available share. I don't want to ask for a password but I do want to get hostname information for tracking. With dhcp in use on my network I would have no good clue about which machine is making transactions. Since Windows machines connect to this server I need to know if one of them is inadvertantly passing viruses to me. This is a ProLiant DL 380 running Red Hat Enterprise Linux 3.0. Any ideas? Thanks, -- -Brian bsimper@gmail.com simper@qwest.net
Gerald (Jerry) Carter
2004-Sep-08 16:20 UTC
[Samba] Logging the hostname with a Samba share connection
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Brian Simper wrote: | I am new to Samba but I set up a server and I am trying to get the | logging to my liking. | In /var/log/samba the entries are of the format: | | date.ipaddress.ipaddress | | I would prefer the logging to be: | | date.ipaddress:hostname | | I tried to do this with the /etc/samba/smb.conf setting: | | log file = /var/log/samba/%m:%M:%I.log | | The man page seems to indicate that either %m or %M | should include the hostname but I keep just getting | the IP address only. Set 'hostname lookups = yes' ( and make sure you reverse DNS lookups work correctly). | | I have tried setting "security = user" and I then | get the hostname but it asks for a password to connect | the share. With "security = share" I don't get the | password request but it then only logs the IP address. I don't recommend security = share unless you really know what you are doing and why you want to use it. 'security = user' is much more intuitive. | This is supposed to be a publicly available share. | I don't want to ask for a password but I do want | to get hostname information for See the 'map to guest' parameter and possibly 'force user' cheers, jerry - --------------------------------------------------------------------- Alleviating the pain of Windows(tm) ------- http://www.samba.org GnuPG Key ----- http://www.plainjoe.org/gpg_public.asc "If we're adding to the noise, turn off this song"--Switchfoot (2003) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFBPzEgIR7qMdg1EfYRAnJZAJ46lzfmnrIijElZPaNAcU2qJJ9lhgCgutqp 4Ivnjsjfb2QgR46essogNT4=iJf4 -----END PGP SIGNATURE-----