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.

Filter by
Sorted by
Tagged with
997 votes
14 answers
1.3m views

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?
Olivier Lalonde's user avatar
977 votes
15 answers
2.0m views

How to get bash or ssh into a running container in background mode?

I want to ssh or bash into a running docker container. Please, see example: $ sudo docker run -d webserver webserver is clean image from ubuntu:14.04 $ sudo docker ps CONTAINER ID IMAGE ...
Timur Fayzrakhmanov's user avatar
573 votes
2 answers
728k views

How do I retrieve the public key from a SSH private key?

A SSH private key as generated by ssh-keygen contains a public key part. How do I retrieve this public key from the private key? I've lost my public key and need to put the contents of this public key ...
Lekensteyn's user avatar
  • 174k
465 votes
8 answers
941k views

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 ...
Jorge Castro's user avatar
  • 71.7k
447 votes
3 answers
203k views

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 ...
Wayne Werner's user avatar
  • 6,712
394 votes
11 answers
672k views

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 ...
theTuxRacer's user avatar
  • 16.2k
392 votes
7 answers
935k views

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's user avatar
  • 81.8k
366 votes
10 answers
857k views

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's user avatar
  • 9,868
328 votes
7 answers
1.6m views

How to run the SSH server on a port other than 22

I have two computers behind the same router. Let's call them A and B. A can SSH to B in the following manner: ssh usr@<internal ip of computer> B can SSH to A by doing the same, but the ...
Gary's user avatar
  • 3,904
325 votes
10 answers
1.1m views

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 ...
gatorback's user avatar
  • 5,755
311 votes
10 answers
452k views

How can I set up password-less SSH login?

I want to be able to login to a remote via ssh without having to enter the password all the time. How do I set it up? Is a different command required to execute a password-less session?
Oxwivi's user avatar
  • 17.8k
299 votes
9 answers
1.2m views

How do I add SSH Keys to authorized_keys file?

I have an Ubuntu server on Amazon EC2, that I use for development, and today I stupidly cleared everything out of my ~/.ssh/authorized_keys file. Luckily I have an SSH open, so I am still connected, ...
Dave Long's user avatar
  • 3,376
299 votes
7 answers
440k views

ssh: automatically accept keys

I've written this small utility script: for h in $SERVER_LIST; do ssh $h "uptime"; done When a new server is added to $SERVER_LIST, the script is stopped with: The authenticity of host 'blah.blah....
Adam Matan's user avatar
  • 12.4k
291 votes
20 answers
1.6m views

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: ...
Navid's user avatar
  • 3,123
283 votes
22 answers
1.9m views

SSH Permission denied (publickey)

I am trying to connect to a Linode (running Ubuntu 12.04 LTS) from my local machine (also running Ubuntu 12.04 LTS) I have created a private and public key on my local machine and copied my public ...
Pattle's user avatar
  • 2,969
264 votes
20 answers
370k views

Ubuntu 16.04 ssh: sign_and_send_pubkey: signing failed: agent refused operation

I just upgraded my Ubuntu System from 15.10 to 16.04 by completely wiping the Ubuntu 15 partition from my system. After installing Ubuntu 16.04 I recreated my ssh keys as I forgot to back them up, ...
Lektonic's user avatar
  • 2,743
254 votes
14 answers
484k views

How do I copy files that need root access with scp?

I have an Ubuntu server to which I am connecting using SSH. I need to upload files from my machine into /var/www/ on the server, the files in /var/www/ are owned by root. Using PuTTY, after I log in,...
Dimitris Sapikas's user avatar
238 votes
4 answers
440k views

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".
Daryl Spitzer's user avatar
206 votes
5 answers
188k views

Really verbose way to test Git connection over SSH?

When using GIT, I have problems with using GIT over SSH, and since it works just fine both from work, and at home with a different modem, it's obviously my home modem that is acting up. I have no ...
IQAndreas's user avatar
  • 3,178
181 votes
11 answers
247k views

Enter SSH passphrase once

Before upgrade When I was running git clone git@... (using ssh) once per computer restart a window dialog appeared containing a textbox for inserting my SSH passphrase and confirmed with OK. Then the ...
Ionică Bizău's user avatar
181 votes
6 answers
199k views

