All Questions
503
questions
352
votes
19
answers
323k
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 ...
214
votes
7
answers
209k
views
scp between two remote hosts from my (third) pc
I have two remote hosts.
host1-> 10.3.0.1
host2-> 10.3.0.2
Both run an ssh server.
The ssh server listens on port 22 in host1 and on port 6969 in host2.
Now, using my local machine, I need to copy ...
35
votes
2
answers
147k
views
SSH: Troubleshooting "Remote port forwarding failed for listen port" errors
Question: Why does ssh -N -R 2222:localhost:22 <bluehost_user>@<bluehost_ip> result in a "Remote port forwarding failed for listen port" error? The objective is to establish a ...
29
votes
1
answer
13k
views
How to release ports on the SSH server when a reverse ssh tunnel disconnects abruptly/uncleanly?
We have a some hardware we install at our customers' locations, that hardware connects to our ssh server and establishes a reverse ssh tunnel so we can gain access to several client systems for ...
28
votes
5
answers
76k
views
How to (cleanly) dismount sshfs when mounted on a NFS mount point?
My coworker has a desktop computer with /home shared on our file server. I have developed a Perl script for sshfs-mounting a certain directory on another SSH host which works fine on my laptop.
On ...
24
votes
2
answers
34k
views
how to run a tunnel in the background as part of a shell script
I run these two commands all the time to connect to my rds instance on aws that's protected behind a firewall (so i tunnel through the ec2 instance) like so:
command 1: open the tunnel (run on ...
22
votes
3
answers
51k
views
How to connect to Windows subsystem for Linux from another machine within network?
I set up my Ubuntu WSL instance and am running an SSH server on it. However, when I do ifconfig on the Ubuntu console, my Ipv4 is 172.26.66.223, which is different from my regular machine's ipv4 192....
20
votes
2
answers
34k
views
Bluetoothctl connects and disconnects repeatedly
I am using a Raspberry Pi Zero with a Iot pHat and was able to ssh into the Pi using a USB cable using this tutorial. I then set up my home WiFi with the pHat. Then I powered up the Pi with a separate ...
17
votes
4
answers
49k
views
How to set up an alias server name
I want to set up an alias server name on my laptop (Linux). I do not want to use the /etc/hosts/ file since the IP address of the remote server changes. The reason I want to do this is because the ...
15
votes
2
answers
20k
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
2
answers
16k
views
Why does rsync over SSH give me 10x the throughput of SCP?
scp user@aws-ec2:~/file file
rsync --partial --progress -Pav -e ssh user@aws-ec2:~/file file
scp only gives me 200K/s, but rsync gives me 1.9M/s
I tested several times, all same results.
rsync ...
14
votes
1
answer
1k
views
Are host configurations in the SSH config merged?
I have the following generic host configuration in my .ssh/ssh_config:
Host *
ConnectTimeout 5
ServerAliveInterval 5
ServerAliveCountMax 12
I also have some specific configurations. For ...
12
votes
3
answers
16k
views
ssh multi-hop... adapting command to ssh config file
I am trying to put my multi-hop ssh command into the ssh .ssh/config file.
This is my connection graph: laptop (i am here) ------> userver -------> workstation
I have put the ssh public rsa keys ...
12
votes
2
answers
6k
views
Laggy SSH sessions on local network
I have two machines:
Windows 7 connected by ethernet to a router
NixOS laptop, connected wirelessly to same router
My issue is that sshing from Windows to NixOS is extremely laggy. If I ping NixOS ...
11
votes
3
answers
15k
views
Not authorized to control networking in SSH console
I want to control Network manager from the command-line. This worked well enough in Ubuntu 10.04 (with cnetworkmanager, nmcli is another possible choice).
Since the upgrade to Ubuntu 10.10 however, a ...
10
votes
5
answers
225k
views
SSH :connect to host localhost port 22: Connection refused
In debian kali I tried to connect ssh and getting the following error :
SSH: connect to host localhost port 22: Connection refused
Background :
I was trying to connect ssh in debian, I am using ...
10
votes
3
answers
2k
views
Attach to the same tmux session from different nodes of a cluster
I'm working on a computing cluster which has several hundreds of nodes. A load-balancing scheme picks an idle node to login to when ssh-ing into the cluster. As a result, it is very unlikely to re-...
9
votes
2
answers
6k
views
Hyper-V guest hostname doesn't resolve in local network
My Hyper-V host is Windows 10 Enterprise x64. I only have one guest running: archlinux.
The guest is connected to all NICs:
WiFi
Ethernet (physical)
Occasionally, I will SSH into the guest from ...
9
votes
1
answer
13k
views
Why would anyone install openssh-client instead of openssh-server? [closed]
I installed openssh-server on two pc's. I can connect from both from the one to the other. So if openssh-server sends as well as receives ssh, why would you install the openssh-client, just to make ...
9
votes
1
answer
15k
views
Troubleshooting "Connection closed by authenticating user andy 173.63.60.32 port 11706 [preauth]"
As noted in the title, I am having trouble connecting to a remote server through ssh.
I am trying to connect a Windows machine to a server running CentOS. I have been using PuTTY on the Windows ...
8
votes
1
answer
20k
views
Can ping but can't connect (curl, wget, apt-get, etc.) (rasberry pi server)
Background:
I am trying to set up a rasberry pi server. Everything was going well and my pi could apt-get update etc, until I got the port forwarding to work and ssh to work outside of the LAN. I ...
7
votes
3
answers
8k
views
how to solve: ssh "Connection corrupted" error
On a Oracle/RedHat VM that I use every days (probably after the nightly upgrades) I've this authentication error:
$ ssh machine
Bad packet length NNNNNNN. ssh_dispatch_run_fatal: Connection to A.B.C.D ...
7
votes
4
answers
24k
views
SSH gateway server
Is there anyway to set up a ssh gateway server? What I am trying to setup is a way to connect to a specific linux shell on a Lan remotely from the internet without using port numbers. So for example ...
7
votes
2
answers
3k
views
Why ssh -R allows port '0' but ssh -L needs a port number?
Why with ssh -R is possible to allocate a free port by specifying '0' while with ssh -L you need to specify a valid free port?
I want ssh to use a local free port to FWD remote traffic without ...
6
votes
2
answers
16k
views
Use ProxyCommand for all SSH Connections
I was playing around with the idea of having a SSH Proxy Server or otherwise called Jump Host, which I would use to connect to all of my "hidden" Servers. So basically I have the following setup. ...
6
votes
6
answers
105k
views
SSH error ssh_exchange_identification: read: Connection reset by peer
I am trying to access ssh to a server but got "ssh_exchange_identification: read: Connection reset by peer". The same client works well when I move the computer to home but show the error when the ...
6
votes
2
answers
2k
views
Forward DNS request to my work's jump server
I have SSH access to a jump box on my work. This jump box gives access to the complete network infrastructure at work. This is great to work from home.
I am able to run a SOCKS5 proxy on the jump box ...
6
votes
1
answer
14k
views
Remote desktop connection to linux computer
I am frequently using ssh to connect to remote linux machines. Using ssh -X it is even possible to use the gui. Unfortunately, this is very slow, when done over the internet. The gui is very sluggish, ...
5
votes
1
answer
24k
views
Send Telnet command inside a SSH Tunnel
I want to connect my personal computer to some routers via Telnet, for managing them.
Actually, my routers is in another network. I open the console, make a SSH connection to the Main Mahcine, and ...
5
votes
3
answers
7k
views
Set up direct SSH connection from A to C without public IPs using one public SSH server
I have available these SSH servers/clients:
A - without public IP
B - public IP
C - without public IP
I know, I can establish an SSH connection from A to C as follows:
1) Hook C to B. ...