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
95
votes
8 answers

How can I edit the welcome message when ssh start?

I have a VPS for my website hosting. It is running a Ubuntu server. Every time I logged in my server by ssh, it displays a lengthy welcome message in my terminal. Linux node61.buyvm.net 2.6.18-pony6-3 #1 SMP Tue Mar 13 07:31:44 PDT 2012…
Yansuck
95
votes
8 answers

Show all users and their groups/vice versa

I know I have existing groups and users but I'm not sure about their association. Is there an shell command I can use to list all users or all groups and a command to list all groups/users for a specified user/group? So something like showusers…
Steve Robbins
  • 1,932
  • 5
  • 23
  • 26
95
votes
2 answers

scp without known_hosts check

Is there any chance to skip the known_hosts check without clearing known_hosts or disable it in ssh.conf? I neither have access to known_hosts nor ssh.conf yet. Don't find any suitable in man.
burnersk
  • 2,056
  • 5
  • 27
  • 39
95
votes
9 answers

How can I fully log all bash scripts actions?

From my script output I want to capture ALL the logs data with error messages and redirect them all to log file. I have script like below: #!/bin/bash ( echo " `date` : part 1 - start " ssh -f admin@server.com 'bash…
BlueMark
  • 1,089
  • 1
  • 9
  • 8
93
votes
2 answers

Add comment to existing SSH public key

I have an existing SSH key (public and private), that was created with ssh-keygen. How can I add a comment to this existing key?
Martin
  • 1,213
  • 1
  • 11
  • 10
88
votes
18 answers

Ansible stuck on gathering facts

I'm having some odd issues with my ansible box(vagrant). Everything worked yesterday and my playbook worked fine. Today, ansible hangs on "gathering facts"? Here is the verbose output: <5.xxx.xxx.xxx> ESTABLISH CONNECTION FOR USER:…
Bj Blazkowicz
  • 991
  • 1
  • 6
  • 9
87
votes
7 answers

Temporarily ignore my `~/.ssh/known_hosts` file?

Is there a way to temporarily ignore my ~/.ssh/known_hostsfile? mbp:~ alexus$ ssh 10.52.11.171 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! …
alexus
  • 13,112
  • 32
  • 117
  • 174
85
votes
5 answers

What is the benefit of not allocating a terminal in ssh?

Every once in a while I will do something like ssh user@host sudo thing and I am reminded that ssh doesn't allocate a pseudo-tty by default. Why doesn't it? What benefits would I be losing if I aliased ssh to ssh -t?
Chas. Owens
  • 2,053
  • 2
  • 21
  • 24
85
votes
14 answers

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 is, what is wrong with just logging in as root as…
ryeguy
  • 1,071
  • 2
  • 11
  • 11
84
votes
11 answers

protocol version mismatch -- is your shell clean?

When following the instructions to do rsync backups given here: http://troy.jdmz.net/rsync/index.html I get the error "protocol version mismatch -- is your shell clean?" I read somewhere that I needed to silence the prompt (PS1="") and motd…
rfreytag
  • 1,195
  • 1
  • 10
  • 11
83
votes
12 answers

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 -tq myuser@hostname "sudo -u scriptuser bash -c…
VoY
  • 1,275
  • 2
  • 11
  • 9
83
votes
16 answers

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 doing to block this. I notice that many come from…
MattMcKnight
  • 932
  • 1
  • 7
  • 7
82
votes
14 answers

ssh connection takes forever to initiate, stuck at "pledge: network"

Connection to one of my servers using ssh takes more than 20 seconds to initiate. This is not related to LAN or WAN conditions, since connection to itself takes the same (ssh localhost). After connection is finally establised, it is super fast to…
M-Jack
  • 1,346
  • 2
  • 11
  • 16
82
votes
5 answers

bad ownership or modes for chroot directory component

I created the user MY_USER. Set his home dir to /var/www/RESTRICTED_DIR, which is the path he should be restricted to. Then I edited sshd_config and set: Match user MY_USER ChrootDirectory /var/www/RESTRICTED_DIR Then I restarted ssh. Made…
MultiformeIngegno
  • 1,687
  • 9
  • 26
  • 31
82
votes
1 answer

SSH Allow Password For One User, Rest Only Allow Public Keys

Is it possible with ssh to allow passwords from a certain user, but deny using passwords for everybody else? Basically I want to allow password auth for user justin but everybody else must use public keys. PasswordAuthentication no Seems to be…
Justin
  • 5,328
  • 19
  • 64
  • 84