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
85
votes
17 answers

vim + COPY + mac over SSH

I access a sever over ssh on which I run vim for editing files. When I try to yank text from vim into an editor locally on my mac (lion) either with y OR "+y it does not work. I end up with the text I copied last locally. It does work if I just use…
evolution
  • 4,332
  • 5
  • 29
  • 34
84
votes
4 answers

Connecting to a host listed in ~/.ssh/config when using Fabric

I'm having trouble with Fabric not recognizing hosts that I have in ~/.ssh/config. My fabfile.py is as follows: from fabric.api import run, env env.hosts = ['lulu'] def whoami(): run('whoami') Running $ fab whoami gives: [lulu] run:…
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
84
votes
7 answers

How not to pass the locale through an ssh connection command

I have some aliases for ssh, example: alias buildWork="ssh work '~/build_app'" The problem is that the ssh command passes some variables like $LC_CTYPE that causes some errors. How to prevent that and use the server configurations ?
Sonique
  • 6,670
  • 6
  • 41
  • 60
83
votes
3 answers

How to upload files to server using Putty (ssh)

Can someone help me with commands? I'm trying to upload file to server based on linux.
RaShe
  • 1,851
  • 3
  • 28
  • 42
83
votes
4 answers

How to ssh from within a bash script?

I am trying to create an ssh connection and do some things on the remote server from within the script. However the terminal prompts me for a password, then opens the connection in the terminal window instead of the script. The commands don't get…
Andrew
  • 227,796
  • 193
  • 515
  • 708
82
votes
2 answers

Does .pem file contain both private and public keys?

I am wondering if PEM-files contain both private and public keys? What does "PEM" stand for?
user705414
  • 20,472
  • 39
  • 112
  • 155
82
votes
19 answers

Can't connect to Postgresql on port 5432

I have PostgreSQL 9.3 installed on a server running Ubuntu Server 14.04. If I ssh into the server via terminal, I'm able to connect with psql. But when I try to configure pgAdmin III to do the remote connection, I get: Server doesn't listen The…
Rodrigo
  • 4,706
  • 6
  • 51
  • 94
82
votes
7 answers

Git Bash and Pageant are not using keys

I've got Git for Windows (configured for MinTTY and PuTTY\plink.exe) and PuTTY installed, and I am trying to get it to work with a Bitbucket repository. I've got my SSH key loaded, in Pageant and on the website, and yet whenever I attempt to do…
Dissident Rage
  • 2,610
  • 1
  • 27
  • 33
81
votes
1 answer

what is the difference between various keys in public key encryption

I am confused between various keys used in encryption. Amazon gave me key.pem In linux i generate keys like id_rsa and id_rsa.pub Now putty used key like key.ppk I am really confused what type of key is used where
user22
  • 1,199
  • 2
  • 12
  • 15
81
votes
3 answers

SSHFS for OSX 10.8 (Mountain Lion)

In the past I used SSHFS to mount drives, so I could easily work on remote machines with software from my machine. However, when I was at the MacFUSE project page, I noticed that SSHFS has been long since deprecated. What are people using with…
Zak
  • 12,213
  • 21
  • 59
  • 105
80
votes
5 answers

Multiple bitbucket accounts

I have a Bitbucket account for my 9-5 job and I also have a personal Bitbucket account. My goal is to be able to use both on the same computer. I have installed the latest git on a Windows 7 pc. So currently everything with my companies Bitbucket…
TheWebGuy
  • 11,429
  • 16
  • 52
  • 72
80
votes
4 answers

How to open remote files in sublime text 3

I am connecting to remote server using "mRemoteNG" and want to open remote server files in my local sublime text editor. During my research, I found this relevant blog https://wrgms.com/editing-files-remotely-via-ssh-on-sublimetext-3/ and followed…
Raman Balyan
  • 983
  • 2
  • 16
  • 32
80
votes
18 answers

How do you edit files over SSH?

I program with eclipse and sometimes use GUI text editors like SciTE or vim. However, I'm at a point in a project that requires me to edit files over a ssh connection in a 80 column SSH window. Since I have to (* shiver*) sudo vim before I can open…
Xeoncross
  • 55,620
  • 80
  • 262
  • 364
80
votes
10 answers

SSH -X "Warning: untrusted X11 forwarding setup failed: xauth key data not generated"

Hey I'm having an issue getting ssh X forwarding to work. The setup is I'm sshing into my ubuntu VM off OSX Yosemite host machine. I already installed xQuartz on OSX, xauth on ubuntu, and I believe I've have all the correct options set in ssh_config…
sprw121
  • 1,073
  • 1
  • 8
  • 8
79
votes
14 answers

How to ssh to localhost without password?

EDIT: Putting exactly what was done I need to SSH localhost without password, the usual way of doing it (with public keys) do not work. user@PC:~$ rm -rf .ssh/* user@PC:~$ ssh-keygen -t rsa > /dev/null Enter file in which to save the key…
canesin
  • 1,967
  • 2
  • 18
  • 30