Questions tagged [ssh]

SSH, otherwise known as "Secure Shell", is a method for securely connecting to a remote computer.

Filter by
Sorted by
Tagged with
955
votes
15answers
1.9m 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 ...
722
votes
14answers
771k 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?
482
votes
2answers
570k 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 ...
396
votes
3answers
169k 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 ...
379
votes
8answers
712k 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 ...
357
votes
8answers
850k views

How do I change my username?

Some time ago when I installed Ubuntu I chose a rather stupid username for my account that I do not want to use anymore. How do I change this (including the name of my home directory, and the name ...
339
votes
8answers
544k 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 ...
320
votes
10answers
685k 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.
277
votes
10answers
371k 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?
264
votes
7answers
563k 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?
245
votes
5answers
339k 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....
231
votes
4answers
427k 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".
210
votes
20answers
290k 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, ...
204
votes
9answers
750k 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, ...
201
votes
6answers
856k views

How to SSH 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 ...
193
votes
17answers
901k 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: ...
182
votes
11answers
336k 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,...
141
votes
5answers
941k 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.
139
votes
8answers
181k 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 ...
138
votes
2answers
263k 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?
138
votes
6answers
340k 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'...
138
votes
3answers
181k 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 ...
137
votes
18answers
879k 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 ...
137
votes
6answers
125k 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 ...
135
votes
4answers
277k 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 ...
134
votes
5answers
107k 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 ...
131
votes
13answers
152k 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 ...
126
votes
3answers
97k 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 ...
122
votes
8answers
490k 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 ...
122
votes
7answers
114k 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 ...
120
votes
2answers
141k 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 ...
118
votes
3answers
309k 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 a one of my PC (small Xubuntu PC used as a media center). Usually I do this starting a X11vnc server on the remote PC via SSH and ...
113
votes
14answers
1.1m 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 ...
113
votes
2answers
211k 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 #...
106
votes
4answers
138k 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?
99
votes
8answers
180k 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?
99
votes
13answers
232k views

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

I'm using Ubuntu 11.10. I'm using 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 ...
94
votes
4answers
235k 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 ...
93
votes
7answers
92k 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/...
91
votes
12answers
103k 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 ...
90
votes
6answers
789k 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 ...
90
votes
5answers
190k 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 ...
88
votes
7answers
495k 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.
85
votes
4answers
57k 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 ...
85
votes
6answers
277k 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 around ...
81
votes
1answer
323k 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 ...
80
votes
2answers
68k 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 ...
80
votes
5answers
127k 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?
66
votes
11answers
94k views

How do I set up an email alert when a ssh login is successful?

Does anyone have a bash script that will email or notify someone in the case of a successful login to a ssh server? I want to be notified if anyone logs into my personal box. I'm using Ubuntu 12.04 ...
64
votes
2answers
68k views

How can multiple private keys be used with ssh?

I was able to setup ssh to use private/public key authentication. Now I am able to do ssh user@server1 And it logs on with the private key. Now I want to connect to another server and use a ...

1
2 3 4 5
101