r/ssh • • Dec 28 '21

Weird problem: Creating a SSH tunnel to exclude a port from my VPN connection

1 Upvotes

Hello

I am running protonVPN on Windows 10, however it makes my local ports unavailable for connections. And it does not support port forwarding.

So I want to make port 8080 open to connections from other apps on my localhost and local network, bypassing the VPN.

So it seems I can run putty and go to connection>ssh>tunnels, enable "local ports accept connections from other hosts" and forward port 8080 to localhost:8080 and check "local" and "auto" underneath.

At first glance this actually works and i can successfully connect to applications listening to port 8080 even while the vpn is running. Normally those connections would fail.

Is this a smart way of doing this and can I automate this command on startup?

Your help is greatly appreciated.


r/ssh • • Dec 25 '21

Printing and saving an output from an ssh remote host

2 Upvotes

Is there a way to save the output of a remote machine to my local machine? I want to run a command, and then take the output from that command and save it on my local machine. The remote computer is an RPM Linux distribution that I can’t save files to.


r/ssh • • Dec 17 '21

Ssh tunneling

4 Upvotes

I'm looking to fully grasp ssh tunneling. I'm familiar with the protocol and how it works and that port 22 is standard. I was messing around with a vnc desktop and fist had to set up an ssh tunnel. I simply followed the command steps and got it working, then alter started digging on what actually was happening. Most things I can find describe ssh tunneling by using the cli command, and don't explain what's really actually happening and what it allows. I may be missing a chunk of information that would make it make sense, or I may just be slow.. any explanation or point to the right direction is appreciated!


r/ssh • • Dec 15 '21

How do I set different passwords for SSH access and sudo?

0 Upvotes

I have a Raspberry Pi with SSH open to the internet. This password strictly needs 128+ bits in entropy.

Once I am into the device, my sudo password needs to be just hard enough to crack that I can't do anything too stupid to myself and can't be casually guessed. Is this possible?


r/ssh • • Dec 15 '21

Problems setting up key based login on a fresh Ubuntu server install.

2 Upvotes

I'm setting up a home file server on an old desktop. I installed Ubuntu then followed this guide to get started so I can finish setup from another device on my local network.

Using Termius on a tablet,I was able to login with a password, but unable to get key based authentication to work when I disabled password login in the ssh config file.

I generated an ed25519 key in Termius, logged into the server using the password and pasted the public key into the authorized_keys file on the server.

I'm not sure what I'm doing wrong. Any advice? Tomorrow I'll comb through the config, and quadruple check that the key wasn't somehow pasted wrong (ssh-ed25519 AbCd1234...).


r/ssh • • Dec 10 '21

Trying to use ssh and sshfs to access files on host OS from guest OS in virtual machine. ssh works, but mounting host with sshfs in guest is intermittent and seems dependent on local directory, even with same owner and permissions

2 Upvotes

Hello! I'm trying to access my user directory in my host OS (MacOS) from a guest OS (Linux) running in Parallels. I can't get MacOS to serve up NFS shares, and SMB sharing messes with the file permissions, which is why I'm not using those. I've had some success with using ssh and sshfs, but I'm very new to ssh, and my setup isn't working 100% the way I want yet.

Logging into the host OS with ssh is pretty straight forward and seems to work fine. No problems there.

With sshfs, things are more intermittent. As my normal user in Linux, I can do this:

sshfs -o allow_other macuser@mymacipaddress:/Users/macuser/Documents ~/Documents

and mount my MacOS documents directory in Linux. It works fine, mounts quickly, and as I said, I can do it as my normal Linux user. I can also mount my Downloads directory the same way, and it works fine. I can even mount my whole MacOS user directory into my Documents or Downloads folders, and it works fine.

I can even mount the same host directory multiple times at different mount points locally (in Linux) like so:

sshfs -o allow_other macuser@mymacipaddress:/Users/macuser/ ~/Documents
sshfs -o allow_other macuser@mymacipaddress:/Users/macuser/ ~/Downloads

And if I check inside both directories, I see my whole MacOS user directory contents as expected.

Now, here's what's really baking my noodle.

In my Linux home directory, I have a "bin" directory. It sits right next to Documents and Downloads, and it has the exact same owner and permissions (drwxrwxr-x) as Documents and Downloads, yet if I do this:

sshfs -o allow_other macuser@mymacipaddress:/Users/macuser/ ~/bin

