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
6 answers

Need to run 'composer update' on ssh on hostgator, but php -v to low

Need Help Framework - Laravel Hosting - Hostgator Problem Statement :- I need to run the 'composer update'. All dependencies required minimun php -v of 5.5.9. I have manualy Upgrade the php version of Project directory to 5.6 from cpanel using…
Ehtasham Malik
  • 101
  • 1
  • 1
  • 5
10
votes
5 answers

Using "KexAlgorithms diffie-hellman-group1-sha1" did not resolve "no matching key exchange method found" error

There's a lot of questions about the following error, but they all have same solution which did not have any effect: $ git push Unable to negotiate with 192.168.XXX.XXX: no matching key exchange method found. Their offer:…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
10
votes
3 answers

Start interactive SSH session from Python script

I'd like to start an interactive SSH terminal from a Python script without using modules like pexpect or paramiko - I want to stick with what CentOS pre-installed Python provides me (to ease compatibility and deployment issues). I can run commands…
sholsapp
  • 15,542
  • 10
  • 50
  • 67
10
votes
1 answer

run composer and laravel (artisan) commands without ssh access

I want to test some Laravel applications on my basic shared host. Currently I just upload my complete application including the vendor files, however this takes quite long. Since I do not have ssh access to my host I'd like to know whether there's…
Frnak
  • 6,601
  • 5
  • 34
  • 67
10
votes
4 answers

Jenkins hangs at git fetch

I'm a beginner with Jenkins and I'm trying to get it to run some unit tests in my.NET project. When I run a build it hangs when trying to fetch from the Git repository. ERROR: Timeout after 10 minutes > C:\Program Files\Git\cmd\git.exe config…
mogoli
  • 2,153
  • 6
  • 26
  • 41
10
votes
2 answers

Paramiko / scp - check if file exists on remote host

I'm using Python Paramiko and scp to perform some operations on remote machines. Some machines I work on require files to be available locally on their system. When this is the case, I'm using Paramiko and scp to copy the files across. For…
Mark
  • 1,277
  • 3
  • 13
  • 27
10
votes
9 answers

Java: InvalidAlgorithmParameterException Prime size must be multiple of 64

I implemented a Java program that will connect and execute a command in a remote server using JSCH. The problem is that whenever I tried to connect to the server, I got the following exception: com.jcraft.jsch.JSchException: Session.connect:…
Vaanz
  • 175
  • 1
  • 2
  • 14
10
votes
4 answers

Using wget to download a ZIP file

I'm having trouble using wget for my Debian 7.0 VPS server hosted by OVH. I'm trying to download a ZIP file from MediaFire, and when I connected via SSH I typed, wget…
Logan Butler
  • 159
  • 1
  • 2
  • 9
10
votes
6 answers

Why can't terraform SSH in to EC2 Instance using supplied example?

I'm using the AWS Two-tier example and I've direct copy-n-pasted the whole thing. terraform apply works right up to where it tries to SSH into the created EC2 instance. It loops several times giving this output before finally…
n8gard
  • 1,870
  • 8
  • 26
  • 41
10
votes
5 answers

pysftp AuthenticationException while connecting to server with private key

I am trying to connect to SFTP server. I have a private key along with a password. I have tried to read related questions on SO, but have been unable to successfully connect. This is what I have tried: pysftp.Connection(host=,…
heathensoul
  • 291
  • 1
  • 2
  • 7
10
votes
2 answers

How to establish a simple ssh connection with c++

I am trying to make a c++ program which will connect to an ssh server (my laptop). The server is ok because I can get connected via putty. Although the program I wrote so far can not. In my code I am using the library libssh.h and for development I…
mac johnsto
  • 123
  • 1
  • 1
  • 8
10
votes
1 answer

JSch to add private key from a string

I have the contents of the key pair file for SFTP as a string. I need to use JSch to add the contents, but addIdentity only accepts a file path. Is there anyway I can do this? I see that the KeyPair class has a method - KeyPair load(JSch jsch,…
eechpeech
  • 255
  • 1
  • 4
  • 17
10
votes
4 answers

PHP connect via SSH tunnel to LDAP in other network

I'm developing website for my school. In that school we authenticate users via LDAP, so there was an idea to do the same via school-site. On that site everything is working perfectly, but during developing I need very often to test if such solution…
Hfaua
  • 103
  • 1
  • 7
10
votes
3 answers

pssh, Time out, killed by signal 9

I am using PSSH to run command on other machines to implementing parallel compute using IPyParallel, but I encountered a problem, my command is pssh -P -h ip.txt -i ipengine --file=~/parallel/test/ipcontroller-engine.json And after a while, it…
GoingMyWay
  • 16,802
  • 32
  • 96
  • 149
10
votes
1 answer

ssh-agent suddenly "lost" my key

I'm using Git on Windows, and a week ago I set up my SSH keys. I cloned my repos and it worked fine. Then, today I tried to make a pull and this happens: $ git pull Permission denied (publickey). fatal: Could not read from remote repository. Please…
athosbr99
  • 463
  • 2
  • 7
  • 24