Questions tagged [ssh]

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

Filter by
Sorted by
Tagged with
153
votes
10answers
126k views

How do I set up SSH so I don't have to type my password?

How do I set up SSH so I don't have to type my password when connecting to a host?
110
votes
7answers
46k views

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 ...
333
votes
14answers
292k views

An SSH tunnel via multiple hops

Tunneling data over SSH is pretty straight-forward: ssh -D9999 username@example.com sets up port 9999 on your localhost as a tunnel to example.com, but I have a more specific need: I am working ...
14
votes
3answers
3k views

Leave bash script running on remote terminal while not logged in?

I have a bash script that takes several hours to run. While it's running, I would like to do other things, which may involve logging out or disconnecting from the internet (my script runs network ...
66
votes
6answers
95k views

UDP traffic through SSH tunnel

The title pretty much sums it up. I would like to send UDP traffic through a SSH tunnel. Specifically, I need to be able to send UDP packets through the tunnel and have the server be able to send ...
99
votes
5answers
165k views

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 ...
235
votes
15answers
180k views

How to reliably keep an SSH tunnel open?

I use an SSH tunnel from work to go around various idotic firewalls (it's ok with my boss :)). The problem is, after a while the ssh connection usually hangs, and the tunnel is broken. If I could at ...
47
votes
2answers
143k views

To create an SSH user who only has permission to access specific folders

I installed SSH, but I found if I use my original account to login to Ubuntu, it has too many permissions. I want to constrain the user to only have permissions for specific folders in Ubuntu. How ...
45
votes
2answers
66k views

Can I create an SSH user which can access only certain directory?

I have a Virtual Private Server which I can connect to using SSH with my root account, being able to execute any linux command and access all the disk area, obviously. I would like to create another ...
174
votes
7answers
133k views

How to make ssh tunnel open to public?

Well, referring back to this question, I am running the command ssh -R 8080:localhost:80 -N root@example.com on a Mac. Yet the port that is being tunneled is not working publicly. I am running such ...
81
votes
12answers
386k views

PuTTY Network Error: Software caused connection abort

I have a strange problem: When I'm using PuTTY with SSH connecting to a Linux server hosted in VMware on my local Windows 7, I often get the error saying "Network error: Software caused ...
18
votes
6answers
44k views

Connect to Linux by name rather than IP

I'm new to Linux (currently running Ubuntu 10.04) and I have just finished setting up SSH access to my Linux Machine. Currently, I have to use ssh root@x.x.x.x to connect but would much rather be ...
1
vote
2answers
1k views

SSH disable port forward remotely instead of killing process on the server

I am making an automatic remote SSH port forward request from my device every few minutes: ssh -y -f -N -R port:localhost:22 user@server \ -o ExitOnForwardFailure=yes -o ServerAliveInterval=60 \ -o ...
34
votes
2answers
155k views

How to run a remote command in PuTTY after login & keep the shell running?

What I'm trying to do: start a PuTTY session from the command line, login to remote machine and cd to provided directory. putty.exe -agent -ssh some.host That will open a session & login with my ...
141
votes
9answers
143k views

How to use Mac OS X Keychain with SSH keys?

I understand that since Mac OS X Leopard the Keychain has supported storing SSH keys. Could someone please explain how this feature is supposed to work. I have some RSA keys that I've generated ...
117
votes
7answers
177k views

How can I tunnel all of my network traffic through SSH?

Whenever I'm using the internet from an insecure location (such as public wifi) I like to use an ssh tunnel (ssh -D port host) to ensure my traffic can't be sniffed. Unfortunately, there seem to be ...
110
votes
15answers
890k views

How do I fix a “cannot open display” error when opening an X program after ssh'ing with X11 forwarding enabled?

After launching the X11 app (XQuartz 2.3.6, xorg-server 1.4.2-apple56) on my Mac (OS X 10.6.8), opening an terminal in X11 and running xhost +, I then ssh -Y to my Ubuntu 10.04 VM (running on VMware ...
70
votes
4answers
35k views

Are GPG and SSH keys interchangable?

I want to generate an RSA key in GPG and use it in SSH login. Is this even possible? If so, how? edit: see @wwerner's answer, I didn't try it but it seems to be the current solution (as of 2018)
16
votes
3answers
28k views

How can I use ssh to run a command on a remote Unix machine and exit before the command completes?

How can I use ssh to run a command on a Unix machine and exit before the command completes? For instance, if I type ssh localhost 'sleep 60 &' ssh hangs on my terminal until sleep completes, ...
4
votes
4answers
7k views

How to detach ssh session without killing a running process?

I started a test filesystem resize on a server through ssh, but totally forgot to do that on a screen session. Now it is running, and my laptop has very slow internet. Is there any way that I can keep ...
95
votes
22answers
146k views

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

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 ...
14
votes
8answers
21k views

Windows SSH Servers?

I was wondering what people use as an SSHd server on Windows? I've decided that I want to be able to log in using SSH on my Windows computers but I don't want to use Linux full-time. What are my ...
48
votes
1answer
22k views

Does the right half of the rsa public key matter?

In a public key file "id_rsa.pub" generated by ssh-keygen, does the part after the == matter? I ask because when I changed "root@somedomain.com" to "root", it seems to still work. More generally, I ...
12
votes
2answers
3k views

What exactly determines if a backgrounded job is killed when the shell is exited, or killed?

This question has come up quite a lot (really a lot), but I'm finding the answers to be generally incomplete. The general question is "Why does/doesn't my job get killed when I exit/kill ssh?", and ...
2
votes
2answers
2k views

Basic ssh tunneling through generic linux ssh server/client

I'm use my home pc to connect to the corporate server with ssh doing something like: ssh -p 2424 user@corporatehost.com Then I log in remotely once more to another server in the corporate ...
3
votes
1answer
25k views

How to type commands in PuTTY by creating batch file?

I have created a .bat file which automatically takes the SSH server (Jump Server) access. Now, I have couple of commands which I would like to hit in that window. For an ex. (To take root access) ...
1
vote
2answers
4k views

How to open port via SSH tunnel?

There is a system B with the following open servers: I have a web server listening on port 80 and a ssh server listening on 22. However, only port 22 is publicly available. Now, I would like to create ...
188
votes
4answers
267k views

How to convert .ppk key to OpenSSH key under Linux?

I know that is possible to convert .ppk under puttygen in Windows, but how to do that on Linux? Is this possible ?
92
votes
8answers
117k views

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 $...
38
votes
5answers
13k views

SSH with authorized_keys to an Ubuntu system with encrypted homedir?

I recently set up a new server with Ubuntu karmic 9.10, and when I created my home directory I chose to make it encrypted. Now, after loading my authorized_keys file into ~/.ssh, it isn't recognized ...
25
votes
4answers
29k views

SSH Reverse socks tunnel

ssh -D can make a socks port at local machine, which pass the traffic to the remote, then to other places. ssh -L port:host:hostport, listen port at local machine, pass the traffic to "host:hostport" ...
13
votes
2answers
3k views

How, if at all, do SSH keys differ from asymmetric keys used for other purposes?

How, if at all, do SSH keys differ from asymmetric keys used for other purposes, e.g. email signing? I'm prompted to ask this, in part, because on OS X, there are apps available to manage SSH keys (...
15
votes
3answers
15k views

SFTP over double server hop

I'm trying to work out a method to allow me to access files on an SFTP server than I cannot access from my local machine. Currently, I have to SSH to a remote server (it is in a certain IP block that ...
28
votes
7answers
35k views

How to edit known_hosts when several hosts share the same IP and DNS name?

I regularly ssh into a computer which is a dual-boot OS X / Linux computer. The two OS instance do not share the same host key, so they can be seen as two host sharing the same IP and DNS. Let's say ...
15
votes
1answer
6k views

Using the IdentityFile directive in ssh_config when AgentForwarding is in use

Is it possible to specify forwarded keys using the IdentityFile directive in .ssh/config? I ran into this quirk when trying to deploy some code via Capistrano/GIT on our production server. Both my ...
9
votes
2answers
10k views

Directly connect MacBook to Linux desktop via ethernet for fast SSH?

I am looking at building a Linux desktop—desktop only; no monitor support—and getting a MacBook Pro as my main computer for mobility. I would like—while I am at the office—to basically use my MacBook ...
15
votes
6answers
206k views

How do I transfer a file to my server using PuTTY?

when calling SCP in PuTTY on my Win7 box, it doesn't let me use C:/, but I also have no idea where on my local machine it will look for files by default. None of program directory or user directory ...
2
votes
2answers
7k views

sshfs equivalent for windows? [closed]

At my university, I want to be able to set up a file-server in my room. The only allowed ports/protocols are SSH and RDP. All others are blocked. I can set up the server just fine, and connect to it ...
4
votes
2answers
4k views

On Linux can I keep a program running in background even after I disconnect?

If I'm logged into a remote Linux machine, I know I can suspend a process (cntr-z) and move it to the background (bg 1) but if I disconnect from the machine, the process stops. Is there a way I can ...
1
vote
1answer
450 views

How can I start a process over SSH such that it will continue to run after I disconnect?

XBMC occasionally crashes on my media server. It's a pain to bring down the media server because I have to manually restart a number of services each time. I'd like to be ablle to start XBMC from an ...
648
votes
18answers
685k views

How to tell git which private key to use?

ssh has the -i option to tell which private key file to use when authenticating: -i identity_fileSelects a file from which the identity (private key) for RSA or DSA authentication is read.  The ...
588
votes
12answers
188k views

macOS keeps asking my ssh passphrase since I updated to Sierra

It used to remember the passphrase, but now it's asking it to me each time. I've read that I need to regenerate the public key with this command, which I did: ssh-keygen -y -f id_rsa > id_rsa.pub ...
170
votes
7answers
168k views

How can I avoid SSH's host verification for known hosts?

I get the following prompt everytime I try to connect a server using SSH. I type "yes", but is there a way to aovid this? The authenticity of host '111.222.333.444 (111.222.333.444)' can't be ...
162
votes
5answers
163k views

What's the difference between SCP and SFTP?

Usually, I use the scp command to transfer files on *nixes. What's the difference between SFTP and SCP? Don't they both work on SSH?
61
votes
17answers
37k views

Sharing the same `ssh-agent` among multiple login sessions

Is there a convenient way to ensure that all logins from a given user (ie me) use the same ssh-agent? I hacked out a script to make this work most of the time, but I suspected all along that there ...
101
votes
8answers
80k views

How do I configure SSH so it dosen't try all the identity files automatically?

I have been putting my ssh identity files inside my ~/.ssh/ folder. I have probably about 30 files in there. When I connect to servers, i will specify the identity file to use, with something like ...
33
votes
5answers
32k views

SSH access to office host behind NAT router

I would like to access the ssh port of my office linux host from home. Unfortunately the host is located behind a NAT router. So, the IP address is not publicly available. There is however access to ...
75
votes
9answers
52k views

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 ...
20
votes
1answer
105k views

Mounting SSH/SFTP shares on Windows 7 [duplicate]

Possible Duplicate: SFTP as a folder on Vista I'm fairly unfamiliar with Windows, especially Windows 7, but using it for a school project; essentially I have a directory accessible through SSH ...