LemmyNet / lemmy-ansible

A docker deploy for ansible
GNU Affero General Public License v3.0
248 stars 92 forks source link

Clarifications needed #122

Closed akzmonster closed 1 year ago

akzmonster commented 1 year ago

Am I doing the "Install" steps on the local machine or the server?

Under "edit the inventory hosts file to your liking", how do I add a private key? I can Putty into my server with a private key, but Ansible refuses connection when I try to run the playbook, I can only assume because my server expects a private key for root.

ross-spencer commented 1 year ago

Am I doing the "Install" steps on the local machine or the server?

You're doing all of this on your local machine, and it will then deploy remotely. Ansible is running something called a playbook, but you need to provide some config to it. When you run the playbook it first connects to the remote server, installs what it needs, runs the playbook commands, and then it leaves the remote server with a working Lemmy.

Under "edit the inventory hosts file to your liking", how do I add a priv

You need ssh access to the server, and then in hosts, you provide the login, not the key itself. The other information there is information that will be picked up by Ansible but used n the host.

If you can:

ssh login@server.tld then you're half way there - the login goes at the top of the hosts file as one of the components there, and connection type will be ssh.

Linux or Windows?

Are you using Windows?

I guess as you are using Putty you are using windows? (IDK) You may need to install OpenSSH on there for this to work as expected. Again not sure though.

akzmonster commented 1 year ago

If you can: ssh login@server.tld

Nope, permission denied (publickey)

Am I the first person to ever use a public key? Why is this not covered in the steps? Who is not using a key to log in?????

I'm using WSL on win11

So you want me to install openssh on WSL? Got a guide for this? Any reference to how to do this?

ross-spencer commented 1 year ago

Nope, permission denied (publickey)

That's probably the first place to start @akzmonster -- you need to generate a public private key pair (on your local machine) and place the public key that was generated in the authorized_keys file in /home/<user>/authorized_keys on the remote machine (the one you will deploy Lemmy on).

Then try and log into your server again via ssh.

Why is this not covered in the steps?

It's not for me to say, but it's more a fundamental piece of learning than anything specific to Lemmy. Maybe this Digital Ocean guide will help you?

https://www.digitalocean.com/community/tutorials/how-to-use-ssh-to-connect-to-a-remote-server

So you want me to install openssh on WSL?

You need to provide a clearer picture of what you're doing. If you've already tried: ssh <your_remote_user_name>@<your_lemmy_domain> you probably have OpenSSH. You need to go back and read about secure shell connections to a remote server.

akzmonster commented 1 year ago

and place the public key that was generated in the authorized_keys file in /home//authorized_keys on the remote machine (the one you will deploy Lemmy on).

I already have a public key on my remote machine. Where do I put it on my local machine to get ansible to see it? As I've already said, I have NO PROBLEM using Putty to SSH in to the remote server. I just can't get ansible to see it, or use it, or do it, or whatever. How do I get ansible to use it?

Edit: Sorry, I'm frustrated. There seems to be no combination of terms that I can use in a google search to figure out what I want to do. This is par for the course with Linux anything. Apparently, no one else using ansible uses RSA keys because there isn't a single tutorial out there to help me.

And there is no directory "authorized_keys"...

ross-spencer commented 1 year ago

There seems to be no combination of terms that I can use in a google search to figure out what I want to do.

This is the first link that came up when I googled: https://www.linuxbabe.com/linux-server/ssh-windows

(I believe) You need method 2, and the section "How to Set Up SSH Key on Windows 10 (Optional)"

Once you can OpenSSH from WSL to the remote machine, then we can talk about Ansible.

Sorry, I'm frustrated.

Of course i understand. Just remember you want to achieve this and it's a clear and direct goal. Right now I am not seeing anything in your way, Just get that connection to the remote machine via ssh running and then the next step can be debugged.

If you're having a problem, with openssh still, paste your command-line input and openssh output here and that will be easier to understand.

ticoombs commented 1 year ago

close Offtopic and not related to a lemmy-ansible code issue.

dessalines commented 1 year ago

This is basic ssh stuff, it has nothing to do with lemmy.