Should I always restart the system when I see "System restart required"?

These two nice SE posts (1, 2) comment on restarting one's ubuntu machine but they leave me with a few questions: How do you actually do the restart (I'm a beginner and using 12.04.1 LTS)? Should I ...
tim peterson's user avatar
  • 2,285
163 votes
3 answers
244k views

Does ssh key need to be named id_rsa?

I have come across this problem a couple of times when creating build servers with keyed authentication. I was wondering if anyone else has experience this. I have a couple of keys for my current ...
myusuf3's user avatar
  • 34.1k
160 votes
4 answers
134k views

What is the difference between `ssh -Y` (trusted X11 forwarding) and `ssh -X` (untrusted X11 forwarding)?

What is the difference between ssh -Y (trusted X11 forwarding) and ssh -X (untrusted X11 forwarding)? As far as I have understood it, it has something to do with security, but I did not grasp the ...
Martin Ueding's user avatar
158 votes
8 answers
158k views

How do I SSH to machine A via B in one command?

I want to access a computer, say machine A which is based in my university's network. However, this computer is only accessible via the internal network of the university, so I can not use SSH to this ...
nikosdi's user avatar
  • 1,762
150 votes
5 answers
427k views

How to start a GUI software on a remote Linux PC via SSH

Sometimes I need to start XMBC media player or other GUI software on one of my remote PC (small Xubuntu PC used as a media center). Usually, I do this by starting an X11vnc server on the remote PC via ...
Raben's user avatar
  • 1,603
146 votes
3 answers
170k views

How to create a restricted SSH user for port forwarding?

ændrük suggested a reverse connection for getting an easy SSH connection with someone else (for remote help). For that to work, an additional user is needed to accept the connection. This user needs ...
Lekensteyn's user avatar
  • 174k
146 votes
5 answers
331k views

How can I chroot sftp-only SSH users into their homes?

I want to give a client access to my server, but I want to limit those users to their home directories. I will bind-mount in any files I want them to be able to see. I've created a user called bob ...
Oli's user avatar
  • 293k
145 votes
4 answers
242k views

Progress bar for scp command

Is there any way to display a progress bar while copying from server to local (or vice versa) using scp?
Abdul Shajin's user avatar
  • 1,825
145 votes
9 answers
606k views

Create a new SSH user on Ubuntu Server

Just created a new virtual Ubuntu server and I'm in the process of hardening it for production use. I currently have a root account. I want to do the following: Create a new user (let's call them jim ...
Oli's user avatar
  • 293k
145 votes
5 answers
965k views

How to enable ssh root access on Ubuntu 14.04

I´d like to enable the ssh root access on Ubuntu 14.04. Editing the /etc/ssh_config (PermitRootLogin yes) didn't affect anything.
user283163's user avatar
  • 1,459
143 votes
7 answers
360k views

In SSH, how do I mv to my local system?

I ssh-ed into my webhost's directory, and tar-ed the webapp to download. When I try to mv to ~/mydirectory/backups or /home/mydirectory/backups, it defines the "home" as my root on the webhost that I'...
JeanSibelius's user avatar
  • 3,602
142 votes
14 answers
1.3m views

How to solve 'Connection refused' errors in SSH connection?

I have an Ubuntu Server 10.10 32-bit in my home. I'm making SSH connections to it from my PC via Putty. The problem is, sometimes I'm able to login seamlessly. However, sometimes it gives me an error ...
frbry's user avatar
  • 1,521
140 votes
3 answers
278k views

How do I keep track of failed SSH log-in attempts?

I'd like to see if somebody has been trying to log-in by brute-force into my Ubuntu 12.04 server over SSH. How can I see if such activities have been taking place?
Ivan's user avatar
  • 57k
134 votes
13 answers
156k views

How to harden an SSH server?

What measures can/should I take to make sure that security around my SSH server is absolutely impermeable? This will be community wiki from the start, so lets see what people do to secure their ...
134 votes
4 answers
338k views

How do I force SSH to only allow users with a key to log in?

