Skip to main content
AllDevToolsHub
Back to all workflows
DevOps Solution

Linux Server Configuration: Permissions & Cron

Calculate file permissions, build cron job schedules, and generate SSH keys for server setup.

Overview

Configuring a new Linux server requires setting correct file permissions, scheduling automated tasks with cron, and generating SSH keys for secure access. This workflow handles all three configuration tasks.

Step-by-Step Implementation

1

Chmod CalculatorDevelopment Tools

Calculate the correct chmod numeric value (e.g., 755, 644) for your files and directories with a visual permission builder.

2

Cron Job Expression GeneratorDevelopment Tools

Build a cron expression for your scheduled tasks and verify it matches the intended schedule (e.g., '0 2 * * *' for 2am daily).

3

SSH Key GeneratorGenerators

Generate an ED25519 SSH key pair for passwordless authentication. Copy the public key to your server's authorized_keys.

Workflow Complete!

You've successfully processed your data using AllDevToolsHub.

Quick Summary

First-day-on-a-new-Linux-server checklist: lock down file permissions (755 for dirs, 644 for files, 600 for keys), schedule maintenance via cron, generate an ED25519 SSH key pair, and disable password auth. Get these three right and you've avoided the most common shared-server compromises.

Key Takeaways

Key Takeaways

  • 755 / 644 are the safe defaults for dirs / files; only loosen with a specific reason.
  • SSH private keys must be 600 (`rw-------`); SSH refuses to use a key with looser permissions.
  • ED25519 keys are faster and smaller than RSA, preferred unless you need RSA for legacy clients.
  • Cron uses 5 fields: `minute hour day-of-month month day-of-week`. Test expressions before deploying.
  • Disable password auth (`PasswordAuthentication no` in `sshd_config`) once SSH keys are working, kills 99% of bot attacks.
Use Cases

When to use it

  • Initial hardening of a new VPS (DigitalOcean, Hetzner, Linode).
  • Setting up automated database backups via cron with proper key-based access.
  • Troubleshooting 'Permission denied' errors on a deployment that worked yesterday.
  • Generating per-deploy SSH keys for CI/CD systems that need server access.
Watch out

Common Mistakes

  • Setting `chmod 777` to 'make it work', open invitation to attackers.
  • Storing cron jobs in `/etc/crontab` and personal crontabs simultaneously, diverging sources of truth.
  • Forgetting that cron runs with a minimal `PATH`, always use absolute paths in scripts.
  • Generating RSA-1024 SSH keys, RSA below 2048 bits is broken; ED25519 is the modern default.
FAQ

Linux Server Configuration: Permissions & Cron, Frequently Asked

ED25519 vs RSA SSH keys?

ED25519 for new keys, shorter, faster, equally secure. RSA-4096 is fine for legacy compatibility. Avoid RSA-2048 and below in 2026.

How do I debug cron jobs that don't run?

Check `/var/log/syslog` (or `journalctl -u cron`). Most common: missing PATH, output not redirected (cron mails it to nobody), or running as a user without permissions for the target script.

What's the difference between `chmod 755` and `chmod u=rwx,go=rx`?

They're identical, one is octal notation, the other is symbolic. Octal is faster for setting absolute permissions; symbolic is better for relative changes (`chmod +x` adds execute without touching others).