Skip to content

SSH Configuration

Nicholas Cheek edited this page Jun 14, 2025 · 1 revision

SSH Configuration

Laravel Log Parser integrates with your existing SSH configuration to access remote servers seamlessly.

SSH Config File

The tool reads your SSH configuration from ~/.ssh/config. Here's how to set it up:

Basic Configuration

Host production HostName 10.1.2.3 User ubuntu Port 22 IdentityFile ~/.ssh/production-key.pem

Host staging HostName staging.company.com User deploy Port 2222 IdentityFile ~/.ssh/staging-key.pem

Advanced Configuration

Host web-* User ubuntu Port 22 IdentityFile ~/.ssh/web-servers.pem

Host web-prod HostName 10.1.2.3

Host web-staging HostName 10.1.2.4

Using SSH Hosts

Once configured, reference hosts by their alias:

Parse logs from production server

logparse production

Parse logs from staging server

logparse staging

Use with filtering

logparse production --errors-only --since=today

Custom Remote Paths

If your Laravel logs are not in the default location:

Custom log path

logparse --remote-path="app/storage/logs/laravel.log" production

Different log file

logparse --remote-path="logs/application.log" staging

SSH Authentication

The tool supports all SSH authentication methods:

  • SSH keys (recommended)
  • SSH agent
  • Password authentication (interactive)
  • SSH certificates

Connection Testing

Test SSH connectivity:

Test SSH connection manually

ssh production "echo 'Connection successful'"

Test with logparse

logparse production --last=1

Troubleshooting SSH

Permission Denied

  • Verify SSH key permissions: chmod 600 ~/.ssh/your-key.pem
  • Check SSH config syntax: ssh -F ~/.ssh/config production

Host Not Found

  • Verify SSH config file exists and is readable
  • Check host alias spelling
  • Test direct SSH connection first

Connection Timeout

  • Verify network connectivity
  • Check firewall rules
  • Confirm SSH daemon is running on target server

Custom SSH Config Location

logparse --ssh-config="/path/to/custom/config" hostname

Clone this wiki locally