ssh - Secure Shell Accesso remoto
Traduzione: Copia tutti i comandi
Traduzione: Generare PDF
< >
Comandi SSH completi per l'accesso remoto sicuro, il tunneling e l'amministrazione di sistema su tutte le piattaforme.
## Connessione di base
### Connessione semplice
| | Command | Description | |
| --- | --- |
| | `ssh user@hostname` | Connect to remote host | |
| | `ssh user@192.168.1.100` | Connect using IP address | |
| | `ssh -p 2222 user@hostname` | Connect to custom port | |
| | `ssh hostname` | Connect with current username | |
### Opzioni di connessione
| | Command | Description | |
| --- | --- |
| | `ssh -v user@hostname` | Verbose output for debugging | |
| | `ssh -vv user@hostname` | More verbose output | |
| | `ssh -vvv user@hostname` | Maximum verbosity | |
| | `ssh -q user@hostname` | Quiet mode (suppress warnings) | |
## Metodi di autenticazione
### Autenticazione della password
Traduzione:
### Autenticazione basata su chiave
Traduzione:
### Gestione chiave
| | Command | Description | |
| --- | --- |
| | `ssh-keygen -t ed25519` | Generate Ed25519 key (recommended) | |
| | `ssh-keygen -t rsa -b 4096` | Generate 4096-bit RSA key | |
| | `ssh-keygen -f ~/.ssh/custom_key` | Generate key with custom name | |
| | `ssh-add ~/.ssh/private_key` | Add key to SSH agent | |
| | `ssh-add -l` | List loaded keys | |
| | `ssh-add -D` | Remove all keys from agent | |
## Configurazione
### Configurazione client SSH (~/.ssh/config)
Traduzione:
### Opzioni di configurazione comuni
| | Option | Description | Example | |
| --- | --- | --- |
| | `HostName` | Real hostname or IP | `HostName server.example.com` | |
| | `User` | Username for connection | `User admin` | |
| | `Port` | SSH port number | `Port 2222` | |
| | `IdentityFile` | Private key file | `IdentityFile ~/.ssh/id_rsa` | |
| | `ForwardAgent` | Enable agent forwarding | `ForwardAgent yes` | |
| | `Compression` | Enable compression | `Compression yes` | |
## Port Forwarding e Tunneling
### Inoltro del porto locale
Traduzione:
### Inoltro della porta remota
Traduzione:
### Inoltro dinamico della porta (SOCKS Proxy)
Traduzione:
### X11 Inoltro
Traduzione:
## Integrazione del trasferimento file
### SCP Integrazione
Traduzione:
### SFTP Integrazione
Traduzione:
## Caratteristiche avanzate
### Jump Hosts and Bastion Servers
Traduzione:
### Agente SSH e gestione delle chiavi
Traduzione:
### Connessione Multiplexing
Traduzione:
## Sicurezza e indurimento
### Opzioni di connessione sicure
#
### Verifica chiave host
Traduzione:
### Autenticazione basata sul certificato
Traduzione:
## Risoluzione dei problemi
### Problemi di connessione
Traduzione:
### Problemi e soluzioni comuni
| | Problem | Symptoms | Solution | |
| --- | --- | --- |
| | Permission denied | Authentication fails | Check key permissions (600 for private key) | |
| | Connection timeout | No response | Check firewall, network connectivity | |
| | Host key verification failed | Key mismatch warning | Update known_hosts or verify host identity | |
| | Agent forwarding not working | Keys not available on remote | Enable ForwardAgent in config | |
### Emissioni chiave
Traduzione:
## Automazione e scrittura
### Non interattivo SSH
Traduzione:
### Operazioni batch
Traduzione:
### SSH con attesa (Automazione password)
Traduzione:
## Ottimizzazione delle prestazioni
### Compressione e velocità
Traduzione:
### Persistenza del collegamento
Traduzione:
## Considerazioni specifiche della piattaforma
### Windows (OpenSSH)
Traduzione:
### macOS Keychain Integrazione
Traduzione:
## Migliori Pratiche
### Sicurezza
1. ** Utilizzare l'autenticazione chiave**: Disattivare l'autenticazione password
2. **Le chiavi robuste**: Usare Ed25519 o RSA 4096-bit chiavi
3. **Key Rotation**: ruotare regolarmente i tasti SSH
4. **Principio del minimo privilegio**: accesso utente limitato
5. **Monitor Access**: Accedi e monitora le connessioni SSH
### Gestione della configurazione
1. **Configurazione centralizzata**: Usa ~/.ssh/config per impostazioni comuni
2. **Host Aliases**: Creare alias host significativi
3. **Connection Multiplexing** Riutilizzare le connessioni per l'efficienza
4. Agent Forwarding. Usare con attenzione, solo quando necessario
5. **Documentazione**: Configurazioni personalizzate per documenti
### Operazione
1. ♪Backup Keys ♪ Backup sicuro chiavi private
2. **Test Connections**: prova regolarmente l'accesso SSH
3. **Aggiornamento software**: Tenere aggiornato il client/server SSH
4. ♪Monitor Logs ♪ Guarda per attività sospette
5. ** Accesso all'emergenza**: Mantenere metodi di accesso alternativi