Questions tagged [ssh]

GENERAL SSH SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. Secure Shell (SSH) is a cryptographic network protocol for secure data communication. Use this tag for programming questions related to Secure Shell. Common authentication and configuration problems are off-topic for Stack Overflow.

Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that it connects via a secure channel over an insecure network: a server and a client (running SSH server and SSH client programs, respectively). The protocol specification distinguishes two major versions that are referred to as SSH-1 and SSH-2.

SSH was designed as a replacement for Telnet and other insecure remote shell protocols such as the Berkeley rsh and rexec protocols, which send information, notably passwords, in plaintext, rendering them susceptible to interception and disclosure using packet analysis. The encryption used by SSH is intended to provide confidentiality and integrity of data over an unsecured network, such as the Internet, although files leaked by Edward Snowden indicate that the National Security Agency can sometimes decrypt SSH.

SSH uses public-key cryptography to authenticate the remote computer and allow it to authenticate the user, if necessary. There are several ways to use SSH; one is to use automatically generated public-private key pairs to simply encrypt a network connection and then use password authentication to log on.

Another is to use a manually generated public-private key pair to perform the authentication. This method allows users or programs to log in without having to specify a password. Anyone can produce a matching pair of different keys (public and private). The public key is placed on all computers that must allow access to the owner of the matching private key (the owner keeps the private key secret). Although authentication is based on the private key, the key itself is never transferred through the network during authentication. SSH only verifies whether the same person offering the public key also owns the matching private key.

In all versions of SSH it is important to verify unknown public keys, i.e. associate the public keys with identities, before accepting them as valid. Accepting an attacker's public key without validation will authorize an unauthorized attacker as a valid user.

Useful Links

Server Implementations

Client Implementations

Libraries

29979 questions
10
votes
5 answers

SSH to machine through a middle host

In my work with my professor I have to ssh into our server and from there I ssh into each node to run our programs. I am trying to write a python program that will let me do everything that I need to do on the remote node from my local machine. The…
Russss
  • 103
  • 1
  • 7
10
votes
2 answers

How to disable ProxyCommand for one particular host?

Using OpenSSH, I have set my /etc/ssh/ssh_config to have a ProxyCommand so all SSH connections go through that proxy. /etc/ssh/ssh_config: Host * ProxyCommand nc -X connect -x localhost:8111 %h %p But I would like to disable the proxy for one…
Pierre
  • 580
  • 3
  • 19
10
votes
1 answer

Connecting Visual Studio Code (VSCode) to VirtualBox VM

I've been using WSL to debug C in VSCode, using Ubuntu from the Windows Store. However, because my school projects must be able to run on a provided Virtual Machine (Lubuntu, in this case), it would be of great help if I could debug my code on…
cabralpinto
  • 1,814
  • 3
  • 13
  • 32
10
votes
6 answers

Running commands over ssh with Java

Scenerio: I'd like to run commands on remote machines from a Java program over ssh (I am using OpenSSH on my development machine). I'd also like to make the ssh connection by passing the password rather than setting up keys as I would with…
Ichorus
  • 4,567
  • 6
  • 38
  • 46
10
votes
2 answers

Git is looking for a wrong SSH key

I decided to try using SSH to work with my GitHub repos. I modified remote url in git/.config, so now it uses SSH: [remote "origin"] url = git@github.com:keddad/passpoint_server.git fetch = +refs/heads/*:refs/remotes/origin/* But…
keddad
  • 1,398
  • 3
  • 14
  • 35
10
votes
1 answer

What is the difference between exec_command and send with invoke_shell() on Paramiko?

So what is the difference between SSHClient.exec_command() and send with SSHClient.invoke_shell on Paramiko? I can send and execute command with exec_command to MikroTik router device but can't execute it with send (invoke_shell()). On the other…
Adhy
  • 177
  • 1
  • 1
  • 10
10
votes
4 answers

Fastlane match cannot connect over SSH

Existing solutions I've searched SO and Github extensively before asking my question. None of the existing topics present any working solutions for our setup. Configuration We've got Jenkins + Fastlane configured on a remote macOS machine. Fastlane…
mmvie
  • 2,571
  • 7
  • 24
  • 39
10
votes
4 answers

How can I keep a python script on a remote server running after closing out of SSH?

I've coded a stock trading bot in Python3. I have it hosted on a server (Ubuntu 18.10) that I use iTerm to SSH into. Wondering how to keep the script actively running so that when I exit out of my session it won't kill the active process.…
David D
  • 103
  • 1
  • 4
10
votes
1 answer

Paramiko/cryptography deprecation warnings: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers

I keep getting the following deprecation warnings when doing simple SSH connections: 2019-03-04 02:21:14 [transport] INFO : Connected (version 2.0, client OpenSSH_7.4) /usr/local/lib/python2.7/site-packages/paramiko/kex_ecdh_nist.py:39: …
mbenhalima
  • 722
  • 1
  • 9
  • 20
10
votes
3 answers

Git push over ssh fails on windows with 'the remote end hung up unexpectedly' error

I'm hoping someone can help me, as I've been fighting with this for days, and am stumped. I've set up the standard git client (from git-scm.com) on a brand new laptop running Windows 10, and am working on a repository hosted on…
john-shaskin
  • 242
  • 2
  • 10
10
votes
2 answers

Docker SSH forwarding - bind: Address not available

I have a Docker container, which I would like to be able to interact with a database trough a SSH tunnel. My Docker image is built on an alpine image and in the Dockerfile I have installed openssh-client and exposed port 27017 When I spin up my…
ChrKong
  • 101
  • 1
  • 7
10
votes
2 answers

Azure DevOps Build Submodule

I have a private bitbucket repo that is connected to the Azure DevOps Build Pipeline. The private repo has a submodule connected to a public Github repo. Both repositories are accessed via SSH. I have ticked the clone submodules box in DevOps. How…
Dean Marcussen
  • 597
  • 4
  • 15
10
votes
1 answer

Ansible stops connecting to the host via ssh

Introduction For over a month I've been running the following command: ansible-playbook -vvvvi host_test rhel-tests.yml Which connected via SSH and ran tests on a host successfully without any problems. But as of the last couple days, I've received…
karobar
  • 1,250
  • 8
  • 30
  • 61
10
votes
14 answers

Sender and receiver to transfer files over ssh on request?

I created a program that iterates over a bunch of files and invokes for some of them: scp user@host: However, in my case, there may be thousands of small files that need to transferred, and scp is opening a new ssh connection for…
Bruno De Fraine
  • 45,466
  • 8
  • 54
  • 65
10
votes
1 answer

"Sudo su - weblogic" via a Java Program?

I am trying to connect my remote unix machine and execute some ssh commands using a java program. connection = new Connection(hostname); connection.connect(); boolean isAuthenticated =…
Bharat
  • 750
  • 1
  • 9
  • 20