Missing/no ssh authorized_keys file

Hi all,

Trying out BoringProxy for the first time - When trying to create a tunnel (client running Ubuntu 22.04), I received the following error message:

I followed the advice to use ‘sudo chown -R $USER ~/.ssh’ (given here) - to no avail, though I am a bit of a noob when it comes to file permissions, admittedly

Let me know if there’s anything else I can provide to help debug!
Massive thanks in advance.

Hi @Altorvo,

Can you make sure the file exists:

touch $HOME/.ssh/authorized_keys

and then run the chown command again?

Hi @anders, thanks for the quick reply!

Used the above cmd + chown - after, I rebuilt the BP server in the VPS via:
./boringproxy-linux-x86_64 server -admin-domain bpro.domain.com -print-login

then added the client:
./boringproxy-linux-x86_64 client -server bpro.domain.com -user admin -token 123abc -client-name client1

But I still get the same error as above :frowning: Any other thoughts?

Hm yeah I’m not sure. Did you already try searching the github repo? I feel like a lot of people had similar issues early on:

Hi @anders - I’ve looked through every git issue page mentioning ‘authorized_keys’

I’ve tried removing the boringproxy-linux-x86_64 file from my client-side and reinstalling it to make sure that the executable had the right permissions:
-rwxrwxr-x 1 av av 13302499 Dec 3 19:13 boringproxy-linux-x86_64

Followed this process in the ‘guide’ on github:

mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

Which gave me the following permissions: -rw-rw-r-- 1 av av 0 Dec 3 19:16 authorized_keys

I tried a comment you left a while back:

mkdir -p $HOME/.ssh
touch $HOME/.ssh/authorized_keys
chmod 0600 $HOME/.ssh/authorized_keys

which gave me the permissions of: -rw------- 1 av av 0 Dec 3 19:18 authorized_keys

This comment got it working with non-root user access and root group permissions - I tried that, but no luck for me

One comment suggested removing: $HOME/.local/share/certmagic - but I don’t seem to have that, unless it’s on the server side?

Perhaps I’m missing the ball completely and this is not client side but something to configure server side?
Otherwise, I might try a full reset on the VPS and build a new client LXC to try completely fresh - assuming I should be doing all cmds from non-root users (on both client & server)?

Sorry for the essay - have tried everything I could find lol - but would be good to hear your thoughts!

Oh are you running as root? That might be it. Root has a different home directory. Usually /root/.ssh/ I think

@anders - running both ./boringproxy cmds as non-root in client and server - but I think I may’ve downloaded and made the file executable whilst root on the VPS - so will remove that file from VPS side and redownload it…etc

Is the .ssh/authorized_keys folder/file meant to sit on the client or server side? I had assumed client, but maybe wrong?

Ah! No that file is only used on the server. The client keeps all it’s SSH info in the JSON database file. The reason it’s needed for the server is that it relies on OpenSSH to do all the heavy lifting.

@anders - ahhh, that makes way more sense! I got it running. Thank you for bearing with me!!

Also, could you share your or link to a systemctl script which can boot boring proxy up after server restart or the connection dropping, please?

Is there a way to get boring proxy to work in the background - i.e. via daemon so it’s still possible to use the cli?

I’ve noticed the admin portal drops after a while or when the cli is closed - so far I’ve just booted a new admin panel up with the initial server cmd, but this creates a new token…etc - I assume the boring proxy db is used to remember the connections/token made?

1 Like

Glad you got it working! The systemd files here might help you get started setting up a service:

Restarting on connection loss unfortunately requires a custom setup. You can search on the forums here and on github for solutions.

See here: Connection refused, have to restart service periodically - #2 by anders