Convert Figma logo to code with AI

openssh logoopenssh-portable

Portable OpenSSH

3,042
1,777
3,042
124

Top Related Projects

Win32 port of OpenSSH

1,314

the SSH library

The leading native Python SSHv2 protocol library.

5,501

SSH2 client and server modules written in pure JavaScript for node.js

Quick Overview

OpenSSH Portable is a free version of the SSH connectivity tools that has been adapted to work on a variety of Unix-like systems. It provides secure encrypted communication sessions over a computer network using the SSH protocol. This repository contains the portable version of OpenSSH, which is designed to be more easily compiled and run on various platforms beyond its native OpenBSD.

Pros

  • Widely used and trusted for secure remote access and file transfer
  • Supports multiple authentication methods, including public key and password
  • Regularly updated with security patches and improvements
  • Highly configurable to meet various security requirements

Cons

  • Can be complex to set up and configure for advanced use cases
  • Some features may not be available or may behave differently on certain platforms
  • Requires careful management of keys and configurations to maintain security
  • May have compatibility issues with older systems or non-standard implementations

Getting Started

To compile and install OpenSSH Portable on a Unix-like system:

# Clone the repository
git clone https://github.com/openssh/openssh-portable.git
cd openssh-portable

# Configure and compile
autoreconf
./configure
make

# Install (requires root privileges)
sudo make install

# Start the SSH daemon
sudo /usr/local/sbin/sshd

# Connect to a remote host
ssh user@hostname

Note: These instructions are basic and may need to be adjusted based on your specific system and requirements. Always refer to the official documentation for the most up-to-date and detailed information.

Competitor Comparisons

Win32 port of OpenSSH

Pros of Win32-OpenSSH

  • Native Windows integration and support
  • Optimized for Windows environments and PowerShell
  • Easier installation and configuration for Windows users

Cons of Win32-OpenSSH

  • Limited cross-platform compatibility
  • Smaller community and potentially slower development cycle
  • May lack some features present in the original OpenSSH

Code Comparison

openssh-portable:

#ifdef HAVE_CYGWIN
    if (is_winnt)
        cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
#endif

Win32-OpenSSH:

if ($IsWindows) {
    $sshd = Get-Service sshd -ErrorAction SilentlyContinue
    if ($sshd.Status -eq "Running") {
        Write-Host "OpenSSH Server is already running."
    }
}

The code snippets demonstrate the different approaches to handling Windows-specific functionality. openssh-portable uses conditional compilation for Cygwin support, while Win32-OpenSSH utilizes PowerShell cmdlets for native Windows integration.

Win32-OpenSSH focuses on providing a seamless experience for Windows users, with better integration and easier setup. However, it may lack the extensive cross-platform support and feature set of openssh-portable. The choice between the two depends on the specific use case and target environment.

1,314

the SSH library

Pros of libssh2

  • Lightweight and focused library for SSH protocol implementation
  • Easy integration into existing applications
  • Cross-platform support with minimal dependencies

Cons of libssh2

  • Limited feature set compared to OpenSSH
  • Smaller community and less frequent updates
  • May require additional work for advanced SSH functionalities

Code Comparison

OpenSSH (openssh-portable):

int
ssh_userauth_pubkey(struct ssh *ssh, const char *authctxt,
    const char *keyalg, const u_char *pkblob, u_int pkbloblen,
    const u_char *sig, u_int siglen)
{
    // Implementation details
}

libssh2:

int
libssh2_userauth_publickey_fromfile(LIBSSH2_SESSION *session,
                                    const char *username,
                                    const char *publickey,
                                    const char *privatekey,
                                    const char *passphrase)
{
    // Implementation details
}

The code snippets show different approaches to public key authentication. OpenSSH uses a more low-level implementation, while libssh2 provides a higher-level function for ease of use.

The leading native Python SSHv2 protocol library.

Pros of Paramiko

  • Pure Python implementation, making it easy to integrate into Python projects
  • Cross-platform compatibility without external dependencies
  • Simpler API for SSH operations in Python

Cons of Paramiko

  • Generally slower performance compared to OpenSSH
  • May lack some advanced features and security updates found in OpenSSH
  • Limited support for newer SSH protocol extensions

Code Comparison

OpenSSH (C):

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

int
main(int argc, char *argv[])
{
    // SSH connection setup code
}

Paramiko (Python):

import paramiko

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('hostname', username='user', password='password')
stdin, stdout, stderr = ssh.exec_command('ls -l')

