name: ssh-fleet-manager description: Safely connects to remote devices (Raspberry Pi/Linux) using Desktop Commander. Handles authentication, command execution, and log retrieval.
SSH Fleet Manager
This skill provides a robust, safe way to interact with remote devices without using raw shell commands.
It uses Desktop Commander to manage the SSH session, ensuring stability and preventing "Access Denied" errors.
Workflow
1. Identify Target
- Ask the user for the target IP address if not provided.
- Check for stored credentials (e.g., in
.envor a secure config file). - Default Credentials: User:
pi, Password:raspberry(or ask user).
2. Connect via Desktop Commander
- DO NOT run
sshorplinkdirectly in theShelltool. - USE
user-desktop-commander-start_processwith the command:plink -ssh -pw [PASSWORD] [USER]@[IP] "[COMMAND]"(Note: On Windows,plinkis preferred for automation. Ensure it's in the PATH or use the full path toplink.exe)
3. Execute Commands
- For simple commands (e.g.,
ls,cat), run them directly viaplink. - For complex tasks (e.g., deployment), consider using
scporrsyncviaDesktop Commander.
4. Retrieve Logs
- DO NOT use
tail -f(blocking). - USE
journalctl -u [SERVICE] -n [LINES] --no-pagerto get a snapshot. - Parse the output for errors or anomalies.
Example Usage
User: "Check the logs on the Pi." Agent:
- Identifies IP (e.g., 172.16.190.25).
- Constructs command:
plink -ssh -pw raspberry pi@172.16.190.25 "journalctl -u loadcell-transmitter -n 50 --no-pager" - Executes via
Desktop Commander. - Returns parsed logs.
Error Handling
- If
plinkfails with "Access Denied", ask the user for the correct password. - If the connection times out, verify the IP and network status.