Questions tagged [ssh]

Secure Shell; a network protocol that allows data transfer over a secure channel between two networked devices.

SSH is a network protocol that allows two networked devices to exchange data on a secure channel. SSH was designed as a replacement for the insecure and protocols that send data (including authentication) as plain text.

SSH is most commonly used in Unix-derived systems such as OS X and Linux, mostly already pre-installed. On Microsoft Windows, an SSH client such as PuTTY can be used.

Related tags:

  • , one of the most popular implementations of SSH used today
  • , the SSH daemon which responds to incoming requests
  • , which provides a secure way of storing the passphrase of the private key

Important questions:

Related links:

10440 questions
144
votes
9 answers

How do I make Bash my default shell on Ubuntu?

I have a .bash_profile in my home directory, but it isn't getting run on login. If I do the following, then things seem to be as I expect: ssh myhost bash source ~/.bash_profile But normally that all happens on login. Thoughts?
James A. Rosen
  • 2,202
  • 7
  • 23
  • 26
144
votes
11 answers

When ssh'ing, how can I set an environment variable on the server that changes from session to session?

When I ssh into a server, how can I pass an environment variable from the client to the server? This environment variable changes between different invocations of ssh so I don't want to overwrite $HOME/.ssh2/environment every time I do an ssh call.…
Ross Rogers
  • 4,427
  • 8
  • 32
  • 43
141
votes
6 answers

How to prevent SSH from disconnecting if it's been idle for a while

I have a ssh connection to a machine which gets disconnected by that machine after 30 minutes of no user input. However, if I start something like top, the connection stays alive. Since this is a client's machine, I can not reconfigure that…
Isaac
  • 1,824
  • 3
  • 17
  • 23
138
votes
24 answers

Why is my SSH login slow?

I'm seeing delays in SSH Logins. Specifically, there are 2 spots where I see a range from instantaneous to multi-second delays. Between issuing the ssh command and getting a login prompt and between entering the passphrase and having the shell…
Peter Lyons
  • 1,822
  • 2
  • 12
  • 16
131
votes
7 answers

SSH: The authenticity of host can't be established

What does this message mean? Is this a potential problem? Is the channel not secure? Or is this simply a default message that is always displayed when connecting to a new server? I am used to seeing this message when using SSH in the past: I…
Steven Lu
  • 3,620
  • 3
  • 35
  • 46
130
votes
3 answers

Where does Putty store known_hosts information on Windows?

How do I tell if Putty already knows about and has cached credentials for specific ssh servers? Another way to ask this question is what is the Windows/Putty equivalent of a unix/ssh known_hosts file?
Hitesh
  • 2,971
  • 3
  • 16
  • 10
128
votes
5 answers

How can I SSH into "Bash on Ubuntu on Windows 10"?

I have Windows 10 Anniversary Edition with "Bash on Ubuntu on Windows" installed and working. I'd like to be able to SSH into this Ubuntu instance, but although I have openssh-server installed and configured (and listening on port 2200), when I try…
Mick
  • 1,961
  • 6
  • 19
  • 22
128
votes
8 answers

Forward SSH traffic through a middle machine

SSH tunneling is very confusing to me. I am wondering if I can do this in Linux. I have 3 machines.. A. My local machine at home. B. Machine at work that I can SSH into (middle man). C. My desktop at work that I can only SSH into from machine…
PKKid
127
votes
7 answers

How can I resolve the error "cannot execute binary file"?

When I login using SSH, all I can see is this... -bash: /usr/bin/id: cannot execute binary file -bash: [: : integer expression expected I couldn't do anything in here. Commands such as halt, poweroff, reboot will return command not found. How can I…
superuser
  • 4,007
  • 5
  • 25
  • 33
126
votes
12 answers

How to force GPG to use console-mode pinentry to prompt for passwords?

Using gpg from a console-based environment such as ssh sessions fails because the GTK pinentry dialog cannot be shown in a SSH session. I tried unset DISPLAY but it did not help. The GPG command line options do not include a switch for forcing the…
ccpizza
  • 7,456
  • 6
  • 54
  • 56
117
votes
5 answers

Is it ok to share private key file between multiple computers/services?

So we all know how to use public key/private keys using SSH, etc. But what's the best way to use/reuse them? Should I keep them in a safe place forever? I mean, I needed a pair of keys for accessing GitHub. I created a pair from scratch and used…
Behrang
  • 2,032
  • 5
  • 19
  • 26
112
votes
3 answers

How to upload local file to server through Linux terminal

I am trying to upload local files to server by using Putty or SSH but not getting upload there. Is there any direct method to upload file from local to server from Linux terminal without using FTP etc ?
Sanjeev Kumar Goswami
  • 1,223
  • 2
  • 9
  • 7
109
votes
6 answers

Downloading Folders to my Local via SSH

I am learning SSH as it seems there are no good SSH GUIs for Macs. I know how to make db dumps, cruise through the directories, etc, but the one last piece of the puzzle I need to learn is how to download folders/entire directories from the server…
Zach Smith
  • 1,215
  • 2
  • 11
  • 11
109
votes
3 answers

How can I change the directory that ssh-keygen outputs to?

I want to run a command like: ssh-keygen -t rsa -b 4096 -C "your_email@example.com" My understanding is that ssh-keygen outputs to the home directory. I'm working on a networked computer using Git Bash (Windows, MYSS MINGW64) where the home…
Phlox Midas
  • 1,193
  • 2
  • 8
  • 5
103
votes
11 answers

List open SSH tunnels

I use a lot of SSH tunnels to various servers on my linux machine (for tunnelling to databases, web servers etc) and it would be really handy to view a list of current open tunnels via a shell script. I can identify local connections via a grep on…
James Frost
  • 1,133
  • 2
  • 8
  • 5