OpenSSH is a comprehensive, widely-used SSH implementation written in C, offering high performance and extensive features. Paramiko, on the other hand, is a Python library that provides a more accessible interface for SSH operations in Python environments. While OpenSSH is typically faster and more feature-rich, Paramiko offers easier integration for Python developers and cross-platform compatibility without additional dependencies. The choice between the two depends on the specific requirements of the project, such as performance needs, language preferences, and desired features.

5,501

SSH2 client and server modules written in pure JavaScript for node.js

Pros of ssh2

  • Written in JavaScript, making it easier to integrate with Node.js applications
  • Provides a higher-level API for SSH operations, simplifying implementation
  • Supports various SSH functionalities like SFTP and port forwarding

Cons of ssh2

  • May have performance limitations compared to native C implementations
  • Potentially less secure due to a smaller community and fewer security audits
  • Limited platform support compared to OpenSSH's wide range of supported systems

Code Comparison

ssh2 (JavaScript):

const Client = require('ssh2').Client;
const conn = new Client();
conn.on('ready', () => {
  console.log('Connection :: ready');
}).connect({
  host: 'localhost',
  port: 22,
  username: 'user',
  password: 'password'
});

OpenSSH (C):

#include <libssh/libssh.h>
ssh_session my_ssh_session = ssh_new();
if (my_ssh_session == NULL) exit(-1);
ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, "localhost");
ssh_connect(my_ssh_session);
ssh_userauth_password(my_ssh_session, NULL, "password");

While ssh2 provides a more JavaScript-friendly API, OpenSSH offers a lower-level implementation with potentially better performance and security. The choice between them depends on the specific requirements of the project, such as language preference, performance needs, and security considerations.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Portable OpenSSH

C/C++ CI Fuzzing Status Coverity Status

OpenSSH is a complete implementation of the SSH protocol (version 2) for secure remote login, command execution and file transfer. It includes a client ssh and server sshd, file transfer utilities scp and sftp as well as tools for key generation (ssh-keygen), run-time key storage (ssh-agent) and a number of supporting programs.

This is a port of OpenBSD's OpenSSH to most Unix-like operating systems, including Linux, OS X and Cygwin. Portable OpenSSH polyfills OpenBSD APIs that are not available elsewhere, adds sshd sandboxing for more operating systems and includes support for OS-native authentication and auditing (e.g. using PAM).

Documentation

The official documentation for OpenSSH are the man pages for each tool:

Stable Releases

Stable release tarballs are available from a number of download mirrors. We recommend the use of a stable release for most users. Please read the release notes for details of recent changes and potential incompatibilities.

Building Portable OpenSSH

Dependencies

Portable OpenSSH is built using autoconf and make. It requires a working C compiler, standard library and headers.

libcrypto from either LibreSSL or OpenSSL may also be used. OpenSSH may be built without either of these, but the resulting binaries will have only a subset of the cryptographic algorithms normally available.

zlib is optional; without it transport compression is not supported.

FIDO security token support needs libfido2 and its dependencies and will be enabled automatically if they are found.

In addition, certain platforms and build-time options may require additional dependencies; see README.platform for details about your platform.

Building a release

Releases include a pre-built copy of the configure script and may be built using:

tar zxvf openssh-X.YpZ.tar.gz
cd openssh
./configure # [options]
make && make tests

See the Build-time Customisation section below for configure options. If you plan on installing OpenSSH to your system, then you will usually want to specify destination paths.

Building from git

If building from git, you'll need autoconf installed to build the configure script. The following commands will check out and build portable OpenSSH from git:

git clone https://github.com/openssh/openssh-portable # or https://anongit.mindrot.org/openssh.git
cd openssh-portable
autoreconf
./configure
make && make tests

Build-time Customisation

There are many build-time customisation options available. All Autoconf destination path flags (e.g. --prefix) are supported (and are usually required if you want to install OpenSSH).

For a full list of available flags, run ./configure --help but a few of the more frequently-used ones are described below. Some of these flags will require additional libraries and/or headers be installed.

FlagMeaning
--with-pamEnable PAM support. OpenPAM, Linux PAM and Solaris PAM are supported.
--with-libeditEnable libedit support for sftp.
--with-kerberos5Enable Kerberos/GSSAPI support. Both Heimdal and MIT Kerberos implementations are supported.
--with-selinuxEnable SELinux support.

Development

Portable OpenSSH development is discussed on the openssh-unix-dev mailing list (archive mirror). Bugs and feature requests are tracked on our Bugzilla.

Reporting bugs

Non-security bugs may be reported to the developers via Bugzilla or via the mailing list above. Security bugs should be reported to openssh@openssh.com.