Back to Guides
Security & ProtectionIntermediate
Player Authentication Security Setup
Secure your server with proper authentication, two-factor authentication, and advanced login protection systems.
Blockhead Support Team
13 minutes
Proper authentication prevents unauthorized access to player accounts and protects your server from impersonation attacks and account takeovers.
1
Enable Online Mode
Configure proper authentication in server.properties:
server.properties Configuration:
# Enable Mojang authentication (ALWAYS true for public servers)
online-mode=true
# Prevent proxy connections
prevent-proxy-connections=false
# Enable player verification
enforce-whitelist=false
Online Mode Benefits:
- Verifies players own their Minecraft accounts
- Prevents name spoofing and impersonation
- Maintains player UUID consistency
- Required for secure plugin authentication
- Enables proper whitelist/ban enforcement
Never disable online-mode on public servers. This opens your server to account theft and impersonation attacks.
2
Install AuthMe Plugin
Add advanced authentication features with AuthMe:
AuthMe Features:
- Additional password protection
- Two-factor authentication (2FA)
- Session management
- Login attempt monitoring
- Email verification
- Country-based restrictions
AuthMe Installation:
- Download AuthMe from SpigotMC
- Place in plugins folder and restart
- Configure database connection
- Set up email settings for verification
- Configure security settings
Basic AuthMe commands:
/register password email # Register account
/login password # Login to account
/changepassword old new # Change password
/email add email # Add email address
/2fa add # Enable 2FA
3
Configure Two-Factor Authentication
Set up 2FA for enhanced account security:
2FA Setup in AuthMe:
# config.yml settings
Security:
twoFactorAuthentication:
enabled: true
length: 6
issuer: 'MyMinecraftServer'
windowSize: 3
Email:
mailSMTP: 'smtp.gmail.com'
mailPort: 587
mailAccount: 'server@yourdomain.com'
mailPassword: 'your-app-password'
Player 2FA Setup:
- Player uses
/2fa add
command - Server generates QR code link
- Player scans QR with authenticator app
- Player confirms with
/2fa confirm CODE
- 2FA is now required for future logins
4
Set Up Login Protection
Configure advanced login security measures:
AuthMe Security Configuration:
settings:
sessions:
enabled: true
timeout: 10
security:
minPasswordLength: 8
passwordMaxLength: 30
preventOtherCase: true
restrictions:
maxLoginPerIp: 3
maxJoinPerIp: 4
kickPlayersBeforeLogin: true
allowedNicknameCharacters: '[a-zA-Z0-9_]*'
protection:
enableAntiBot: true
antiBotSensibility: 5
antiBotDuration: 10
Login Attempt Monitoring:
- Track failed login attempts per IP
- Temporary IP bans after multiple failures
- Alert administrators to brute force attempts
- Log all authentication events
5
Implement Session Management
Control player sessions for better security:
Session Security Features:
- Session timeout: Auto-logout after inactivity
- IP binding: Sessions tied to specific IPs
- Device tracking: Recognize trusted devices
- Concurrent limits: One session per account
Session Commands:
# Admin session management
/authme sessions # View active sessions
/authme logout PlayerName # Force logout
/authme purgebannedplayers # Clean old data
# Player session commands
/logout # Manual logout
/session # Check session status
6
Configure Country Restrictions
Block connections from specific countries if needed:
GeoIP Protection Setup:
protection:
countries:
enabled: true
whitelist:
- 'US'
- 'CA'
- 'GB'
blacklist:
- 'CN'
- 'RU'
countryProtection:
enableProtection: true
isWhitelist: true
message: 'Your country is not allowed on this server'
Alternative IP Protection:
- Use VPN detection services
- Block known proxy/VPN IP ranges
- Implement CAPTCHA for suspicious IPs
- Require email verification for new countries
Country restrictions should be used carefully as they can block legitimate players. Consider your server's target audience.
7
Email Verification System
Require email verification for account registration:
Email Configuration:
EmailSettings:
mailSMTP: 'smtp.gmail.com'
mailPort: 587
mailAccount: 'noreply@yourdomain.com'
mailPassword: 'your-app-password'
mailSenderName: 'MyServer'
registration:
enableEmailConfirmationSystem: true
doubleEmailCheck: true
emailRegistration: true
VerificationEmail:
subject: 'Verify your account'
htmlMessage: 'Click to verify: <VERIFICATION_CODE>'
Email Verification Commands:
# Player commands
/email add your@email.com # Add email address
/email confirm CODE # Confirm email with code
/email recover # Request password recovery
# Admin commands
/authme email PlayerName # Check player email
/authme verify PlayerName # Manually verify player
8
Monitor Authentication Events
Track and analyze authentication patterns:
Logging Configuration:
# Enable detailed logging
settings:
logConsoleCommands: true
logPlayerCommands: true
# Database logging
DataSource:
backend: 'MYSQL'
logDb: true
# Security event logging
Security:
logFailedAttempts: true
logSuccessfulLogins: true
Key Metrics to Monitor:
- Failed login attempts per IP
- Multiple account registrations from same IP
- Rapid login/logout patterns
- Unusual login times/locations
- 2FA bypass attempts
9
Best Practices
Maintain strong authentication security:
- Regular updates: Keep AuthMe and related plugins current
- Strong passwords: Enforce minimum complexity requirements
- Backup authentication data: Secure database backups
- Staff training: Train moderators on authentication systems
- Regular audits: Review authentication logs weekly
- Emergency procedures: Plan for compromised accounts
- Clear instructions: Help players understand security features
Strong authentication is your first line of defense. Combine multiple security layers and educate your community about account security best practices.
Need More Help?
Our support team is available 24/7 to help with any Minecraft server issues.