sc-ssh
v1.0.5
Published
Automate SSH key setup and configuration
Downloads
7
Maintainers
Readme
sc-ssh
Automate SSH key setup and configuration
sc-ssh is a command-line tool that simplifies SSH key management and server configuration. It automates the process of generating SSH keys, copying them to remote servers, and updating your SSH config file, enabling password-less connections with a single command.
Features
- Interactive Setup: Guided prompts for configuring SSH access to new servers
- Cross-Platform: Works on Windows, Linux, and macOS
- Key Algorithms: Supports ed25519 (default) and RSA 4096-bit keys
- Config Management: Safely updates
~/.ssh/configwith backups - Server Management: List, test, and remove server configurations
- JSON Output: Supports machine-readable output for scripting
Installation
Install globally via npm:
npm install -g sc-sshRequirements
- Node.js >= 18.0.0
- OpenSSH client installed on your system
- Linux: Usually pre-installed
- macOS: Pre-installed
- Windows: Enable OpenSSH in Settings > Apps > Optional Features, or install from Microsoft
Quick Start
- Install the tool
- Run the setup command
- Follow the interactive prompts
- Connect to your server with
ssh <server-name>
sc-ssh setupUsage
Setup SSH Access
Configure SSH access to a new server interactively:
sc-ssh setupWith options:
sc-ssh setup --algorithm rsa --port 2222Options:
-a, --algorithm <type>: Key algorithm (ed25519orrsa, default:ed25519)-p, --port <number>: SSH port (default:22)-j, --json: Output in JSON format
List Configured Servers
View all configured SSH servers:
sc-ssh listWith verbose output (includes key paths):
sc-ssh list --verboseTest Connection
Verify SSH connection to a configured server:
sc-ssh test myserverWith custom timeout:
sc-ssh test myserver --timeout 30Remove Server
Remove a server configuration:
sc-ssh remove myserverForce removal without confirmation:
sc-ssh remove myserver --forceKeep SSH keys while removing config:
sc-ssh remove myserver --keep-keyManage Preferences
View current preferences:
sc-ssh config listGet a specific preference:
sc-ssh config get default-algorithmSet a preference:
sc-ssh config set default-algorithm rsa
sc-ssh config set default-port 2222Available preferences:
default-algorithm:ed25519orrsadefault-port: Port number (1-65535)auto-backup:trueorfalsecolor-output:trueorfalseuse-emoji:trueorfalse
Examples
Complete Setup Workflow
$ sc-ssh setup
Enter server name (alias): myserver
Enter server hostname or IP address: 192.168.1.100
Enter SSH port: 22
Enter SSH username: ubuntu
Enter server password (for initial key copy): ********
Choose SSH key algorithm: ed25519 (recommended)
✓ Generating ed25519 SSH key...
✓ SSH key generated: /home/user/.ssh/id_ed25519.myserver
✓ Copying public key to server...
✓ Public key copied successfully
✓ Backing up SSH config...
✓ Backup created: /home/user/.ssh/config.backup.20251107-143022
✓ Updating SSH config...
✓ SSH config updated
✅ Setup complete! You can now connect with:
ssh myserverList Servers
$ sc-ssh list
Configured SSH Servers:
┌────────────┬──────────────────┬──────┬──────────┬────────────┐
│ Server │ Hostname │ Port │ User │ Algorithm │
├────────────┼──────────────────┼──────┼──────────┼────────────┤
│ myserver │ 192.168.1.100 │ 22 │ ubuntu │ ed25519 │
│ production │ prod.example.com │ 2222 │ deploy │ rsa │
└────────────┴──────────────────┴──────┴──────────┴────────────┘
Total: 2 serversTest Connection
$ sc-ssh test myserver
Testing connection to 'myserver'...
✓ Connection successful!
Host: 192.168.1.100:22
User: ubuntu
Response time: 342msLibrary Usage
sc-ssh can also be used as a library in your Node.js projects:
const { setupSSH } = require('sc-ssh');
await setupSSH({
serverName: 'myserver',
hostname: '192.168.1.100',
port: 22,
username: 'ubuntu',
password: 'secret',
algorithm: 'ed25519',
});Development
Clone the repository and install dependencies:
git clone https://github.com/saulotarsobc/sc-ssh.git
cd sc-ssh
npm installBuild the project:
npm run buildRun tests:
npm testLicense
ISC
Contributing
Contributions are welcome! Please see the issues page for feature requests and bug reports.
Support
For support, please open an issue on GitHub.
