pyratelog

personal blog
git clone git://git.pyratebeard.net/pyratelog.git
Log | Files | Refs | README

20230518-pull_my_finger.md (2845B)


      1 The other day I read a blog post by drkhsh about [using fingerd](https://drkhsh.at/2023-05-15_finger.html){target="_blank" rel="noreferrer"} to display contact details in the terminal.
      2 
      3 This looked pretty cool, and is geeky in a retro Unix way, so of course I had to do it as well.
      4 
      5 You can now finger me remotely!  To do so incant
      6 ```
      7 finger pyratebeard@pyratebeard.net
      8 ```
      9 
     10 If you don't have `finger` installed you can also use `nc` (netcat)
     11 ```
     12 echo pyratebeard | nc pyratebeard.net 79
     13 ```
     14 
     15 While drkhsh's post shows the setup on OpenBSD I am using Devuan so it was a little different.  These steps should also work on Debian or any other deb package system.
     16 
     17 I needed to install the `fingerd` daemon, the `finger` command, and `xinetd`, which will run the daemon
     18 ```
     19 sudo apt -y install fingerd finger xinetd
     20 ```
     21 
     22 Then created an `xinetd` service config file under /etc/xinetd.d/
     23 ```
     24 service finger
     25 {
     26 	socket_type	= stream
     27 	protocol	= tcp
     28 	wait		= no
     29 	user		= nobody
     30 	server		= /usr/sbin/in.fingerd
     31 	server_args	= -u -p /home/pyratebeard/finger
     32 	disable		= no
     33 }
     34 ```
     35 
     36 The `server_args` option tells `fingerd` to require a username to finger and use an alternative script, in my case /home/pyratebeard/finger.
     37 
     38 The script I point to is what outputs when you `finger` me
     39 ```
     40 #!/bin/sh
     41 cat <<EOF
     42                           __         __                        __
     43   .-----.--.--.----.---.-|  |_.-----|  |--.-----.---.-.----.--|  |
     44   |  _  |  |  |   _|  _  |   _|  -__|  _  |  -__|  _  |   _|  _  |
     45   |   __|___  |__| |___._|____|_____|_____|_____|___._|__| |_____|
     46   |__|  |_____|
     47 
     48   ----------------------------------------------------------------
     49             |
     50         web | https://pyratebeard.net
     51             |
     52     address | root@pyratebeard.net
     53         irc | pyrate > unix.chat | pyratebeard > {darkscience,libera,oftc}
     54             |
     55      pgp id | 0x5113a16d
     56      pgp fp | 7a8e 129d be67 9dab aeb3 37c5 c787 7c71 5113 a16d
     57      pgp dl | https://pyratebeard.net/pgp.pub
     58             |
     59     ssh key | ssh-ed25519 aaaac3nzac1lzdi1nte5aaaaicsluiy54h5flgxnnxqifwpnfvknih1/f0xf0ycthdqv
     60             |
     61    id proof | https://keyoxide.org/7a8e129dbe679dabaeb337c5c7877c715113a16d
     62             |
     63   ----------------------------------------------------------------
     64 
     65   finger ring:
     66 
     67       * drkhsh@drkhsh.at
     68 
     69 EOF
     70 ```
     71 
     72 The script has to be executable, then I restarted the `xinetd` service.
     73 
     74 If you try this also make sure port 79 is allowed through your firewall, this is the default `fingerd` port.
     75 
     76 A few of us on IRC have now started a "finger ring", so if you think this is fun and want to join in let me know using the contact details on my [homepage](https://pyratebeard.net){target="_blank" rel="noreferrer"}, or `finger` me, or jump into the #unix channel on [unix.chat](https://unix.chat){target="_blank" rel="noreferrer"} and post your finger link.