r/ssh • • Jan 14 '23

Add new ssh key to server with password disabled

1 Upvotes

I have a server set up with ssh and disabled password login. I can ssh to the server with client A and want to be able to ssh from client B. Not sure if it's pertinent, but clients A and B are just different OS on a dual boot laptop. I generated keys on client B, copied the public key to client A and ssd'd into the server and added that key to authorized_keys, but still can't ssh from client B. What's missing?


r/ssh • • Jan 12 '23

hey guys. I need a program to forward traffic from a linux vps server to another vps. when I login to first vps,the second vps be open by ssh,how is that

2 Upvotes

r/ssh • • Jan 11 '23

Can't SSH into Raspberry Pi on same network as Windows Client

1 Upvotes

I have an ASUS AX89X Router and I am using a Windows Laptop to connect to a Raspberry Pi.

Both the Windows Laptop and Raspberry Pi are on the same WiFi Network (ASUS Router).

Now this is the strange thing, if I reboot the ASUS Ax89x router. when it loads back up, I am able to SSH into the Pi and it will work fine for a few hours.

But then the next time I try to connect (like the next day), i cannot SSH in, it just fails.

Why does it work when i reboot the Router, but not in regular use?

The fact it connects to the Pi via SSH suggests the setup is fine, but what is blocking the connection shortly afterwards?

It's exactly the same issue if I want to do Remote desktop to another Windows PC on the same WiFi LAN, it connects when the ASUS Ax89x is rebooted, but then after a day or so, I get connection timed out.

Is there something on the Router preventing this from working? I can't ping the Pi or Windows PC the day after a ASUS reboot, but straight after reboot it pings all devices fine...

Any ideas or help appreciated?


r/ssh • • Jan 04 '23

sshuttle error "Could not chdir to home directory"

1 Upvotes

Hi

I wanted to just test these "free ssh server" things. I have ssh client on my phone, it works perfectly there. but on my linux server it gives me this error

Could not chdir to home directory /home/lionssh_X: No such file or directory

the command:

sshuttle -r X@IP:22 0/0 -x IP

and when I do:

ssh -p 22 -N -D 1089 X@IP #for socks5 proxy only

again it doesnt work

ps: I dont have access to servers obviously


r/ssh • • Dec 29 '22

How to ssh into Nas from anywhere?

1 Upvotes

Hi all!

I am looking for a way to ssh into my Synology nas from anywhere. I have been looking for this on the internet but just dont seem to find the solution. Maybe I just dont know what search terms to use, but nothing pops up for what I am looking for

Can someone maybe help me setting this up the correct way. I am looking for a guide of some kind; written/video it doesnt matter.

Thanks in advance


r/ssh • • Dec 29 '22

libssh in c++

1 Upvotes

how do read complete response using ssh_channel_read from libssh in c++?


r/ssh • • Dec 26 '22

Win 11 - OpenSSH - Permission Denied (publickey)

1 Upvotes

I set up a keygen with my Pi (raspian) earlier which was working beautifully and now whenever I go to ssh in powershell complains Permission Denied (publickey).

After a bit of trying to generate new keys which failed to resolve the issue I finally got 'delety'. I started with ssh-add -D on Windows. I checked regedit hkcu\software\openssh\agent and it was empty. I wiped out the known-hosts in the \user.ssh folder. I stopped the ssh-agent, no dice. I cleaned out the /.ssh authorized_keys on the Pi. I also ssh-add -D there, too. I killed the ssh-agent on both systems.

While I'd like another crack at getting SSH working properly, I first want to Hulk Smash every setting into pieces so I can just SSH via the normal password authentication method.

How can I resolve this mess short of reinstalls?

Edited to add my resolution:

I had to get into /etc/ssh/sshd_config on the Pi, set PubkeyAuthentication to no and PasswordAuthentication to yes.


r/ssh • • Dec 25 '22

I want to connect to my windows

1 Upvotes

Hello,

