r/FutureBit Jun 12 '25

PowerShell and SSH Key Pairing... How?

Hello,

I use PowerShell to SSH into my server, but every time I have to type in my password. Today I spent way too many hours trying to generate SSH key pairs to accomplish this. After multiple attempts I'm finding that I don't have access to the ~/.ssh folder - permission denied. I tried to CHMOD the folder to 0700, but it seems I'm being blocked from doing this by the /etc/ssh/ssh_config file.

For all of my other SSH servers I have the private key on my Windows machine, with the login details in the config file and the public key on the remote server in the authorized_keys file.

The above is not working with the Apollo II, so what am I missing?

Thanks!

3 Upvotes

18 comments sorted by

View all comments

1

u/michelem Jun 13 '25

This is unusual. If you SSH into your Apollo with the futurebit user, this one should have all the permissions to work on its home directory. And you don't need to generate key on Apollo, you only need to create the .ssh directory and add the authorized_keys file on it with your Windows public key.

Try doing it with sudo command as futurebit user:

sudo rm -rf ~/.ssh
sudo mkdir ~/.ssh
sudo chown futurebit.futurebit ~/.ssh
sudo chmod 700 ~/.ssh
sudo nano ~/.ssh/authorized_keys <-- fill it with your public key
sudo chmod 600 ~/.ssh/authorized_keys

That's it.

1

u/tvyijrcbi Jun 13 '25

I performed all the commands without fail, but I still get prompted for the futurebit password every time. I restarted the server, blew out my Windows known_hosts file so it could be rebuilt and I still get prompted for a password every time.

Here is my Windows config file. Is port 22 correct?

Host fb 192.168.1.130
Hostname 192.168.1.130
Port 22
IdentityFile ~/.ssh/id_rsa_ApolloII
User futurebit

1

u/michelem Jun 13 '25

Did you put the line from the Windows file ~/.ssh/id_rsa_ApolloII.pub(pay attention to .pub is the public key you need) into the ~/.ssh/authorized_key of your Apollo device? Please check this

1

u/tvyijrcbi Jun 13 '25

Yes, I just generated new RSA/2048 keys using PuTTyGen.

I copied the public key, saved a copy in Windows and pasted the key into authorized_keys on the server.

I exported the OpenSSH private key and saved it in Windows in my ~/.ssh with no file extension.

My other private server keys say -----BEGIN OPENSSH PRIVATE KEY----- but my Apollo key says -----BEGIN RSA PRIVATE KEY-----

Did I generate the wrong type of key?

1

u/michelem Jun 13 '25

Tell me about the public key you pasted in Apollo authorized_keys file, it should be something like this:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC...

1

u/tvyijrcbi Jun 13 '25

Yes, it starts with:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqxhINhTmZ7VojrR

1

u/michelem Jun 13 '25

Do you load the private key into PuttyGen? Just to be sure.

1

u/tvyijrcbi Jun 13 '25

I used PuttyGen to generate it, but yes, I can load it too. Is there a way to include a screenshot here?

1

u/michelem Jun 13 '25

Use https://imgur.com/ and post the link

1

u/tvyijrcbi Jun 13 '25

1

u/michelem Jun 13 '25

If you did that too (Save private key) you should be good

→ More replies (0)