Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: A simplistic identd daemon for Tiger Internet
Tiger only hintMost IRC servers still require an ident answer from your connection to let you in. Unfortunately, few Mac IRC clients have a working identd server bundled in. Furthermore, identd might also be needed for certains FTP servers. This hint will show how to enable a simple launchd service listening on 113 TCP, running all the time and available for all users. This should be fairly OK from a security standpoint, as the Python script I will use is unlikely to present any buffer overflow issue.

[robg adds: I haven't tested this one...]

launchd is the new service manager of Mac OS X 10.4 (aka Tiger). We will need to create an XML file describing our new service. Here is a terminal sequence showing how to do that (^D is Control-D; the $ and # symbols are prompts):
$ sudo su -
# cd /System/Library/LaunchDaemons
# cat > net.globules.identd.plist
You'll see nothing happening after the cat command above, other than a new line below the command's line. Copy and paste this text, then hit Control-D to write the file.

The label and the name for this XML file should be unique. Here I am using my domain name to ensure that; you could change it to anything you like. Once this done, we'll need to put the Python script in /usr/local/bin, and its configuration file in /etc/:
# cd /usr/local/bin
# curl -O http://www.globules.net/python.py
# md5 identd.py 
MD5 (identd.py) = 147a8469bf760df8dfbaba02eece83c6
#
Please check the Python code by yourself as well: this should be fairly readable if you have any experience in UNIX scripting. Now we're only missing a configuration file:
# cd /etc
# cat > identd.ini
[options]
-r = 8
defaultuser = UNKNOWN

[users]
sjobs = steve
bgates = bill
Again, hit Control-D after the last line. This is a list to associate short usernames with identd answer strings. The default is to generate a random string of eight characters. To start the services, the simplest way would be to reboot your Mac. Our new XML file will then be read, and launchd will start listening on 113 TCP. Alternatively, I've found that this works:
# launchctl unload /System/Library/LaunchDaemons
# launchctl load /System/Library/LaunchDaemons
You can verify that the new service has indeed started:
# launchctl list
Do not forget to adjust your firewall to allow incoming 113 TCP from the System Preferences. Any suggestions are welcomed. I hope the above will help to also show the basics of launchd.
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[15,146 views]  

10.4: A simplistic identd daemon for Tiger | 8 comments | Create New Account
Click here to return to the '10.4: A simplistic identd daemon for Tiger' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: A simplistic identd daemon for Tiger
Authored by: epocs on May 09, '05 04:33:02PM

The link for the text to copy (http://www.macosxhints.com/dlfiles/identd.txt) is dead.

---
--
Adam Franke



[ Reply to This | # ]
10.4: A simplistic identd daemon for Tiger
Authored by: ghinteclinn on May 09, '05 04:40:25PM

I like my identd hack:

#!/usr/bin/perl
($x,$y)= split /,/, <>;
print $x+0, " , ", $y+0, " : USERID : WHATEVER : fool\n"

You can replace "WHATEVER" with the OS name of your choice, and "fool" with whatever user ID you want.

Invoke as you like (I run it on my firewall from inetd.conf).



[ Reply to This | # ]
10.4: A simplistic identd daemon for Tiger
Authored by: mathieu on May 09, '05 05:45:07PM

Here is the missing text to copy:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.globules.identd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/identd.py</string>
<string>-c</string>
<string>/etc/identd.ini</string>
</array>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>auth</string>
<key>SockFamily</key>
<string>IPv4</string>
<key>SockProtocol</key>
<string>TCP</string>
</dict>
</dict>
</dict>
</plist>
[/code]

Your small script still doesn't show how to create a daemon, and does not provide for people who need to have several idents (one per user).

Also, the Python script I show here, is only a tad more complicated that your 3 lines PERL script. What makes the tip a bit sophisticated is the creation of the launchd XML config.



[ Reply to This | # ]
10.4: A simplistic identd daemon for Tiger
Authored by: jzaw on May 09, '05 11:38:51PM
this works .. thanks

but to point out two small errata

# curl -O http://www.globules.net/python.py

should read

# curl -O http://www.globules.net/identd.py

and then you need to

# chmod 774 identd.py

so that its executable

also my install of Tiger didnt have a /urs/local/bin dir so i simply created it as root with mkdir and then installed the python script

hope this helps

[ Reply to This | # ]
10.4: A simplistic identd daemon for Tiger
Authored by: cynikal on May 09, '05 11:09:04PM

Just a quick note, you probably shouldn't mess around with the /System/Library/.. anything folder, you can just as easily work in /Library/LaunchDaemon and is probably safer both from a maintenance standpoint and a backup point of view (if you later are archiving/installing your system, you just remember /Library since everything in /System/Library is restorable from the o/s install disks).



[ Reply to This | # ]
10.4: A simplistic identd daemon for Tiger
Authored by: seb059 on Jun 16, '05 04:22:42AM

You may have a try at the package at http://www.macmax.org/index_en.html.

It installs a standalone identd server which returns the currently logged user in Aqua.

And it seems to work fine on Panther and Tiger



[ Reply to This | # ]
10.4: A simplistic identd daemon for Tiger
Authored by: betabug on Jan 18, '10 01:35:22AM

The funny thing with this hint is that 10.4 indeed had a working identd setup that just needed activating in /etc/inetd.conf. Now 10.6 really has identd removed...



[ Reply to This | # ]
10.4: A simplistic identd daemon for Tiger
Authored by: ntt4 on Jun 21, '10 09:44:06AM

Does anyone have the python file anywhere?



[ Reply to This | # ]