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.

8636 questions
676
votes
10 answers

How to automate SSH login with password?

How to automate SSH login with password? I'm configuring my test VM, so heavy security is not considered. SSH chosen for acceptable security with minimal configuration. ex) echo password | ssh id@server This doesn't work. I remember I did this with…
Eonil
  • 9,689
  • 15
  • 34
  • 53
556
votes
6 answers

ssh returns "Bad owner or permissions on ~/.ssh/config"

When I try to ssh to another box, I get this strange error $ ssh hostname Bad owner or permissions on ~/.ssh/config But I made sure that I own and have rw permissions on the file: ls -la ~/.ssh/ total 40K drwx------ 2 robert robert 4.0K Mar 29…
Robert
  • 14,423
  • 4
  • 18
  • 14
544
votes
32 answers

How do I tell Git for Windows where to find my private RSA key?

My Git setup runs fine on Linux, but when I try to set things up under Windows (using Git for Windows and TortoiseGit), I don't know where to put my private SSH key (or, better still, how to tell ssh where it's located). I'm using the standard…
binaryorganic
  • 5,901
  • 4
  • 17
  • 19
400
votes
3 answers

How do I change my private key passphrase?

I have an existing public/private key pair. The private key is password protected, and the encryption may be either RSA or DSA. These keys are the kind you generate with ssh-keygen and generally store under ~/.ssh. I'd like to change the private…
kch
  • 4,472
  • 3
  • 19
  • 17
319
votes
24 answers

Can I automatically add a new host to known_hosts?

Here's my situation: I'm setting up a test harness that will, from a central client, launch a number of virtual machine instances and then execute commands on them via ssh. The virtual machines will have previously unused hostnames and IP…
gareth_bowles
  • 8,867
  • 9
  • 33
  • 42
281
votes
13 answers

Can I nohup/screen an already-started process?

I'm doing some test-runs of long-running data migration scripts, over SSH. Let's say I start running a script around 4 PM; now, 6 PM rolls around, and I'm cursing myself for not doing this all in screen. Is there any way to "retroactively" nohup a…
ojrac
  • 2,913
  • 3
  • 17
  • 5
275
votes
2 answers

Create a public SSH key from the private key?

Let's suppose I have a SSH key, but I've deleted the public key part. I have the private key part. Is there some way I can regenerate the public key part?
Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
228
votes
17 answers

Permission denied (publickey). SSH from local Ubuntu to Amazon EC2 server

I have an instance of an application running in the cloud on an Amazon EC2 instance, and I need to connect to it from my local Ubuntu. It works fine on one local ubuntu and also laptop. I got this message, Permission denied (publickey)., when trying…
Vorleak Chy
  • 2,421
  • 2
  • 15
  • 8
208
votes
16 answers

How do diff over ssh?

How do I diff files/folders across machines provided that the only connectivity available is ssh?
Alexey Timanovsky
  • 3,391
  • 3
  • 18
  • 8
201
votes
11 answers

"Add correct host key in known_hosts" / multiple ssh host keys per hostname?

Trying to ssh into a computer I control, I'm getting the familiar message: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! …
Samuel Edwin Ward
  • 2,193
  • 2
  • 13
  • 12
196
votes
22 answers

Is it normal to get hundreds of break-in attempts per day?

I just checked my server's /var/log/auth.log and found that I'm getting over 500 failed password/break-in attempt notifications per day! My site is small, and its URL is obscure. Is this normal? Should I be taking any measures?
Kyle Cureau
  • 1,537
  • 3
  • 11
  • 15
195
votes
15 answers

How to reconnect to a disconnected ssh session

Is there a way to connect to an ssh session that was disconnected? We are having problems with our network connection to a remote site that we are working on separately; however, in the mean time we experience a large number of disconnects due to…
palehorse
  • 4,179
  • 5
  • 28
  • 27
195
votes
1 answer

SSH use only my password, Ignore my ssh key, don't prompt me for a passphrase

This is a question regarding the OpenSSH client on Linux, MacOSX and FreeBSD. Normally, I log into systems using my SSH key. Occasionally, I want my SSH client to ignore my SSH key and use a password instead. If I 'ssh hostname', my client prompts…
Stefan Lasiewski
  • 22,949
  • 38
  • 129
  • 184
187
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,089
  • 3
  • 15
  • 8
187
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
1
2 3
99 100