0

I'm writing a bit confused because I've tried everything. Let me know if I'm missing any critical information for you to help me.

I'm trying to SSH into my Cyberpower PDU (device probably not important), which is connected to my computer running Windows 10 via Ethernet cable. I have enabled SSH communication on the device by logging into the IP address that I set it up on and configuring my port 22 for SSH. I need to use Mathematica for this project, so that's what I've been using.

At first I thought that simply telling Mathematica to connect to the IP address of my device and entering my computer log-in credentials would work, because that's how you usually SSH into your server. Mathematica kept returning an error that my credentials were wrong, even though they weren't.

So then I tried using a keygen, which should be foolproof. Even when I generate a private key and tell Mathematica to use that file to connect to SSH, it still asks me for my computer log-in credentials, which it shouldn't! Because the SSH key should be enough. And then I enter my credentials and it still won't let me in.

I don't expect many Mathematica users here, but here's my code below. This should be enough to establish the connection. (and ignore the fact that my SSH key is stored under a different user's folder - my computer wasn't wiped properly before being administered to me. I also disguised my IP address.)

RemoteConnect[IPAddress["XXX.XXX.XX.XX"], Authentication -> <|"Username" -> "Darren", "SSHKey" -> File["C:\\Users\\chigozie\\.ssh\\id_rsa"]|>]

I should add that when I use putty to do the same thing, my credentials work... but when I use powershell, they don't. If that's a clue at all.

Generally speaking what could be the reasons why I get rejected from of my SSH network even when I'm using a private key and entering my correct credentials? What should I do to solve those issues?

Darren
  • 1

1 Answers1

1

Sounds Like a permissions issue. What is the operating system the PDU runs on? I did a little research and I can't seem to figure out what type of console you get with it. Does it Use OpenSSH?

If it is linux or bsd based and you can get shell access maybe try

vim /etc/ssh/sshd_config

and adding the line

AllowUsers username

Where username is your username. Basically you want to be sure that your user is allowed to log in over ssh.

This is the same behavior you would expect when trying to log in as root on a linux server over ssh where the

PermitRootLogin no

option is set.

Blockquote I should add that when I use putty to do the same thing, my credentials work... but when I use powershell, they don't. If that's a clue at all.

Just saw this. My answer isn't going to help you then. Might be a permissions issue on your keyfile.

turbo
  • 36
  • 3
  • thanks for your response though! ok, going down that line of thought now. – Darren May 31 '20 at 01:43
  • I've narrowed the problem down to Mathematica. Turns out the function they use for SSH tunneling is still an "experimental" function that they're working on. I'm able to do this tunneling from other programs so I'm just left to assume that it's a Mathematica problem :/ – Darren Jun 03 '20 at 23:37
  • Hi @Darren ! I just got a PDU from cyberPower (model PDU41001) and I am struggling with the same problem. This thing does not have linux, at least the user interface is not that of a linux system. I am trying to upload my public key but when I click the "Upload Hostkey" I get an error. If I then click "Export Hostkey" an almost exact copy of my public key is downloaded.. My original key says "user@machine02" while the exported one says "user@machine0" To login I am using this: ssh -o PubKeyAcceptedAlgorithms=ssh-rsa -o HostkeyAlgorithms=ssh-rsa -c aes256-cbc admin@ – viterbi Apr 17 '23 at 23:31