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
166
votes
10answers
177k 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?
117
votes
8answers
57k 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 ...
432
votes
17answers
380k 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 ...
85
votes
9answers
135k 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 ...
9
votes
1answer
20k views

How to create a SOCKS proxy with ssh?

I want to use my computer as a SOCKS proxy. Do you just have to do ssh -D port_number hostname? Do I have to put my Linux username as the hostname?
294
votes
18answers
248k 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 ...
124
votes
5answers
220k 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 ...
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 ...
64
votes
2answers
208k views

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 ...
92
votes
12answers
508k 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 ...
45
votes
2answers
69k 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 ...
26
votes
6answers
72k 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 ...
45
votes
3answers
186k 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 ...
53
votes
1answer
28k 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 ...
298
votes
18answers
441k views

Windows SSH: Permissions for 'private-key' are too open

I've OpenSSH 7.6 installed in Windows 7 for testing purposes. SSH client & server work just fine till I tried to access one of my AWS EC2 box from this windows. It seems like I need to change the ...
156
votes
16answers
1.4m 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 ...
86
votes
4answers
48k 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)
2
votes
2answers
2k 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 ...
911
votes
23answers
1.0m 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 ...
229
votes
8answers
175k views

How to make an SSH tunnel publicly accessible?

Referring back to this question, I am executing the below via OpenSSH (Client: Mac OS X 10.6 | Server: Linux Mint), however the port that is being tunneled is not working publicly: ssh -R 8080:...
152
votes
9answers
175k 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 ...
33
votes
3answers
52k 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, ...
9
votes
5answers
22k 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 ...
0
votes
3answers
833 views

move all files in local directory to remote directory

I want to move all files in local directory to remote directory. And I am using this code to achieve it SOURCE_FILE=/var/www/oneserver/* TARGET_DIR=/var/www/anotherServer ARCHIEVEFILE=/var/www/...
139
votes
7answers
222k 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 ...
124
votes
24answers
200k 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 ...
128
votes
9answers
179k 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 ...
55
votes
7answers
79k views

Unable to change file permissions on Ubuntu Bash for Windows 10

I was trying to use an ssh instance and I received the following error, which is odd since I tried to change the permission using chmod, but that didn't seem to work as permissions were still 777: @@@@...
42
votes
4answers
31k views

Rsync files via intermediate host

I am currently away from my LAN and I need to do a backup of my laptop. I have a somewhat recent copy of my laptop on my server and I usually back the laptop up using rsync. Now I wish to do that, but ...
20
votes
1answer
7k 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 ...
15
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 ...
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 ...
4
votes
2answers
1k views

Does OpenSSH support multihop login?

Ansible uses OpenSSH as the bottomed network communicative implementation, but does it support multi-hop login? I mean, if Ansible can login a server directly, but can it log in server_a then from ...
1
vote
1answer
946 views

SSH into WSL from another machine on the network

I'm trying to deploy a distributed systems using Windows machines. However, the code I want to compile and run on this system should get complied in a Linux-based environment. Thus, I downloaded and ...
0
votes
2answers
505 views

Key Authentication Not Working in Ubuntu SSH Server

I'm trying to setup my ssh server for password less login (key login) and it does not work. I have tried different permission, played around with different usernames. same results. It continue to ask ...
232
votes
4answers
359k 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 ?
159
votes
9answers
134k views

How do I configure SSH so it doesn'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 ...
100
votes
10answers
93k 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 ...
74
votes
18answers
49k 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 ...
124
votes
9answers
166k 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 $...
33
votes
5answers
39k 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" ...
46
votes
2answers
46k views

ssh -o PreferredAuthentications: What's the difference between "password" and "keyboard-interactive"?

Both PreferredAuthentications=password and PreferredAuthentications=keyboard-interactive would prompt for the password, so what's the difference between them? I Google'd with the keywords ssh ...
16
votes
3answers
17k 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 ...
15
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 (...
11
votes
2answers
15k 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 ...
20
votes
6answers
275k 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 ...
9
votes
4answers
17k views

Windows SSH server refuses key based authentication from client

On Windows 10 1809, I have enabled the in-built SSH server, and have configured it. On another machine, I have used WinSCP and PuTTy generator to generate an authentication key. I copied the public ...
8
votes
3answers
19k views

Make IP address of WSL2 static

I am running an SSH server within WSL2 on a WIN10 machine. To make that work I am using: netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=22 connectaddress=172.19.237.178 ...
2
votes
2answers
8k 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 ...
6
votes
2answers
5k 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
2 3 4 5
16