ruptime is a classic Unix utility that displays the uptime and logged-in users for hosts on the local network. It uses the rwho protocol to collect information from remote systems.
| File/Directory | Path | Purpose |
|---|---|---|
| rwhod config | /etc/default/rwhod |
rwhod daemon configuration |
| hosts.equiv | /etc/hosts.equiv |
Trusted hosts |
| hosts.lpd | /etc/hosts.lpd |
Additional trusted hosts |
| Systemd service | /etc/systemd/system/rwhod.service |
Service definition |
| Spool directory | /var/spool/rwho/ |
rwho data files |
| Logs | /var/log/rwho/ |
Log files |
# /etc/default/rwhod
# Enable rwhod daemon
ENABLED=true
# Listen on all interfaces
LISTEN_ADDRESS=0.0.0.0
# Port for rwho protocol (513/udp)
PORT=513
# Update interval (seconds)
UPDATE_INTERVAL=180
# Log file
LOG_FILE=/var/log/rwho/rwhod.log
# Log level (debug, info, warning, error)
LOG_LEVEL=info
# Trusted networks
TRUSTED_NETWORKS="192.168.1.0/24 10.0.0.0/8"
# Maximum packet size
MAX_PACKET_SIZE=1024
# Packet timeout (seconds)
PACKET_TIMEOUT=300
# /etc/hosts.equiv
# Trusted hosts for rwho/ruptime
# Trust all hosts in trusted network
+@trusted-networks
# Trust specific hosts
192.168.1.10
192.168.1.20
192.168.1.30
# Trust with hostname
webserver.example.com
dbserver.example.com
# /etc/systemd/system/rwhod.service
[Unit]
Description=rwho daemon
Documentation=man:rwhod(8)
After=network.target
[Service]
Type=forking
EnvironmentFile=-/etc/default/rwhod
ExecStart=/usr/sbin/rwhod -l $LISTEN_ADDRESS -p $PORT
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5
# Security
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/spool/rwho
[Install]
WantedBy=multi-user.target
# ruptime options
ruptime [options] [host...]
# Options:
# -l Long format (show more details)
# -r Reverse sort order
# -t Sort by uptime
# -u Sort by number of users
# -a Show all hosts (including down)
# -V Show version
# -h Show help
# rwhod options
rwhod [options]
# Options:
# -l Listen for incoming packets
# -b Broadcast outgoing packets
# -p N Use port N (default: 513)
# -d Debug mode
# -v Verbose output
# Allow rwho traffic through firewall
# UDP port 513
# UFW
sudo ufw allow from 192.168.1.0/24 to any port 513 proto udp
# iptables
sudo iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 513 -j ACCEPT
sudo iptables -A OUTPUT -d 192.168.1.0/24 -p udp --sport 513 -j ACCEPT
# firewalld
sudo firewall-cmd --add-port=513/udp --permanent
sudo firewall-cmd --reload
# Check rwhod configuration
rwhod -t
# Test rwho connectivity
rwho -a
# Check ruptime output
ruptime -V
# Restart rwhod
sudo systemctl restart rwhod
# Check status
sudo systemctl status rwhod
# View logs
sudo journalctl -u rwhod -f
sudo tail -f /var/log/rwho/rwhod.log
# Enable rwhod at boot
sudo systemctl enable rwhod
# Disable rwhod
sudo systemctl disable rwhod
# Check if running
systemctl is-active rwhod
# Check if rwhod is running
ps aux | grep rwhod
# Check if listening
sudo netstat -ulnp | grep 513
# Check spool directory
ls -la /var/spool/rwho/
# Show uptime for all hosts
ruptime
# Long format
ruptime -l
# Show all hosts
ruptime -a
# Sort by users
ruptime -u
# Show logged in users
rwho
# Show all users including idle
rwho -a
# Show specific host
rwho hostname
# rwhod not starting
sudo systemctl status rwhod
sudo journalctl -u rwhod -n 50
# No hosts showing
ruptime -a
ls -la /var/spool/rwho/
# Permission issues
sudo chown -R root:root /var/spool/rwho/
sudo chmod 755 /var/spool/rwho/
# Network issues
ping -c 3 192.168.1.10
nc -u -z 192.168.1.10 513
Running ruptime in regulated environments? We assist with:
Secure your deployment: office@linux-server-admin.com | Contact Page