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
11
votes
3 answers

Powershell takes a long time to load on start-up while loading ssh-agent / git

I have Powershell set to use posh-git through Git for Windows. In my profile file I have this: # If Posh-Git environment is defined, load it. . (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1") . $env:github_posh_git\profile.example.ps1 Every…
Florin Gogianu
  • 338
  • 4
  • 10
11
votes
3 answers

How do you decrypt SSH .pcap file that uses Diffie Hellman encryption. With public and private keys

How do you decrypt SSH .pcap file that uses Diffie Hellman encryption. With public and private keys. We are trying through Wireshark with no luck.
cchang
  • 119
  • 1
  • 1
  • 3
11
votes
4 answers

Python SSH / SFTP Module?

I've been looking around for a module which allows me to do SSH / SFTP functions in python without using POPEN to do it manually. Is there anything like this? I haven't found any real information on this, thanks!
rdegges
  • 32,786
  • 20
  • 85
  • 109
11
votes
3 answers

Git over ssh without Git being installed on server

I have full access to some folder on a remote Linux server over ssh and scp. I can upload and download files but not install apps. Now I want to put a git repository on this server. When I try to clone from an over scp copied repository I get the…
Mouk
  • 1,807
  • 2
  • 18
  • 26
11
votes
2 answers

Verbose logging for svn ssh connection

Does anyone one know how get SVN to log the details of the ssh connection when operating through an ssh connection? When I can't connect svn always gives me: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels]…
radman
  • 17,675
  • 11
  • 42
  • 58
11
votes
3 answers

How to copy a file in C/C++ with libssh and SFTP

I want to copy a file from a client to a remote server, but I don't understand how to do it with the libssh library SFTP API. The situation is that: The SSH session is open and the SFTP session is open too, I can create a file and write in it from…
user1869741
11
votes
2 answers

How to install git repository on Bluehost

I've tried pretty much anything I could find on Google, if you enter: bluehost git repository all of the results on first page and some on second, I've tried. Also I've tried this very useful tutorial but not to much help, 8 ways to share your git…
Alexxandar
  • 975
  • 2
  • 11
  • 23
11
votes
1 answer

Capturing exit code from sudo-run process

I have a script in which I'm meticulously checking return codes for error conditions, so that I can abort early in the event of a failure. One step of this script involves running a command as the root user on another box, via ssh and…
Michael Mol
  • 508
  • 1
  • 3
  • 17
11
votes
3 answers

which one is better wget or scp to copy files from one server to other?

I have to copy my all projects from one server to other. which one is better options : wget or scp ?
Obhaso
  • 449
  • 1
  • 4
  • 14
11
votes
11 answers

A command to download a file other than Wget

My host allows limited access to SSH and Linux commands. However, I can't use Wget believe it or not. I was hoping for something to download a file (.flv) from another server. Is there another command I can try? If there isn't, I could probably make…
Abs
  • 56,052
  • 101
  • 275
  • 409
11
votes
3 answers

Why does Fabric throw 'TypeError: argument must be an int, or have a fileno() method'?

When running a Fabric task on a remote server I get the following stack trace: [x.x.x.x] run: git fetch && git reset --hard origin/develop Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python2.6/threading.py",…
Fredrik
  • 726
  • 4
  • 11
11
votes
1 answer

Jenkins - Unable to git clone from slave node. SSH keys

I have just set up my first Jenkins slave. I run the build, and I hit problems with the SSH keys. The master Jenkins server is running under the user 'jenkins'. I have set up the SSH keys such that I can SSH from the master to the slave without a…
nonshatter
  • 3,347
  • 6
  • 23
  • 27
11
votes
1 answer

MSysGit and ssh config. missing

1) Run Git Bash (C:\Program Files (x86)\Git\bin\sh.exe --login) $ ssh -v git@github.com OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 debug1: Reading configuration data /c/Users/Alexander Fedorov/.ssh/config debug1: Applying options for…
Alexander
  • 781
  • 2
  • 9
  • 21
10
votes
1 answer

Cloning a Git repository over SFTP

I get a fatal error every time I try to clone my Git repository: I run this: $ git clone sftp://foo@bar.ca/git/foobar.git and I get this: fatal: Unable to find remote helper for 'sftp' I'm trying to clone from one server to another, both of which…
J K
  • 495
  • 2
  • 7
  • 22
10
votes
1 answer

Paramiko: Piping blocks forever on read

I have a problem with getting piping to work with paramiko. This works: ssh = paramiko.SSHClient() [...] stdin, stdout, stderr = ssh.exec_command("find /tmp") stdout.read() This does not work (blocks forever on stdout.read()): [...] stdin, stdout,…
hmn
  • 716
  • 7
  • 18