Questions tagged [ssh]

SSH, or "Secure Shell", is a networking protocol for securely connecting to a remote computer over an unsecure network. SSH is also the name of the default command-line SSH client. This tag is for questions involving using and troubleshooting SSH connections, as well as setting up and configuring SSH for applications which use the SSH protocol. This tag should be used with other tags to better identify the environment of the problem.

Ubuntu installs an SSH client (openssh-client) by default. If you want to be able to log in remotely into your machine, you need the server package (openssh-server). There are SSH clients for Windows as well, such as PuTTY.

Troubleshooting

If public key authentication doesn't work: make sure that on the server side, your home directory (~), the ~/.ssh directory, and the ~/.ssh/authorized_keys file, are all writable only by their owner. In particular, none of them must be writable by the group (even if the user is alone in the group). chmod 755 or chmod 700 is ok, chmod 770 is not.

What to check when something is wrong:

  • Run ssh -vvv to see a lot of debugging output. If you post a question asking why you can't connect with ssh, include this output (you may want to anonymize host and user names).
  • If you can, check the server logs, typically in /var/log/daemon.log or /var/log/auth.log or similar.
  • If public key authentication isn't working, check the permissions again, especially the group bit (see above).

See also

6219 questions
999
votes
14 answers

How to keep processes running after ending ssh session?

Let's say I launch a bunch of processes from a ssh session. Is it possible to terminate the ssh session while keeping those processes running on the remote machine?
465
votes
8 answers

Easiest way to copy ssh keys to another machine?

I am lazy at home and use password authentication for my home machines. I am ready to move to key based authentication. There are many options on the web on how to do this, including catting then sshing the key over, scping the key over directly,…
Jorge Castro
  • 71,754
447
votes
3 answers

How can I break out of ssh when it locks?

I frequently ssh into my box at home from school, but usually when I change classes and my computer suspends, the pipe will be broken. However, ssh simply locks up - Ctrl+c, Ctrl+z and Ctrl+d have no effect. It's annoying to have to restart my…
Wayne Werner
  • 6,712
394
votes
11 answers

Is it possible to remove a particular host key from SSH's known_hosts file?

Is it possible to remove a particular host key from SSH's known_hosts file? I usually end up deleting the entire known_hosts file, which I have no problems with doing, but just out of curiosity, is it possible to remove just a single entry? I…
theTuxRacer
  • 16,185
393
votes
7 answers

How to disable strict host key checking in ssh?

I would like to disable strict host key checking in ssh for Ubuntu 11.04. How to do it?
karthick87
  • 81,947
367
votes
10 answers

How to prevent "Write Failed: broken pipe" on SSH connection?

What can I do to configure SSH on both client and servers to prevent Write Failed: broken pipe errors? It often occurs if you sleep your client computer and resume later.
sorin
  • 9,888
328
votes
10 answers

SSH returns: no matching host key type found. Their offer: ssh-dss

I am accustomed to using Putty on a Windows box or an OSX command line terminal to SSH into a NAS, without any configuration of the client. Ubuntu 16.04 attempts to SSH into the NAS (via LAN): ssh root@192.168.8.109 Unable to negotiate with…
gatorback
  • 5,785
  • 9
  • 40
  • 65
292
votes
20 answers

SSH connection problem with "Host key verification failed..." error

I can connect to another Ubuntu machine in my LAN via SSH. On both of then PC's I installed openssh-server but from another Ubuntu computer I can not connect to my PC via SSH and I got this error: Host key verification failed...
Navid
  • 3,133
238
votes
4 answers

How do I configure a new Ubuntu installation to accept ssh connections?

I just installed Ubuntu. How do I set it up to allow me to ssh into it? Right now I get "ssh: connect to host x.x.x.x port 22: Operation timed out".
103
votes
13 answers

Download a file over an active SSH session

I want to download a file from an active SSH session. In many cases I probably could just use SFTP, scp, rsync et al but there are times where I have elevated permissions on the remote server in a way I cannot use these methods. If you're struggling…
Oli
  • 293,335
102
votes
3 answers

"This account is currently not available" error when trying to ssh

An error occurs when I try to make SSH connection: $ ssh -p 22 www-data@x.x.x.x This account is currently not available
Mert Özoğul
  • 1,155
  • 2
  • 8
  • 12
100
votes
9 answers

Why does ssh's “password” prompt take so long to appear?

When I try to ssh, the password prompt takes too long (almost two minutes) to appear. Why does this happen?
Neuquino
  • 1,469
68
votes
3 answers

copy ssh private keys to another computer

I need to use another computer to access my ssh server. This is because a recently implemented vpn at my university doesn't work on my current computer and I have lost access to the server. I ssh via encrypted ssh keys. Can I copy these keys to the…
benj
  • 1,373
66
votes
3 answers

How to copy file to another machine through terminal?

I have Ubuntu 10.04 running through VMPlayer. And I have another machine (Asus RT-N16 router). I am able to connect to the router with telnet and see its file system. How can I copy the file from the local machine (file is /home/user/helloworld-c)…
LA_
  • 985
64
votes
16 answers

Server keeps asking for password after I've copied my SSH Public Key to authorized_keys

I have an Ubuntu Server, running in a Cloud. I created a user (git). In the folder /home/git, I have created the .ssh/ dir, and the authorized_keys file. But, when I put my SSH Public Key in the authorized_keys file, the server continues to ask me…
1
2 3
28 29