Secure Shell (SSH) is a protocol primarily for encrypted shell connections.

learn more… | top users | synonyms (2)

170
votes
18answers
207k views

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

My GIT setup runs fine in 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 ...
168
votes
11answers
53k views

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 ...
125
votes
4answers
4k views

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 ...
115
votes
13answers
303k views

Why do I get “Permission denied (publickey)” when trying to SSH from local Ubuntu to a Amazon EC2 server?

I have an instance of an application running in the cloud on Amazon EC2 instance, and I need to connect it from my local Ubuntu. It works fine on one of local ubuntu and also laptop. I got message ...
98
votes
23answers
8k views

How do you make it obvious you are on a production system?

A few of us at my company have root access on production servers. We are looking for a good way to make it exceedingly clear when we have ssh'd in. A few ideas we have had are: Bright red prompt ...
90
votes
9answers
30k views

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 ...
89
votes
1answer
23k views

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?
85
votes
6answers
27k views

SSH keypair generation: RSA or DSA?

SSH supports two signature algorithms for key pairs: RSA and DSA. Which is preferred, if any? For RSA, what is the minimum acceptable key length?
81
votes
3answers
36k views

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? Cheers
69
votes
8answers
161k views

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 ...
66
votes
14answers
4k views

What's wrong with always being root?

I have a feeling this is a stupid question, but this is something I've wondered for awhile. I have a VPS and this is my first big linux venture. I am the only person who has access to it. My question ...
60
votes
12answers
64k views

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 ...
60
votes
15answers
9k views

Hundreds of failed ssh logins

Every night I get hundreds, sometimes thousands, of failed ssh logins on my RedHat 4 server. For firewall reasons from remote sites, I need to run on the standard port. Is there anything I should be ...
60
votes
8answers
24k views

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 ...
55
votes
6answers
51k views

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 ...
53
votes
2answers
44k views

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. ...
47
votes
2answers
53k views

SFTP logging: is there a way?

I'm wondering if there is a way to log commands received by the server. It can be all SSH commands, as long as it includes information on commands related to file transfer. I'm having issues with an ...
46
votes
1answer
22k views

How do I change my private key passphrase?

I have an existing public/private key pair, the private key is password protected, the encryption may be either RSA or DSA. These keys are the kind you generate with ssh-keygen and generally store ...
38
votes
15answers
4k views

Preventing brute force attacks against ssh?

What tool or technique do you use to prevent brute force attacks against your ssh port. I noticed in my Security logs, that I have millions of attempts to login as various users through ssh. This is ...
37
votes
22answers
13k views

Why change default ssh port? [closed]

I've noticed that a lot of admins change the default ssh port. Is there any rational reason to do so?
37
votes
5answers
30k views

“POSSIBLE BREAK-IN ATTEMPT!” in /var/log/secure — what does this mean?

I've got a CentOS 5.x box running on a VPS platform. My VPS host misinterpreted a support inquiry I had about connectivity and effectively flushed some iptables rules. This resulted in ssh listening ...
37
votes
1answer
22k views

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 ...
36
votes
9answers
9k views

Why is SSH password authentication a security risk?

Most guides for OpenSSH configuration advise to disable password authentication in favor of key-based authentication. But in my opinion password authentication has a significant advantage: an ability ...
35
votes
4answers
12k views

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 ...
34
votes
5answers
7k views

Best system for managing ssh keys? [closed]

I've got several client computers (i.e. laptops, desktops, etc.), and I connect to several server machines that I manage, and I log into them all via SSH. I can imagine several schemes of managing ...
33
votes
8answers
5k views

How can I run arbitrarily complex command using sudo over ssh?

I have a system that I can only log in to under my username (myuser), but I need to run commands as other user (scriptuser). So far, I have come up with the following to run the commands I need: ssh ...
33
votes
5answers
3k views

Smoothest workflow to handle SSH host verification errors?

This is a simple issue that we all face and probably resolve manually without giving much thought. As servers change, are re-provisioned, or IP addresses reallocated, we receive the SSH host ...
32
votes
8answers
41k views

How to change sshd port on Mac OS X?

I want to change sshd's port on Mac OS X from default 22 to 32, but editing /etc/sshd_config seems does not work. How can I change it?
32
votes
9answers
51k views