I tried following the instructions here: http://lani78.wordpress.com/2008/08/08/generate-a-ssh-key-and-disable-password-authentication-on-ubuntu-server/ to only allow users with a public key on the ...
user193805's user avatar
  • 1,441
132 votes
2 answers
242k views

How can I allow SSH password authentication from only certain IP addresses?

I'd like to allow SSH password authentication from only a certain subnet. I see the option to disallow it globally in /etc/ssh/sshd_config: # Change to no to disable tunnelled clear text passwords #...
ændrük's user avatar
  • 76.6k
124 votes
4 answers
94k views

What's the risk of upgrading over SSH?

When I run sudo do-release-upgrade over ssh, I get the following message. This session appears to be running under ssh. It is not recommended to perform a upgrade over ssh currently because in ...
C. Ross's user avatar
  • 2,957
120 votes
6 answers
1.3m views

SSH Public Key - No supported authentication methods available (server sent public key)

I have a 12.10 server setup in a virtual machine with its network set to bridged (essentially will be seen as a computer connected to my switch). I installed opensshd via apt-get and was able to ...
F21's user avatar
  • 4,309
117 votes
1 answer
461k views

Copy folders (not one file) using SSH ubuntu? [duplicate]

I am trying to copy a folder to remote Ubuntu server using command line ssh connection, i understand it's doable to transfer a file using scp but i have many files in a folder iam trying to copy to ...
aero's user avatar
  • 1,305
116 votes
7 answers
693k views

Why am I getting a "port 22: Connection refused" error?

I am getting a port 22: Connection refused error while connecting to a server. I have both the openssh client and server installed, and they are running. But still there is an error. Please help.
ankesh's user avatar
  • 1,261
112 votes
15 answers
276k views

Can you set passwords in .ssh/config to allow automatic login?

I'm using Ubuntu 11.10 and ssh for connecting to many servers daily, so I put their parameters in the .ssh/config file like this: Host Home User netmoon Port 22 HostName test.com Is there a way to ...
Netmoon's user avatar
  • 1,448
109 votes
10 answers
284k views

rsync over ssh "error in rsync protocol data stream" (code 12). ssh works

I tried: rsync -v -v -e 'ssh -p YY' ./testfile me@XXXXX:/home Error Message opening connection using: ssh -p YY -l me 146.6.84.206 rsync ->-server -vvve.s . /home [sender] make_file(testfile,*,...
user3391229's user avatar
  • 1,205
108 votes
7 answers
212k views

Mount remote directory using SSH

How to mount a remote directory using SSH to be available same as if it is a local directory?
Maythux's user avatar
  • 84.2k
103 votes
2 answers
96k views

How do I kill a locked SSH session? [duplicate]

From time to time, SSH sessions to my servers just freeze up and then neither Ctrl+C nor Ctrl+\ do anything. How do I quit the session without just closing the Terminal it's in? Clarification: The ...
Stefano Palazzo's user avatar
103 votes
13 answers
129k views

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 ...
Oli's user avatar
  • 293k
102 votes
7 answers
104k views

Locale variables have no effect in remote shell (perl: warning: Setting locale failed.)

I have a fresh ubuntu 12.04 installation. When i connect to my remote server i got errors like this: ~$ ssh example.com sudo aptitude upgrade ... Traceback (most recent call last): File "/usr/bin/...
Janning's user avatar
  • 1,885
102 votes
3 answers
257k views

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

An error occurs when I try to make SSH connection: $ ssh -p 22 [email protected] This account is currently not available
Mert Özoğul's user avatar
100 votes
9 answers
202k views

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's user avatar
  • 1,469
96 votes
14 answers
198k views

How to get coloured terminal over ssh?

When I connect over ssh to remote hosts everything is just a single font/color. I would like to have colours like I do locally e.g. green for executable and blue for symlinks etc. And such that when I ...
Dima's user avatar
  • 9,817
96 votes
6 answers
321k views

sudo: no tty present and no askpass program specified

When attempting to run a remote binary using sudo on the remote box: ssh remotehost "sudo ./binary" I see this error: sudo: no tty present and no askpass program specified How can I work ...
Drew Noakes's user avatar
  • 5,708

1
2 3 4 5
125