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
192
votes
6 answers

how to disable SSH login with password for some users?

On Linux (Debian Squeeze) I would like to disable SSH login using password to some users (selected group or all users except root). But I do not want to disable login using certificate for them. edit: thanks a lot for detailed answer! For some…
Stepan
  • 2,139
  • 3
  • 15
  • 8
192
votes
11 answers

ssh-agent forwarding and sudo to another user

If I have a server A into which I can login with my ssh key and I have the ability to "sudo su - otheruser", I lose key forwarding, because the env variables are removed and the socket is only readable by my original user. Is there a way I can…
Florian Schulze
182
votes
12 answers

What does "Warning: untrusted X11 forwarding setup failed: xauth key data not generated" mean when ssh'ing with -X?

When I use ssh -X on my Mac (running OS X 10.6.7) to connect to my Ubuntu (11.04) box, I get the following warning: Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication…
Daryl Spitzer
  • 2,996
  • 9
  • 33
  • 40
176
votes
5 answers

What's the difference between authorized_keys and authorized_keys2?

Just wanted a quick summary of the differences between them and why there are two?
Jon
  • 2,121
  • 2
  • 13
  • 13
151
votes
5 answers

How do I make ssh fail rather than prompt for a password if the public-key authentication fails?

I've got a script that SSHes several servers using public key authentication. One of the servers has stopped letting the script log in due to a configuration issue, which means that the script gets stuck with a "Password:" prompt, which it obviously…
rjmunro
  • 2,301
  • 4
  • 18
  • 22
148
votes
5 answers

How to check if an RSA public / private key pair match

I have two files, id_rsa and id_rsa.pub. What command can be used to validate if they are a valid pair?
Ryan
  • 5,831
  • 24
  • 72
  • 91
147
votes
9 answers

Keeping a linux process running after I logout

I'm connecting to a Linux machine through SSH, and I'm trying to run a heavy bash script that makes filesystem operations. It's expected to keep running for hours, but I cannot leave the SSH session open because of internet connections issues I…
doc_id
  • 1,509
  • 2
  • 12
  • 17
145
votes
3 answers

ssh-keygen does not create RSA private key

I'm trying to create a private key and having an issue. When I use ssh-keygen -t rsa -b 4096 -C "your_email@example.com", I get a private key in the following format. -----BEGIN OPENSSH PRIVATE…
Moon
  • 2,123
  • 4
  • 24
  • 23
144
votes
3 answers

Difference between OpenSSH internal-sftp and sftp-server

Why are there two ways to setup SFTP with OpenSSH and when to use which? Is there any difference between them? I mean the first one is using a lib from OpenSSH and the second one says "use the internal", so it is also OpenSSH? Subsystem sftp…
Denny Crane
  • 1,623
  • 2
  • 12
  • 9
142
votes
4 answers

Is my password compromised because I forgot to hit Enter after ssh username?

I've just tried logging into a Fedora (release 13 Goddard) server using SSH (PuTTY, Windows). For some reason the Enter after typing my username didn't go through and I typed in my password and hit Enter again. I only realized my mistake when the…
Jonas Heidelberg
  • 1,184
  • 1
  • 7
  • 14
142
votes
6 answers

Why do consoles sometimes hang forever when SSH connection breaks?

I've seen this with so many consoles (on Linux, Mac, ...), and with lots of different machines in many different networks. I can never pinpoint the exact reason, why this happens: All you have to do is log in to a machine via SSH. If the connection…
Chris Lercher
  • 4,152
  • 9
  • 35
  • 41
140
votes
35 answers

SSH Suddenly returning Invalid format

So a while ago I set up a server on AWS, and used their generated SSH key. I saved the key to Lastpass, and have successfully retrieved it from there before, and got it working. However, after trying that again today, I can't get it to…
Gregor Menih
  • 1,503
  • 2
  • 9
  • 5
132
votes
4 answers

What significance does the user/host at the end of an SSH public key file hold?

I can’t figure out why does an SSH public key file generated by ssh-keygen have a user and host at the end of it. Example: id_rsa.pub ssh-rsa ... rest of file ... /CA9gyE8HRhNMG6ZDwyhPBbDfX root@mydomain Notice the root@mydomain at the end of the…
Basil A
  • 2,060
  • 3
  • 18
  • 18
132
votes
4 answers

how do you create an ssh key for another user?

I'm trying to create an ssh key for another user. I'm logged in as root. Can I just edit the files generated by ssh-keygen and change root to the user I want?
user962449
  • 1,447
  • 2
  • 12
  • 6
120
votes
23 answers

How to recover from "Too many Authentication Failures for user root"

I've done several attempts to establish SSH-connecton for user root@host using putty terminal. While doing so I specified wrong credentials several times and after that I've specified them correctly, and then after the credentials were accepted the…
user11722
  • 1,363
  • 3
  • 10
  • 6