Home

Awesome

PHP SSH Tools

Manage SSH keys and connection profiles, and connect to SSH and SFTP servers with a 100% pure PHP-based command-line all-in-one solution. MIT or LGPL.

Donate Discord

Features

Getting Started

The command-line interface is question/answer enabled, which means all you have to do is run:

php ssh.php

Which will enter interactive mode and guide you through the entire process.

Once you grow tired of manually entering information, you can pass in some or all of the answers to the questions on the command-line:

php ssh.php keys list

php ssh.php keys create

php ssh.php -s keys create name=www.domain.com bits=4096

The -s option suppresses normal output (except for fatal error conditions), which allows for the processed JSON result to be the only thing that is output.

System SSH Support

Even though there is built-in SSH support, some people might prefer using their system's included SSH client. To do that:

php ssh.php connect shell-system

'ssh' must be on the path. If you run Windows, you can run either of these commands from the same directory as 'ssh.php':

git clone https://github.com/cubiclesoft/ssh-win64.git

git clone https://github.com/cubiclesoft/ssh-win32.git

To get a self-contained 'ssh.exe' binary so that 'shell-system' works.

Known Issues

Under the hood of this tool is the mostly excellent phpseclib library. The library is the swiss army knife of crypto libraries for PHP and includes a not quite complete SSH 2 implementation. SSH/SFTP are complex protocols (RFC4251, RFC4252, RFC4253, RFC4254, draft-ietf-secsh-filexfer-13). The following is a list of known issues regarding SSH/SFTP connections: