Install, configure, and harden the OpenSSH server.
Part of Nodevisor — TypeScript Infrastructure Automation Platform
npm install @nodevisor/sshimport $ from '@nodevisor/shell';
import SSH from '@nodevisor/ssh';
const $server = $.connect({ host: '10.0.0.10', username: 'root' });
const ssh = $server(SSH);
// Install OpenSSH server
await ssh.install();
// Disable password authentication (key-only login)
await ssh.disablePasswordAuthentication();
// Restart to apply changes
await ssh.restart();import $, { SSH, AuthorizedKeys } from 'nodevisor';
const $server = $.connect({ host: '10.0.0.10', username: 'root' });
// First, ensure SSH keys are in place
await $server(AuthorizedKeys).writeFromFile('~/.ssh/id_ed25519.pub');
// Then disable password authentication
await $server(SSH).disablePasswordAuthentication();| Method | Description |
|---|---|
install() |
Install the OpenSSH server package |
uninstall() |
Remove the OpenSSH server package |
isInstalled() |
Check if OpenSSH server is installed |
getVersion() |
Get the installed OpenSSH version |
start() |
Start the SSH service |
stop() |
Stop the SSH service |
restart() |
Restart the SSH service |
isRunning() |
Check if the SSH service is active |
@nodevisor/authorized-keys— Manage SSH keys before disabling passwords@nodevisor/services— Used internally for service management@nodevisor/packages— Used internally for package installation
Full documentation available at nodevisor.com/docs/packages/ssh
Nodevisor uses a single O'Saasy license across all packages and applications. See the full terms in LICENSE.

