https://github.com/bocaletto-luca/server-and-client
Remote-Cmd is a lightweight client-server app written in C that lets you securely execute remote shell commands with authentication, syslog logging, optional system update, IPv4/IPv6 support, and dry-run mode. Designed for Linux Debian environments with zero external dependencies.
https://github.com/bocaletto-luca/server-and-client
admin bocaletto-luca client debian linux opensource server system system-tools tools
Last synced: about 1 month ago
JSON representation
Remote-Cmd is a lightweight client-server app written in C that lets you securely execute remote shell commands with authentication, syslog logging, optional system update, IPv4/IPv6 support, and dry-run mode. Designed for Linux Debian environments with zero external dependencies.
- Host: GitHub
- URL: https://github.com/bocaletto-luca/server-and-client
- Owner: bocaletto-luca
- License: gpl-3.0
- Created: 2025-06-13T05:34:14.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-13T06:04:01.000Z (12 months ago)
- Last Synced: 2025-06-13T06:36:23.314Z (12 months ago)
- Topics: admin, bocaletto-luca, client, debian, linux, opensource, server, system, system-tools, tools
- Language: C
- Homepage: https://bocaletto-luca.github.io/
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Server & Client
#### Author: Bocaletto Luca
# 🔧 Remote-Cmd v3
**Server & Client in C con autenticazione, syslog e graceful shutdown**
---
## ⚙️ Compilazione
compila il server:
gcc -Wall -O2 -pthread -o server server.c
compila il client:
gcc -Wall -O2 -o client client.c
---
## 🚀 Avvio Server
# Avvio con autenticazione e aggiornamento del sistema
sudo ./server -k mysecret -u
# Modalità dry-run (non esegue comandi reali)
./server -k mysecret -d
---
## 🧪 Connessione Client
# Dry-run (visualizza i comandi senza inviarli)
./client -h 127.0.0.1 -p 12345 -k mysecret -d
# Connessione reale
./client -h 127.0.0.1 -p 12345 -k mysecret
Esempio interazione:
ls -l
uname -a
exit
---
## 🔐 Autenticazione
Il server richiede un token di autenticazione passato via `-k mysecret`.
Il client lo invia alla connessione. In caso di token errato, riceverà `AUTH_FAIL`.
---
## ⚙️ Opzioni Server
-p, --port PORT porta di ascolto (default 12345)
-k, --key TOKEN token di autenticazione (obbligatorio)
-u, --update esegue apt-get update && upgrade -y
-d, --dry-run stampa i comandi senza eseguirli
-s, --syslog abilita log su syslog
-V, --version mostra la versione
-h, --help mostra l'aiuto
---
## ⚙️ Opzioni Client
-h, --host HOST IP o hostname del server
-p, --port PORT porta TCP del server
-k, --key TOKEN token di autenticazione
-d, --dry-run stampa i comandi senza inviarli
-V, --version mostra la versione
-?, --help mostra l'aiuto
---
## 📝 Note
- Il server supporta IPv4/IPv6, multi-client con thread, chiusura controllata via SIGINT/SIGTERM.
- Tutti i comandi ricevuti vengono eseguiti via `popen()` e il loro output è reinviato al client.
- Il client si comporta come una shell remota semplificata.
- La connessione termina scrivendo `exit`.
---
Bocaletto Luca – Software libero scritto in C, nessuna dipendenza esterna, compatibile con Debian/Linux.