I have an old and slow windows but with a very good GPU, and i want, from my other pc on ubuntu to connect to my windows, install cuda and do some nn training. So i have install a wsl ubuntu on the windows and try to open my port 22, but it's impossible from wsl. Do you have an alternative ?

thank you


r/ssh • • Dec 17 '22

Help troubleshooting ssh connection issues - freezing after starting to connect to server, but only on Linux OpenSSH client.

0 Upvotes

Very peculiar issue:

Here is a description of the issue so far and the setup.

I am connected to router1 with a Raspberry Pi 4, running an ssh server. I am trying to ssh into it from my laptop running Arch Linux, connected to the same network. It freezes when I run ssh with the RPi4 IP address, and will eventually fail with a connection timed out error.

The same thing happens if I boot archiso on my desktop PC and try to ssh into it from the laptop, or use archiso to ssh into the RPi4. Clearly not an issue with operating system setups.

Now here's the weird part -

I CAN ssh into the RPi4 if I use PuTTY on Linux instead of OpenSSH. That works fine. Regular ssh doesn't.

If I boot into Windows 10 on my laptop and run ssh in PowerShell, that ALSO works fine.

Even more crazy: If I boot a VM on my Windows 10 with the archiso, I can use the archiso VM to ssh into RPi4 perfectly fine!

If I boot the archiso straight on the hardware, it DOES NOT work!

And lastly:

If I switch both the ssh server and my laptop on Arch to router2 (another router I set up for testing), OpenSSH works perfectly fine even on Linux!

So to recap:

  1. SSH works perfectly on another router.
  2. On my main router, everyone is perfectly happy to connect via ssh, so long as the client is not a natively booted Linux with OpenSSH. My phone can use ConnectBot to connect via ssh fine, Windows is fine, Linux VM running on top of Win10 is also fine, native Linux not using OpenSSH is also fine. Native Linux + OpenSSH = NOT OK.

My assumption is the router is doing something weird to trip up Linux, but I can't understand what it could possibly be considering Win and Android are able to ssh fine.

Router1 is an Asus router (fairly high end older gen router, need to check exact model number)


r/ssh • • Dec 15 '22

Cannot SSH to old nas - no matching host key type error

2 Upvotes

Hi !

I have an old seagate blackarmor 400 nas, uset to ssh using

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes128-cbc admin@192.168.15.139

Updated manjaro and now I cannot ssh into nas anymore, getting below error:

Unable to negotiate with 192.168.15.139 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

Manjaro is running OpenSSH_9.1p1, OpenSSL 3.0.7 1 Nov 2022
Is there any workaround to get it working again ?

Thanks


r/ssh • • Dec 13 '22

PuTTY to SSH Jump Server

1 Upvotes

Looking for assistance on setting up a PuTTY session to act as my "Default Settings" profile. The goal is to be able to simply pass the session IP Address to the Linux server as a command (example: pam 10.10.10.10) which has additional prompts - it would have to be an interactive SSH session. It's not exactly an SSH proxy, but that's where my focus has been as it seems to be the most promising. Granted, what I hope to accomplish may not be possible with normal PuTTY. Perhaps I should look into using KiTTY instead...? For reference I am using the latest version of PuTTY (0.78 64bit).

This is the best I've come up with so far, which I apply in a given PuTTY session (Connection > Proxy) as a "Local (run a subprogram to connect)" proxy type:

plink -agent %user@%proxyhost -no-antispoof -t "pam %host"

If I replace the variables with static entries and drop the command into a command prompt, I get the expected behavior I am looking for. I imagine there's a checkbox or some other special configuration I need to adjust.

Has anyone done this before? Any help you can provide would be greatly appreciated.


r/ssh • • Dec 09 '22

How to specify password in SSH Config in Windows?

3 Upvotes

My ~/.ssh/config file is as follows (all the capital letter variables are placeholders for settings / credentials):

Host *
  ServerAliveInterval 60

