Sons of the Forest: Complete Admin Commands Guide
Master server administration with comprehensive command reference, RCON setup, and advanced management techniques for Sons of the Forest multiplayer servers.
Accessing Admin Commands
There are three ways to execute admin commands:
- In-game Console: Press F1 to open console
- RCON Client: Remote administration tool
- Server Terminal: Direct server console access
Essential Admin Commands
Server Management
/save
Force immediate save of the current game state. Essential before maintenance or shutdown.
/shutdown [seconds] [message]
Schedule server shutdown with optional countdown and notification message to all players.
/restart [seconds] [message]
Restart the server with optional countdown and notification message.
/info
Display server information including current players, uptime, and performance metrics.
/status
Show detailed server status including memory usage, network statistics, and world information.
Player Management
/list
List all currently connected players with their Steam IDs and connection times.
/kick [player_name] [reason]
Remove a player from the server with optional kick reason visible to all players.
/ban [player_name] [duration] [reason]
Ban a player. Duration can be: 'permanent', 'Xh' (hours), 'Xd' (days), or 'Xw' (weeks).
/unban [player_name]
Remove a player's ban, allowing them to rejoin the server.
/whitelist add [player_name]
Add a player to the server whitelist, ensuring they can always join even when full.
/whitelist remove [player_name]
Remove a player from the server whitelist.
World Control
/time set [0-24]
Set the time of day (0 = midnight, 12 = noon, 24 = next midnight).
/weather [clear|rain|storm|fog]
Change weather conditions instantly.
/day
Advance time to next day morning.
/night
Set time to nighttime.
Item and Spawn Management
/give [player_name] [item_name] [quantity]
Give items to specified player. Use item IDs from the game data files.
/spawn [entity_name] [x] [y] [z]
Spawn entities at specific coordinates. Use with caution as it can affect game balance.
/teleport [player_name] [x] [y] [z]
Teleport player to specified coordinates.
/teleport_to [player1] [player2]
Teleport one player to another player's location.
Advanced Commands
Configuration Commands
/config set [key] [value]
Modify server configuration in real-time without restart.
/config reload
Reload configuration from ServerSettings.ini file.
/difficulty [easy|normal|hard|custom]
Change server difficulty mid-game.
/maxplayers [number]
Adjust maximum player capacity (1-8).
Debug and Monitoring
/debug enable
Enable debug mode with additional logging and performance metrics.
/debug disable
Disable debug mode.
/performance
Show detailed performance statistics including FPS, memory, and network metrics.
/netstats
Display network statistics for all connected players.
RCON Setup and Usage
Enable RCON
Add these settings to your ServerSettings.ini:
[Network]
EnableRcon = true
RconPassword = "your_secure_password"
RconPort = 27015
RconWhitelist = "127.0.0.1,your_admin_ip"
Using RCON Clients
# Using rcon-cli (Linux)
rcon-cli -H localhost -p 27015 -P your_password "save"
# Using PowerShell (Windows)
Import-Module SteamPS
Connect-SteamRcon -Host localhost -Port 27015 -Password your_password
Invoke-SteamRconCommand -Command "list players"
Popular RCON Tools
- rcon-cli: Command-line RCON client for Linux/macOS
- Steam RCON: Official Steam RCON client
- Battlemetrics: Web-based server management platform
- GameServerApp: Comprehensive server management suite
Automation and Scripting
Automated Backup Script
#!/bin/bash
# automated_backup.sh
SERVER_DIR="/home/sonsoftheforest"
BACKUP_DIR="/home/backups/sonsoftheforest"
RCON_PASS="your_password"
RCON_PORT="27015"
# Create backup directory
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p "$BACKUP_DIR"
# Notify players and save
echo "notify Server backup starting in 5 minutes..." | rcon -a localhost:$RCON_PORT -p $RCON_PASS
sleep 240
echo "save" | rcon -a localhost:$RCON_PORT -p $RCON_PASS
sleep 60
# Create backup
tar -czf "$BACKUP_DIR/automated_backup_$DATE.tar.gz" -C "$SERVER_DIR" saves/
# Notify completion
echo "notify Server backup completed!" | rcon -a localhost:$RCON_PORT -p $RCON_PASS
Daily Maintenance Script
#!/bin/bash
# daily_maintenance.sh
# Check server health
curl -s http://localhost:8766/health > /dev/null
if [ $? -ne 0 ]; then
echo "Server is down, attempting restart..."
./restart_server.sh
fi
# Clean old logs
find /home/sonsoftheforest/logs -name "*.log" -mtime +7 -delete
# Update MOTD
echo "status" | rcon -a localhost:27015 -p your_password > /tmp/server_status
# Send daily report to Discord webhook
curl -H "Content-Type: application/json" -X POST -d "$(cat /tmp/server_status | jq -c '{content: .}')" https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN
Security Best Practices
RCON Security
- Use strong, unique RCON passwords
- Limit RCON access to trusted IPs only
- Consider SSH tunneling for remote RCON access
- Regularly rotate RCON passwords
Admin Account Management
- Maintain a whitelist of authorized admins
- Use principle of least privilege for admin access
- Log all admin commands for accountability
- Regularly review admin activity logs
Troubleshooting Common Issues
Command Not Found
- Verify command syntax and spelling
- Check if you have admin permissions
- Ensure RCON is properly configured
- Update server to latest version
RCON Connection Failed
- Check RCON port is open and accessible
- Verify RCON password is correct
- Confirm RCON is enabled in server config
- Check firewall settings
Player Commands Not Working
- Ensure player has sufficient permissions
- Check player name spelling
- Verify player is online
- Check command cooldown periods
Conclusion
Master these admin commands to effectively manage your Sons of the Forest server, ensure smooth gameplay, and provide excellent experience for your community.
Pro Tip: Create custom command aliases for frequently used complex commands to streamline your admin workflow.