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.

8868 questions
32
votes
7 answers

Restart SSH on a machine where SSH is the only mode of access

I've made some changes to sshd_config file and therefore need to restart. I'm looking tips on safely restarting ssh when getting physical access to the server would be a huga PITA.
Mitch
  • 547
  • 1
  • 5
  • 10
31
votes
2 answers

What is the SHA256 that comes on the sshd entry in auth.log?

When logging in via ssh, it can be seen the following on auth.log: Dec 14 16:29:30 app sshd[22781]: Accepted publickey for dev from XXX.XXX.XX.XXX port XXXXX ssh2: RSA SHA256:pO8i... I've been trying to figure out what is this SHA256 information,…
Márcio Jales
  • 413
  • 1
  • 4
  • 4
31
votes
4 answers

Weird SSH, Server security, I might have been hacked

I am not sure if I've been hacked or not. I tried to log in through SSH and it wouldn't accept my password. Root login is disabled so I went to rescue and turned root login on and was able to log in as root. As root, I tried to change the password…
PhysiOS
  • 432
  • 7
  • 15
31
votes
3 answers

openssh - Adding an ssh key from putty to authorized_keys

I have been provided with an ssh key by a colleague to add to the authorized_keys file for an account on a linux server so they can access that account. The file looks something like this: ---- BEGIN SSH2 PUBLIC KEY ---- Comment:…
Michael Slade
  • 451
  • 1
  • 4
  • 7
31
votes
8 answers

Why does it take tens of seconds to get a shell prompt?

It's a sort of regular occurrence that, after SSHing to a server (or even opening a terminal on my Mac), the login banner prints immediately but it takes ~10 seconds to a minute for the shell prompt to appear. After that, performance is fine and…
jacobbaer
  • 473
  • 1
  • 4
  • 5
31
votes
7 answers

How to handle SSH port changes with Ansible?

I'm trying to use Ansible for automating the setup process of new server instances. One of the setup tasks changes the default SSH port, therefore requiring me to update the hosts list. Is it possible to automate this by having Ansible fallback to a…
Miko
  • 1,759
  • 4
  • 22
  • 28
31
votes
6 answers

Setting a variable for a given SSH host

In ssh_config, one can choose to export some environment variables to the host using SendEnv. Is there also a way to force a given value for this variable, per host? For example, would it be possible to export variable $FOO with value bar only when…
raphink
  • 11,987
  • 6
  • 37
  • 48
31
votes
2 answers

SSH public key auth fails when UsePAM is set to "no"

To disable password auth I've set the following values in my sshd_config ChallengeResponseAuthentication no PasswordAuthentication no UsePAM no When I try to log in with my private key I get Permission denied (publickey). If I then change UsePAM…
user22711
31
votes
1 answer

Only allow password authentication to SSH server from internal network

I have an OpenSSH 5.9p1 server running on Ubuntu Precise 12.04 which accepts connections from both the internal network and the Internet. I'd like to require public key authentication for connections from the Internet, but accept either public key…
mgorven
  • 30,615
  • 7
  • 79
  • 122
31
votes
5 answers

Getting ;5D when hitting ctrl + arrow key in a Terminal on FreeBSD

On centos I can skip a word by hitting ctrl + arrow (left or right) in a terminal. When I ssh into a FreeBSD box and I try the same pattern I get: $ tail -f 20120412.log;5D;5D;5D (each try = ;5D) Is there a way to fix this? I am using Ubuntu…
jdorfman
  • 413
  • 1
  • 4
  • 7
31
votes
3 answers

Is it possible to get OpenSSH to log the public key that was used in authentication?

I have a production system where several different people are allowed to log in to a single account - the account is for the application and not for the person as we don't have personal accounts on production servers. For auditing purposes I want to…
Guss
  • 2,670
  • 5
  • 34
  • 59
31
votes
2 answers

Public key authentication or similar over HTTP/HTTPS?

Is it possible to configure Apache, or some other web server, to use some kind of public-key authentication? What I would like, ideally, is to be able to give users access to a site without the need for a username/password, provided that they have…
ezzatron
  • 415
  • 1
  • 4
  • 6
31
votes
10 answers

I screwed up, exit in .bashrc

I put "exit" in my .bashrc file. I don't have physical access to the machine so to connect to it I use ssh. I don't have root privileges. Every time I connect to the server, the connection automatically closes. So far, I've tried: Overwriting…
camel_space
  • 453
  • 1
  • 4
  • 9
31
votes
8 answers

What is a good modern parallel SSH tool?

I have heard that pssh and clusterssh are two popular ones, but I thought I would open it to discussion here and see what the community's experiences with these tools were? What are the gotchas? Any decent hacks or use cases?
faultyserver
  • 1,914
  • 1
  • 16
  • 20
30
votes
4 answers

SSH authorized_keys command option: multiple commands?

The authorized_keys has a command="..." option that restricts a key to a single command. Is there a way to restrict a key to multiple commands? E.g. by having a regex there, or by editing some other configuration file?
dkaeae
  • 427
  • 1
  • 5
  • 9