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

145
votes
4answers
30k 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. ...
88
votes
16answers
44k 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?
83
votes
3answers
55k 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 ...
67
votes
9answers
58k 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 ...
63
votes
11answers
35k 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 ...
59
votes
4answers
32k 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 ...
56
votes
5answers
46k 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 ...
56
votes
2answers
40k views

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

How do you run a ssh server on Mac OS X?
55
votes
5answers
17k 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 ...
51
votes
4answers
13k 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 ...
50
votes
2answers
47k 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 ?
41
votes
2answers
36k 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?
34
votes
14answers
47k 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 ...
34
votes
2answers
14k 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?
32
votes
7answers
48k 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 ...
31
votes
2answers
25k 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 ...
30
votes
4answers
22k 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 ...
29
votes
7answers
55k views

Remove key from known_hosts

I have 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 ...
28
votes
2answers
11k 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 ...
27
votes
7answers
9k 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 ...
27
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 ...
24
votes
6answers
30k 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 ...
24
votes
4answers
27k 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
1answer
8k 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 ...
24
votes
4answers
24k 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 ...
24
votes
7answers
18k 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 ...
23
votes
5answers
9k 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 ...
23
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
2answers
28k 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 ...
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 ...
21
votes
3answers
5k 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
6answers
6k 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 ...
20
votes
4answers
11k 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 ...
19
votes
5answers
7k 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?
19
votes
2answers
21k 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?
18
votes
5answers
24k 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 ...
18
votes
5answers
29k 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. ...
18
votes
11answers
56k 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" ...
17
votes
2answers
42k 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 ...
17
votes
1answer
16k 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 ...
17
votes
3answers
6k 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?
17
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 ...
16
votes
8answers
37k 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
10answers
21k 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 ...
16
votes
5answers
598 views

How risky it is to have a personal server with ssh opened to the Internet?

Title continuation would be “while having limited knowledge of Internet security”. I have recently set up a small server with a low end computer running debian with the aim to use it as a personal ...
16
votes
5answers
91k 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 ...
15
votes
3answers
6k 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 ...
15
votes
1answer
76k views

Mounting SSH/SFTP shares on Windows 7 [duplicate]

Possible Duplicate: SFTP as a folder on Vista I'm fairly unfamiliar with Windows, especially Windows 7, but using it for a school project; essentially I have a directory accessible through ...
15
votes
1answer
10k views

Forwarding audio like X in SSH

While it is possible to use X applications remotely by using -X switch in ssh, the sound is being played in remote machine's speaker only. For example if I view a film in VLC/Totem only video is ...
15
votes
2answers
997 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 a way to go back and re-enter my username rather than ...