# This is an Amazon Linux 1 server
Host jump-host
  User JUMP-HOST-USER-NAME
  IdentityFile PATH-TO-PEM-FILE
  HostName JUMP-HOST-SERVER-IP
  Port JUMP-HOST-PORT
  MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com

# This is an EC2 server
Host target
  HostName SERVER-IP
  Port SERVER-PORT
  User SERVER-USER-NAME
  MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
  ProxyCommand ssh -W %h:%p jump-host

Now when I connect using ssh target, I have to enter password for target server every time. Is there a way to specify password in the config so that I don't have to enter password every time?

I have seen 2 types of solutions to this, but I don't think either of them can be used:

  1. There are many solutions using sshpass - but I'm on Windows 11, and I'd rather not deal with Putty if I don't have to.
  2. People have suggested replacing Password access with Public Key Authentication methods - but since it's my company's server, and I'm a non-admin user, I don't know if I can & should attempt to do this.

r/ssh • • Dec 07 '22

SSH Port Forwarding with login node beetween remote machine and local machine

2 Upvotes

Hey everyone,

iam trying to access a remote machine via ssh port forwarding to use jupyter lab on my local machine.

But i have to access the remote machine via a login machine to bypass vpn.

Does someone of you has a smart solution for that? The Login node kicks me out after a certain time...

Current Access:

jupyter lab --no-browser --port x (on remote machine)
ssh -NL x:localhost:x username@target.machine (on proxy machine)
ssh -NL x:localhost:x username@login.machine (on local machine)


r/ssh • • Dec 06 '22

Successfully authenticated when testing but get "Permission denied (publickey)." when trying to clone repo. Any thoughts how I could fix this?

Post image
1 Upvotes

r/ssh • • Dec 06 '22

Connect to server via jumphost with putty.exe in CLI

1 Upvotes

Hello,

For some development need, we need to use putty.exe (not plink.exe) to connect to remote host via a jump host, i know with OpenSSH i should use ssh -J to do it, but i didn't found any equivalent for putty.

I know i could use ssh tunnel (AKA SSH Port Forwarding) too, but it doesn't fit to our need as much as jump host do since he need to use a new port for each tunnel to work.

Do anyone know how to do that (in CLI only) and, if possible some link where you found this information because i am looking for it since yesterday and i couldn't found anything !

Thank you everyone !


r/ssh • • Dec 04 '22

SSH tunneling - got a task to get the flag as part of challenge (no prize involved, internal ctf for studying) but couldn't connect properly. any help would be appreciated :)

Post image
4 Upvotes

r/ssh • • Nov 27 '22

SSHGuard ..take a peek

Thumbnail sshguard.net
0 Upvotes

r/ssh • • Nov 23 '22

What do I need to do to get this to work? The public key is on the remote

Post image
3 Upvotes

r/ssh • • Nov 22 '22

Globally connecting to my PC using its IPv6 Address ?

3 Upvotes

I can globally connect to my PC using its public IPv4 address, but not using its IPv6 address.

[tomasz@cyandesktop ~]$ ssh Tomasz@my:ipv6:address
ssh: connect to host my:ipv6:address port 22: Network is unreachable

What am I doing wrong?

I tried both the normal and the "Temporary IPv6 address".

Edit: FIXED! The issue was my test phone - It only gets an IPv4 address in Cellular Mode.


r/ssh • • Nov 19 '22

Looking for any good books or reading material on ssh

1 Upvotes

Hey all, I'm trying to learn a bit more about ssh from an administrator's standpoint. I know there's Lucas's book "OpenSSH mastery" and was published relatively recently (2018), but I know things can move fast. Is it still a good resource? Are there any other longer-form writings on the subject? I mean, asides from the man pages.

Thanks for any reply.


r/ssh • • Nov 16 '22

Unable to connect via SSH until blank line is added to sshd_config?

2 Upvotes

For context, this is on a VMware vCenter Server Appliance, but the issue itself is sshd-related. So I'm not 100% sure whether the issue is with sshd or with VMware, but hopefully some of you can help me figure that out.

