Questions tagged [ssh]

Secure Shell (SSH) is a protocol primarily for encrypted shell connections. This tag is also used for questions about sshd and openssh, the two standard applications for using SSH.

Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Used primarily on Linux and Unix based systems to access shell accounts, SSH was designed as a replacement for Telnet and other insecure remote shells, which send information, notably passwords, in plaintext, rendering them susceptible to packet analysis.

It's important to note that there are two versions of SSH (1 and 2), and that version 1 is no longer considered secure, and should be replaced by version 2 where ever possible.

More information, including the more notable SSH-1 vulnerabilities, can be found at the Wikipedia page for SSH.

8868 questions
119
votes
12 answers

How can I automatically change directory on ssh login?

I'm trying to get ssh to automatically change to a particular directory when I log in. I tried to get that behaviour working using the following directives in ~/.ssh/config: Host example.net LocalCommand "cd web" but whenever I log in, I see the…
Gareth
  • 1,416
  • 2
  • 11
  • 12
112
votes
9 answers

What is a good SSH server to use on Windows?

In my spare time I remotely support my wife's office via VPN into a Windows Server. I am about to purchase a wireless broadband service which doesn't support VPN. I don't want to open up the remote desktop ports directly, and I would like to set up…
Bruce McLeod
  • 1,738
  • 2
  • 14
  • 12
111
votes
8 answers

Why does my OpenSSH key fingerprint not match the AWS EC2 console keypair fingerprint?

When I import my OpenSSH public key into AWS EC2's keyring the fingerprint that AWS shows doesn't match what I see from: ssh-keygen -l -f my_key It is a different length and has different bytes. Why? I'm sure I uploaded the correct key.
Craig Ringer
  • 11,083
  • 9
  • 40
  • 61
111
votes
12 answers

How can I prevent the warning No xauth data; using fake authentication data for X11 forwarding?

Every time I initiate an ssh connection from my Mac to a Linux (Debian) I do get this warning: No xauth data; using fake authentication data for X11 forwarding. This also happens for tools that are using ssh, like git or mercurial. I just want to…
sorin
  • 8,016
  • 24
  • 79
  • 103
110
votes
3 answers

SFTP logging: is there a way?

I'm wondering if there is a way to log commands received by the server. It can be all SSH commands, as long as it includes information on commands related to file transfer. I'm having issues with an SFTP client and the creator is asking for logs,…
Darryl Hein
  • 1,712
  • 2
  • 19
  • 21
107
votes
21 answers

Login without running bash_profile or bashrc

So let's say one typoed something in their .bashrc that prevents him (or her) from logging in via ssh (i.e. the ssh login exits because of the error in the file). Is there any way that person could login without executing it (or .bashrc since the…
Tom Ritter
  • 3,197
  • 5
  • 27
  • 30
107
votes
3 answers

Does getting disconnected from an SSH session kill your programs?

So, say I get disconnected from an SSH-session after I've started rsync or cp or any other command that can be long running. Does that command keep running until it's finished after I get disconnected or does it just get killed? Always wondered…
fregas
  • 1,221
  • 2
  • 9
  • 8
107
votes
5 answers

SSH keypair generation: RSA or DSA?

SSH supports two signature algorithms for key pairs: RSA and DSA. Which is preferred, if any? For RSA, what is the minimum acceptable key length?
Brad Ackerman
  • 2,211
  • 2
  • 18
  • 20
107
votes
6 answers

"POSSIBLE BREAK-IN ATTEMPT!" in /var/log/secure — what does this mean?

I've got a CentOS 5.x box running on a VPS platform. My VPS host misinterpreted a support inquiry I had about connectivity and effectively flushed some iptables rules. This resulted in ssh listening on the standard port and acknowledging port…
Mike B
  • 11,871
  • 42
  • 107
  • 168
102
votes
15 answers

ssh tunnel refusing connections with "channel 2: open failed"

All of a sudden (read: without changing any parameters) my netbsd virtualmachine started acting oddly. The symptoms concern ssh tunneling. From my laptop I launch: $ ssh -L 7000:localhost:7000 user@host -N -v Then, in another shell: $ irssi -c…
lorenzog
  • 2,799
  • 3
  • 20
  • 24
102
votes
8 answers

Can you have more than one ~/.ssh/config file?

We have a bastion server that we use to connect to multiple hosts, and our .ssh/config has grown to over a thousand lines (we have hundreds of hosts that we connect to). This is beginning to get a little unwieldy and I'd like to know if there is a…
wrangler
  • 3,080
  • 5
  • 24
  • 20
100
votes
10 answers

How do I do Multihop SCP transfers between machines?

I want to copy a file from my machine A to server C, but only have access to server C through server B. Instead of first transferring to server B, log in and then transfer to server C, Is is possible to transfer the file directly with SCP or similar…
sverrejoh
  • 1,101
  • 2
  • 8
  • 4
98
votes
6 answers

SSHFS mount that survives disconnect

I'm using SSHFS mounts from my laptop to a central server. Obviously, the SSHFS mount is broken after a longer disconnect (eg. during suspend), cause the underlying SSH connection timed out. Is there a way to get SSHFS mounts surviving long lasting…
bene
  • 2,294
  • 2
  • 19
  • 14
98
votes
7 answers

SSH from A through B to C, using private key on B

I'm looking for a simple way to SSH from my local machine, A, through a proxy, B, to a destination host, C. The private key that goes with the public key on C is on B, and I can't put that key on my local machine. Any tips? Also, I'd like to be…
wrangler
  • 3,080
  • 5
  • 24
  • 20
96
votes
1 answer

How do I validate an RSA SSH public key file (id_rsa.pub)?

Is there a command I can use to verify the public key (id_rsa.pub), just the format only. Sometimes I have added a new linebreak, sometimes the file missed the ssh-rsa prefix, so is there a command to validate with?
Ryan
  • 5,831
  • 24
  • 72
  • 91