SSH via PowerShell

Is it possible to open an SSH session in PowerShell? Currently I use PuTTY but it would be nice if that were not required.
31
votes
4answers
22k views

How can I launch a screen session with a command over ssh on a remote server from my desktop?

I want to be able to launch screen sessions on remote servers from a single ssh command on my desktop. However, screen seems to need a terminal, which is not available when running a command through ...
31
votes
4answers
33k views

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 ...
29
votes
3answers
20k views

What's best practice for communication between Amazon EC2 instances?

I've been setting up Amazon EC2 instances for an upcoming project. They are all micro instances, running Ubuntu Server 64bit. Here's what I've setup so far: Web Server -- Apache Database Server ...
29
votes
2answers
78k views

How to check sshd log?

I have Ubuntu 9.10 installed with sshd and i can successfully connect to it using login and password. I have configured an RSA key login and now have "Server refused our key" as expected. Ok, now i ...
28
votes
16answers
28k views

Why Block Port 22 Outbound?

I'm a programmer, and I have worked for a few clients whose networks block outgoing connections on port 22. Considering that programmers often need to use port 22 for ssh, this seems like a ...
28
votes
6answers
10k views

How do I do Multihop SCP transfers?

I want to copy a file from my machine A to server C, but only have access to server C through server B. Instead of first transferring to server B, log in and then transfer to server C, Is is possible ...
27
votes
3answers
5k views

Does getting disconnected from an SSH session kill your programs?

So, say I get disconnected from an SSH-session after I've started rsync or cp or any other command that can be long running. Does that command keep running until it's finished after I get disconnected ...
27
votes
8answers
15k views

Allow SCP but not actual login using SSH

Is there any way to configure a user on a Linux box (Centos 5.2 in this case) so that they can use scp to retrieve files, but can't actually login to the server using SSH?
27
votes
1answer
14k views

ssh hostname 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/ ...
27
votes
8answers
3k views

What are best practices for managing SSH keys in a team?

I work with small teams (<10) of developers and admins with the following characteristics: Most members of the team have >1 personal computer, most of which are portable Team members have access ...
26
votes
11answers
39k views

Can't get SSH public key authentication to work

My server is running CentOS 5.3. I'm on a Mac running Leopard. I don't know which is responsible for this: I can log on to my server just fine via password authentication. I've gone through all of ...
26
votes
8answers
5k views

How do you setup ssh to authenticate using keys instead of a username / password?

How do you setup ssh to authenticate a user using keys instead of a username / password?
26
votes
4answers
9k views

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

I've got a script that ssh'es 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 ...
26
votes
7answers
5k views

SSH: Two Factor Authentication

I currently have a Ubuntu Server 12.04 running OpenSSH along with Samba and a few other services. At the current time I have public key authentication set up, and I'm wondering if it's possible to set ...
23
votes
8answers
69k views

“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! @ ...
23
votes
7answers
23k views

How to setup ssh's umask for all type of connections

I've been searching for a way to setup OpenSSH's umask to 0027 in a consistent way across all connection types. By connection types I'm referring to: sftp scp ssh hostname ssh hostname program ...
21
votes
10answers
5k views

How to bring .vimrc around when I SSH?

My work tends to involves using SSH to connect to various machines, and then using vim to edit files on those machines. The problem is that I have to constantly copy my .vimrc file around. It's very ...
21
votes
5answers
26k views

Is it possible to use rsync over sftp (without an ssh shell)?

Rsync over ssh, works great every time. However, trying to rsync to a host which allows only sftp logins, but not ssh logins, provides the following error: rsync -av /source ssh ...
21
votes
2answers
651 views

Is it possible to have sshd accept passwords only on certain ports?

I know it's possible to have sshd listen on multiple ports by using multiple Port directives. Is it possible to independently adjust the settings per port, however? In particular, is it possible to ...
20
votes
8answers
19k views

change directory automatically on ssh login

I'm trying to get ssh to automatically change to a particular directory when I log in. I tried to get that behaviour working using the following directives in ~/.ssh/config: Host example.net ...
20
votes
4answers
6k views

Centralized management system for SSH keys?

We are looking to switch to key-based management of SSH logins, and wonder if there any key-management systems which would allow us to centrally manage the access keys world-wide. The system should ...