Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices.

learn more… | top users | synonyms

168
votes
4answers
34k views

What is randomart produced by ssh-keygen?

When you generate a key, you get "randomart" from newer versions of OpenSSH. I am unable to find an explanation of why, and what I'm supposed to use it for. Generating public/private rsa key pair. ...
93
votes
10answers
50k views

How do I set up SSH so I don't have to type my password?

How do I set up SSH so I don't have to type my password when connecting to a host?
91
votes
3answers
70k views

Tell git which private key to use

ssh has the -i option to tell it which private key file to use when authenticating: -i identity_file Selects a file from which the identity (private key) for RSA or DSA authentication is ...
75
votes
9answers
69k views

ssh tunnel via multiple hops

Tunneling data over ssh is pretty straight-forward: ssh -D9999 username@foreignhost.com sets up port 9999 on your localhost as a tunnel to foreignhost.com, but I have more specific need: I am ...
74
votes
4answers
43k views

Way to avoid ssh connection timeout & freezing of terminal tab

When I connect via ssh terminal to certain servers, it timeouts and "freezes" the terminal (doesn't accept, doesn't disconnect, can't Ctrl-C to kill the ssh process or anything). This is in Ubuntu's ...
68
votes
11answers
40k views

How to reliably keep an SSH tunnel open?

I use an SSH tunnel from work to go around various idotic firewalls (it's ok with my boss :)). The problem is, after a while the ssh connection usually hangs, and the tunnel is broken. If I could at ...
67
votes
2answers
46k views

How do you run a SSH server on Mac OS X?

How do you run a ssh server on Mac OS X?
63
votes
7answers
57k views

Too many authentication failures for *username*

I have a hostgator account with ssh access enabled and when trying to upload the generated .pub key file with this command: rsync -av -e "ssh -p2222" /home/user/.ssh/key.pub ...
59
votes
5answers
19k views

Is it ok to share private key file between multiple computers/services?

So we all know how to use public key/private keys using SSH, etc. But what's the best way to use/reuse them? Should I keep them in a safe place forever? I mean, I needed a pair of keys for accessing ...
57
votes
4answers
15k views

Forward SSH traffic through a middle machine

SSH tunneling is very confusing to me. I am wondering if I can do this in Linux. I have 3 machines.. A. My local machine at home. B. Machine at work that I can SSH into (middle man). C. My desktop ...
56
votes
2answers
59k views

How to convert .ppk key to OpenSSH key under Linux?

I know that is possible to convert .ppk under puttygen in Windows, but how to do that on Linux? Is this possible ?
47
votes
2answers
45k views

What's the difference between scp and sftp?

Usually, I use the scp command to transfer files on *nixes. What's the difference between SFTP and SCP? Don't they both work on SSH?
40
votes
2answers
20k views

Does Heartbleed affect ssh keys?

Does the recent Heartbleed bug affect the ssh keys I've generated and use to push/pull code with Github, Heroku, and other similar sites? Do I need to replace the keys I've been using?
37
votes
8answers
70k views

Remove key from known_hosts

I built several virtual machines during the last few weeks. The problem is, the .ssh/known_hosts gives me the Man in the middle warning. This happens because another fingerprint is associated with the ...
37
votes
8answers
54k views

How can I tunnel all of my network traffic through SSH?

Whenever I'm using the internet from an insecure location (such as public wifi) I like to use an ssh tunnel (ssh -D port host) to ensure my traffic can't be sniffed. Unfortunately, there seem to be ...
34
votes
4answers
28k views

How can I avoid SSH's host verification for known hosts?

I get the following prompt everytime I try to connect a server using SSH. I type "yes", but is there a way to aovid this? The authenticity of host '111.222.333.444 (111.222.333.444)' can't be ...
34
votes
14answers
52k views

Map remote drive in Windows over SSH

Does anyone know of a good (hopefully free) tool that can be used to map a Linux server accessible over SSH/SCP as a Windows network drive? EDIT: SFTP not supported EDIT2: Windows File Sharing/Samba ...
33
votes
2answers
30k views

Can I create an SSH user which can access only certain directory?

I have a Virtual Private Server which I can connect to using SSH with my root account, being able to execute any linux command and access all the disk area, obviously. I would like to create another ...
32
votes
7answers
10k views

Sharing the same `ssh-agent` among multiple login sessions

Is there a convenient way to ensure that all logins from a given user (ie me) use the same ssh-agent? I hacked out a script to make this work most of the time, but I suspected all along that there ...
31
votes
6answers
35k views

How to use Mac OS X Keychain with SSH keys?

I understand that since Mac OS X Leopard the Keychain has supported storing SSH keys. Could someone please explain how this feature is supposed to work. I have some RSA keys that I've generated ...
29
votes
7answers
23k views

Top causes of slow ssh logins

I'd love for one of you smart and helpful folks to post a list of common causes of delays during an ssh login. Specifically, there are 2 spots where I see a range from instantaneous to multi-second ...
29
votes
9answers
9k views

How do you get screen to automatically connect to the current ssh-agent when re-attaching to an existing screen?

If you start a screen session while ssh-agent is running (from ssh -A agent forwarding), accessing ssh-agent works fine. However, if you detach from that session, log out, log in again (with ssh-agent ...
29
votes
2answers
12k views

Is it a bad idea to use the same private ssh key on multiple computers?

I recently bought a laptop from which I need to access the same remote hosts that I do from my desktop. It occurred to me that it might be possible to simply copy the private key file from my desktop ...
28
votes
4answers
27k views

When ssh'ing, how can I set an environment variable on the server that changes from session to session?

When I ssh into a server, how can I pass an environment variable from the client to the server? This environment variable changes between different invocations of ssh so I don't want to overwrite ...
27
votes
1answer
9k views

How can I tell how many bits my ssh key is?

I already created an ssh key for myself sometime in the past. I don't remember "how many bits" it is. How can I tell? I'm wondering because I'm using hosting at nearlyfreespeech.net and their faq ...
27
votes
2answers
31k views

SSH: execute sudo command

I have an interactive shell script, that at one place needs to ssh to another machine (Ubuntu based) and execute something as root (the user should enter his password, but the remote command should ...
26
votes
5answers
10k views

Can you specify git-shell in .ssh/authorized_keys to restrict access to only git commands via ssh?

I'd like to be able to use a ssh key for authentication, but still restrict the commands that can be executed over the ssh tunnel. With Subversion, I've achieved this by using a .ssh/authorized_keys ...
25
votes
4answers
32k views

How do I make Bash my default shell on Ubuntu?

I have a .bash_profile in my home directory, but it isn't getting run on login. If I do the following, then things seem to be as I expect: ssh myhost bash source ~/.bash_profile But normally that ...
24
votes
5answers
8k views

Don't add hostkey to known_hosts for SSH

I want to connect to a host via SSH but I don't want the hostname to be added to my ~/.ssh/known_hosts. How can I do that?
24
votes
5answers
36k views

List open SSH tunnels

I use a lot of SSH tunnels to various servers on my linux machine (for tunnelling to databases, web servers etc) and it would be really handy to view a list of current open tunnels via a shell script. ...
24
votes
5answers
8k views

SSH with authorized_keys to an Ubuntu system with encrypted homedir?

I recently set up a new server with Ubuntu karmic 9.10, and when I created my home directory I chose to make it encrypted. Now, after loading my authorized_keys file into ~/.ssh, it isn't recognized ...
23
votes
4answers
28k views

UDP traffic through SSH tunnel

The title pretty much sums it up. I would like to send UDP traffic through a SSH tunnel. Specifically, I need to be able to send UDP packets through the tunnel and have the server be able to send ...
22
votes
4answers
3k views

Is it reasonable to have multiple SSH keys?

So far I've created a separate SSH key for each server I need to login to (for each purpose, to be more accurate). I did it out of a sense of security, just like different passwords to different ...
22
votes
4answers
14k views

How does SSH encryption work?

I've read about generating 2 keys (private and public) on client host and copying the public key to the server host. As I understand it, (correct me if i'm wrong): The server encrypts data with the ...
22
votes
6answers
7k views

Is there a way for one SSH config file to include another one?

In case it matters: OS: Ubuntu 10.04 SSH: OpenSSH_5.3p1 Debian-3ubuntu5 I'd like one SSH config file to include another one. The use case would be to define whatever I want in my default ...
22
votes
2answers
24k views

Where does Putty store known_hosts information on Windows?

How do I tell if Putty already knows about and has cached credentials for specific ssh servers?
22
votes
3answers
6k views

Why is SSH key authentication better than password authentication?

This isn't so much a technical question as it is conceptual. I understand the cryptography used in an SSH key is far stronger than a regular password, but I don't understand why it is considered more ...
21
votes
1answer
18k views

How can I logout an open, remote SSH session?

I sshed into a Linux machine (bash shell) from a public Windows machine (in our lab) and forgot to log out. I'm now back at my seat in another room and I am too lazy to walk back and log out that ...
21
votes
3answers
7k views

Are GPG and SSH keys interchangable?

I want to generate an RSA key in GPG and use it in SSH login. Is this even possible? If so, how?
20
votes
6answers
114k views

How do I fix a “cannot open display” error when opening an X program after ssh'ing with X11 forwarding enabled?

After launching the X11 app (XQuartz 2.3.6, xorg-server 1.4.2-apple56) on my Mac (OS X 10.6.8), opening an terminal in X11 and running xhost +, I then ssh -Y to my Ubuntu 10.04 VM (running on VMware ...
20
votes
11answers
70k views

Putty Network Error: Software caused connection abort

I have a strange problem: when I'm using putty ssh connecting to a linux server hosted in vmware on my local Windows-7, I often get the error saying "Network Error: Software caused connection abort" ...
19
votes
2answers
54k views

How do I SCP from remote machine to local machine when I am outside of my home network?

While I understand how to scp files to and from my server from within my home network, how can I scp a file from my server to my local machine when I am on the outside, say at Starbucks? While I am ...
19
votes
6answers
14k views

How to fix warning about ECDSA host key

I'm trying to setup passwordless ssh on an Ubuntu server with ssh-copy-id myuser@myserver, but I'm getting the error: Warning: the ECDSA host key for 'myserver' differs from the key for the IP ...
19
votes
3answers
2k views

Is it possible to sign a file using an ssh key?

I use SSH (OpenSSH 5.5p1 on Linux, to be precise). I have a key, on which i have a passphrase. I use this for the usual logging in to computers stuff. Can i also use it to sign files? As i ...
17
votes
3answers
15k views

What is a SSH key fingerprint and how is it generated?

I always find that I get this message when I ssh into a new machine: 12:f8:7e:78:61:b4:bf:e2:de:24:15:96:4e:d4:72:53 What does it stand for? Will every machine have the same fingerprint every ...
17
votes
3answers
8k views

Resume rsync over SSH after broken connection?

I have to transfer large amounts of data (>80 GB) over ssh using rsync. Everything is working fine, but the DSL connection where the backup data is sent from will drop once every 24h for up to 3 ...
17
votes
2answers
1k views

If I typo my username when ssh-ing, is there a way to go back and change it?

When ssh-ing using putty, I sometimes mistype my username, and hit Enter before I realise my mistake. Once prompted for a password, is there a way to go back and re-enter my username rather than ...
16
votes
8answers
42k views

How to create an ssh connection Terminal shortcut on Mac OS X Snow Leopard?

It sucks to open Terminal each time and write a complete ssh command. I also have a custom port to connect to.
16
votes
6answers
15k views

Linux “Top” command for Windows Powershell?

I am looking for a PowerShell cmdlet that can provide similar functionality to the Linux Top app. Something that refreshes at some given interval and displays the process list with CPU % util. I have ...
16
votes
10answers
25k views

Why does the “password” prompt take forever when I SSH into my Ubuntu 9.05 server?

Answer: It was, in fact, performing reverse DNS resolution. Based on the suggestions below and this article, I added "UseDNS no" to my sshd_config, rebooted ssh, and now the password prompt displays ...