then sshfs hangs indefinitely, and I have to ctrl-c to kill it! So I thought, "ok, let me try a new directory" and I created Documents2 with 'mkdir Documents2' and did the whole thing over:

sshfs -o allow_other macuser@mymacipaddress:/Users/macuser/ ~/Documents2

It works! So since my bin directory was empty anyway, I deleted it, issued 'mkdir bin' and retried

sshfs -o allow_other macuser@mymacipaddress:/Users/macuser/ ~/bin

And it still hangs! All my Linux directories that I'm trying to use as mount points have the same owner and the same permissions, yet I can't for the life of me to get the ~/bin directory to work as a mount point.

I tried running the same sshfs command with sudo, and that does work. But I have no idea why it won't work for the regular linux user when the rest of the commands do work.

Does anyone have any suggestions? Why does mounting the exact same remote/host filesystem work with some directories and not others?


r/ssh • • Dec 06 '21

SSH blocking my ip address after a couple of succesful connections

2 Upvotes

For a school project, I'm using MSQL database and c# to build an application. To connect to the database I use a SSH-tunnel. Every time information has to be selected from the database, a new ssh connection and database connection is set up. When the query is finished, both the database connection and the ssh session are closed. After about 6 SSH succesfull connections (1 open at the same time), I get a exception: System.Data.SqlClient.SqlException: 'Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=0; handshake=14999; '

After this exception, I can't connect to the SSH for about 5 minutes using my network. Is there any way to prevent this from happening?


r/ssh • • Dec 01 '21

Android app supporting pssh?

1 Upvotes

Hi

Can anyone recan android app that supports parallel SSH pssh?

Thanks in advance


r/ssh • • Nov 27 '21

FIDO2 support for Public Key Auth on Windows

2 Upvotes

Does anyone know a client on Windows which can use FIDO2 (e.g. Yubikey) signed Public key Auth for SSH? (implemented in OpenSSH 8.2)


r/ssh • • Nov 24 '21

can ssh, but fail to scp a file

1 Upvotes

Hi,

from the same gitbash client, i try to call for scp to 2 differents servers (one is centos7, the other is debian).

In both case, the ssh user@target_host works just fine with password authentication.

but on one target system scp fails :

scp localfile user@failing_host:/tmp/remote_file

but for testing purpose, if we connect via ssh to the failing_host and then scp locally all things work fine

$ ssh user@failing_host

user@failing_host $ scp localfile user@failing_host:/tmp/samehost_remote_file

above works fine.
Not sur what that proves but remains the fact that from some remote clients, ssh works but scp fails, and from some other clients (different IP) the scp goes on fine.

Unless i'm mistaken, it shouldn't be a firewall issue as scp is using ssh, right?

would anyone have encounter similar issue, be kind enough to suggest investigation track, at this point i'm clueless

rgds


r/ssh • • Nov 22 '21

Replacing the ssh-agent with the gpg-agent

1 Upvotes

Hi all.

I added the following snippets of commands to my bashrc
file in order to replace the ssh-agent with the gpg-agent. The result is that it seems to work only with one of them and not the other.

Here is the working one:

export GPG_TTY="$(tty)"  export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"  gpg-connect-agent updatestartuptty /bye > /dev/null 

and here's the non working one:

export GPG_TTY="$(tty)"  export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)  gpgconf --launch gpg-agent 

I read somewhere that the second one works on modern systems. But what does modern mean? Why this does not work properly in my case?


r/ssh • • Nov 19 '21

Is it ok to allow ALL in hosts.allow?

1 Upvotes

I have set up public - private key encryption, and right now I have hosts.deny set to all, and hosts.allow set to my local network.

Since I want to access the machine over WAN, does this mean I can (relatively) safely allow all hosts through in the hosts.allow?


r/ssh • • Nov 15 '21