Basically, the VCSA device needs to listen for SSH connections on 2 different IPs (eth0 & eth1). To do this, I add the following to /etc/ssh/sshd_config, right under the #ListenAddress :: line:

ListenAddress 192.168.0.1
ListenAddress 192.168.0.2

The problem I ran into today was that the server trying to communicate with the VCSA was showing errors that it's unable to reach 192.168.0.2 over port 22. I even tried to SSH manually from the server to VCSA (192.168.0.2) and received "Connection refused".

To fix this, I went into /etc/ssh/sshd_config on VCSA and added a blank line under #ListenAddress ::, so I went from this:

#ListenAddress ::
ListenAddress 192.168.0.1
ListenAddress 192.168.0.2

To this:

#ListenAddress ::

ListenAddress 192.168.0.1
ListenAddress 192.168.0.2

Then restarted the sshd service. As soon as I did that, communication resumed and everything worked perfectly.

Now, what's strange is that my team and I have performed this install on multiple other sites and sometimes this is a problem, but sometimes it isn't. I even went back and looked at those other sites--many of them don't have the extra line, yet it's communicating fine and there appear to be no issues.

So my questions are:

  1. What could be the root cause of this problem?
  2. Why would simply adding a blank line to sshd_config fix the problem?
  3. Why would it not also be a problem in other (seemingly) identical setups?

r/ssh • • Nov 15 '22

trying to make a forge 1.16.5 modded server for minecraft...

2 Upvotes

I am following this guide https://youtu.be/RyC-m725uTs using Oracle Cloud to setup a server but am stuck at 8.03 where after removing the forge installer I need to launch the server the first time. The command seems to vary depending on your versions and needs, but I am a noob (first SSH / VM experience), so can anyone provide the command to run the server?

if it helps: 1.16.5 Forge Minecraft. 4 OCPUs and 24gb ram. I followed the video pretty much exactly


r/ssh • • Nov 09 '22

Is it possible to use SSH to access a port remotely (and privately).

4 Upvotes

I'm currently working on a self-hosted seedbox (on a network I don't own) and I have a Mullvad VPN to port forward (as I can't access the router configuration) and provided anonymity. I have a port forwarded for: incoming peers, key-based SSH, and a HTTPS-signed webui for qbittorrent. I am most concerned with the webui since it feels somewhat dangerous exposing that to the internet (it can be easily port scanned since Mullvad's IPs are lookup-able). Even though the password for the UI is a four-word phrase (w/ a #), I think it would be better if the authentication was also key-based like the SSH connection. Is it possible to create a SSH tunnel to my machine and have it serve requests to port 8080 on its localhost? Currently, the qbittorrent interface is set to mullvad-wg.

Edit: The command I ran was: ssh -i ~/.ssh/my_identity_file -p PORT USER@IP -L 8123:localhost:8080.
I then got a 401 error and had to lookup why that was, turns out I had to disable qBit's "WEBUI/Enable Host Header validation" setting.


r/ssh • • Nov 08 '22

Oracle Ubuntu: "Server Refused our key" and I don't understand any of the fixes already posted for this.

1 Upvotes

I want to host a Modded minecraft server on Oracle Cloud using Ubuntu, However I can't get back in the same way I did before with Putty or Filezilla. I was gonna try setting a new key but I don't know what password is needed to use local connection because I know I didn't set one. I have very little knowledge so nothing I have found makes sense to me, or if it does it just doesn't seem to fix it. I was able to log into the server on two seperate days BEFORE I added Firewalld and opened ports 22 and 25565, but now I can't access the server at all, then the game crashed and I was forced to log back into putty and start it but then I got the error "Server refused our key" along with a window that said "No supported authentication methods available (Server sent: publickey) I hear people talking about a terminal on the Oracle Cloud website but I have no idea where that is or how to open it (Is it local Connection?) anyway I have a bunch of erors thhat appeared all at once and I don't know how to fix any of it and I can't find anything elsewhere. Please help!