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

How can I use Emacs tramp to ssh to a remote host and edit a file as another user on an ad-hoc basis?

/multi used to work for me, now it's gone and I'm frustrated. What I want to do is, in my dream world: /myuser@remotehost:sudo:anotheruser:/some/path/to/file ...and have ido-mode work. The key thing here is that 'myuser', 'remotehost' and…
Chris Withers
  • 10,837
  • 4
  • 33
  • 51
10
votes
6 answers

Python to emulate remote tail -f?

We have several application servers, and a central monitoring server. We are currently running ssh with "tail -f" from the monitoring server to stream several text logfiles in realtime from the app servers. The issue, apart from the brittleness of…
victorhooi
  • 16,775
  • 22
  • 90
  • 113
10
votes
1 answer

What is the difference between vscode remote-ssh and remote-tunnel connections

How does VSCODE's Remote SSH compare against Remote Tunnels for development in terms of speed and code protection? At a glance, it appears that SSH shares the workload (extension) across both machines While the Remote Tunnel works entirely on the…
10
votes
1 answer

How to verify ssh key on Gitlab.com

I'm setting up a SSH key for the first time on Gitlab.com. I'm stuck at verifying that you can connect: ssh -T git@gitlab.example.com. The gitlab.example.com you are supposed to replace with your Gitlab instance url but I keep getting "ssh: Could…
Marty
  • 2,132
  • 4
  • 21
  • 47
10
votes
1 answer

Q: Sourcetree error : 'git status' failed with code -1"

Sourcetree showing this error 'git status' failed with code -1" while trying access project from bookmark, also I can't clone any other project from remote list or manual by url. SSH connection is good. Command ssh -T git@github.com showing - Hi…
devkamil
  • 351
  • 3
  • 6
10
votes
3 answers

How to resolve a timeout exception when TeamCity fetches changes from a SSH Git repository

I've moved a Git repository from a shared folder on the network to a SSH server running gitolite. I've added a public/private key for TeamCity to use and pointed the VCS root at it. This all works OK as Test Connection is successful and my build…
GraemeF
  • 11,327
  • 5
  • 52
  • 76
10
votes
4 answers

kex_exchange_identification: Connection closed by remote host

I've wanted to connect my share hosting with ssh. So I generate an ssh key in the ssh action of cpanel and authorized it. Then I've downloaded the private key and drop it in the ./ssh folder of my MacBook.I've used this code to connect my host. ssh…
Hanie Asemi
  • 1,318
  • 2
  • 9
  • 23
10
votes
2 answers

SSH debug packet types

Does anyone know where I can find the descriptions of the SSH packet types received? I am having trouble connecting via ssh to a router of mine and in the ssh debug I am receiving a packet type 1 from the router before disconnecting. Can't seem to…
maclian
  • 349
  • 5
  • 14
10
votes
5 answers

Generate SSH keypair form PHP

I want to generate ssh keypair from php can anyone please guide me how to do it? I have tried the shell_exec but the shell asks questions so that command does not work. I would like to specify filename and path in which to put the keys after…
adityap
  • 729
  • 4
  • 8
  • 19
10
votes
1 answer

Convert RSA to OPENSSH

I will preface this that I am extremely inexperienced with certs/keys and I am using a Mac. My problem is with RSA and OPENSSH certs/keys. I currently have a valid RSA cert/key, but I need to convert them to OpenSSH. From my understanding, I want to…
Impurity
  • 1,037
  • 2
  • 16
  • 31
10
votes
1 answer

"Enter PIN for Authenticator" for command ssh-add -K

I am running into an issue in adding my .pem key to my ssh-agent. I have set up my Linux Ubuntu 20.04 system with Yubikey and it has worked great. Have not had any problems using my Yubikeys. Love the added security; however, when I run this…
Roma
  • 535
  • 6
  • 18
10
votes
2 answers

SSH: When logging in, is the password in plain text / sniffable?

I realise this question is subjective. I am curious about the intelligability of an SSH password when an SSH tunnel is created. Does the secure session begin once the password has authenticated, or is the password itself encapsulated in this secure…
8bitjunkie
  • 12,793
  • 9
  • 57
  • 70
10
votes
8 answers

ssh: connect to host gitlab.com port 22: Network is unreachable

I'm trying to reach the Gitlab server to clone a repo in a Ubuntu 20.10 computer, but I always get the message: ssh: connect to host gitlab.com port 22: Connection timed out fatal: Could not read from remote repository. Please make sure you have…
LuisFelipe
  • 135
  • 1
  • 1
  • 8
10
votes
2 answers

SSH'ing from windows 10 into wsl2 ubuntu

I am fairly new to this business and I fail to understand how to SSH from my win10 machine into my installed wsl2 ubuntu 20.4 Basically, I followed this tutorial, But I keep getting the following errors: when I try to SSH using the public port…
Killerz0ne
  • 254
  • 1
  • 2
  • 12
10
votes
3 answers

VScode SSH extension stuck on the installation step

For the past few months, I've used this VSCode Extension to work remotely on a linux server via SSH. I'll occasionally have a connection problem, but sshing from a terminal and deleting ~/.vscode-server/ has always fixed it. This time, though, that…
Calvin Godfrey
  • 2,171
  • 1
  • 11
  • 27