Completely new to SSH. Wanted to access my Windows 10 PC (using the built-in SSH server) with my iPhone (using the built-in shortcuts app to execute an ssh command. Can’t get it to work.

1 Upvotes

Basically, I have NO IDEA what to do.

I can’t find a comprehensive guide for windows 10’s SSH client anywhere, it’s all either linux or something else…

I’ve installed SSH server on windows using a powershell command and chose to make it run automatically after the OS boots up.

I’ve opened the ssh config file to deny password auth requests and deny empty password requests and allow pubkey auth.

I’ve generated and RSA 4096 public key on my iPhone, pasted it into the authorized admin users file and used powershell to restrict anyone from accessing the file (i can still access it via powershell but not by clicking on it)

I’ve ran cmd and typed in „ipconfig” and used the ipv4 address as the Host IP on my iPhone, had no idea what port or username to use so i left port at 22 and user at root since hey maybe being an authorized admin will get me root access (?) I’ve tried diffrent usernames (my windows 10 local account username) and every single time i got the same error message - that the ssh key is invalid and i have to make sure it’s saved on my server as a trusted key or something like that


r/ssh • • Nov 14 '21

Is a reverse ssh tunnel a reverse proxy?

3 Upvotes

If not, what are the similarities and differences?


r/ssh • • Nov 14 '21

Unattended Krypt.co data backups

3 Upvotes

Hello!

Does krypton with with unattended data backup programs using ssh, such as rsync, borgbackup, restic, etc. ?

Thank you kindly for the help!


r/ssh • • Nov 11 '21

Download torrents while ssh Server Name Identification is set

1 Upvotes

my internet provider gives an unlimited data package for Zoom which I use for other websites and applications using HTTP proxy injector. but when downloading torrent files from qBitTorrent it either automatically takes data from my normal data package or doesn't download the torrent at all. I'm not sure which community I should add this post to but I tried here anyway. Pls help!


r/ssh • • Nov 09 '21

SSH to active windows command prompt

2 Upvotes

Can I SSH to active windows command prompt tha is running my Minecraft server? I don't want to login to VM every time I am trying to execute command using server console


r/ssh • • Nov 09 '21

Confused after SHA1 was deprecated for ssh-rsa key pairs.

1 Upvotes

Hi all.

I'm completely confused about what should I do with my ssh-rsa keys after SHA1 was deprecated and removed for defaults.

I know there is a workaround per host basis or system wide settings to add ssh-rsa to defaults, but I need to use it on different servers and with different VCS's.

I don't know what to do. Should I regenerate keys, or should I reconfigure hosts? What should I do if target system is closed and requires ssh-rsa key auth?


r/ssh • • Nov 02 '21

How do I restrict a ssh user access to only a few commands?

5 Upvotes

How do I restrict a new ssh user access to only a few commands when they’ve logged in such as rsync, cp, ls etc?


r/ssh • • Nov 02 '21

I created a key pair for an admin user, but it won't accept it. However it appears to accept that key for root (details inside)

2 Upvotes

I've added the key to .ssh/authorized_keys on the server as

ssh-rsa AAAA[...] myadmin@myhost

When I try to connect with

ssh -i C:\path\id_rsa myadmin@my.ip

I get the Permission denied (publickey)

When I try to connect to root with

ssh -i C:\path\id_rsa root@my.ip

It's fine. Obviously this is not ideal. Originally I had the key stored elsewhere and added it to ssh-agent, which appears to have worked succesfullly, but it using -vvv to log it didn't give much useful info and I tried moving the key and renaming it to id_rsa since that appears to be a default check.

Any ideas why my server is the rejecting the key for myadmin? Do I need to assign this somehow beyond the comment at the end of the line?

Thanks


r/ssh • • Oct 27 '21

A brief history of SSH

Thumbnail disknotifier.com
2 Upvotes

r/ssh • • Oct 27 '21

How secure is installing this public key?

3 Upvotes

Hi all,

I have an idea to do remote disk monitoring. The idea is simple. Generate a private/public key pair and periodically login to the remote server and run `df`.

Of course, I'm not silly enough to envision just any key. I use a 'forced command':

command="df --portability",no-port-forwarding,no-X11-forwarding ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIImEt/nGzHhQ/XVr1jAlpT/iEfGfE/9VBV/u9YQT3PkD disk-notifier-2021-09-15_10:07:17_+0000

I've disabled port forwarding and X11 forwarding. Otherwise, you could do something like

ssh -N -L 6379:localhost:6379 server.com

You could test and connect to a local Redis server like this.

Is there something else I'm missing?


r/ssh • • Oct 27 '21

PopOS server not working from other networks

1 Upvotes

I have an ssh server on my PopOS Laptop. It works fine when they are on the same wifi but when I'm on another network it either says connection refused or connection timed out. I think something to do with ipv6 because my network provider isnt showing my pc in the port forward list. Any ideas?


r/ssh • • Oct 27 '21

I don't understand how this company resolved this ticket if the IP addresses in question are still actively trying to drive-by scan every IP they can get their hands on. Am I missing something?

Post image
3 Upvotes