-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs don't explain how to manually set up the jailhost's SSH keys (also, an error about errors) #24
Comments
hi there, the docs don't mention it, because so far it wasn't an issue in our usage :) we've simply concentrated on getting a user's default key onto the host, not how to configure non-default keys for existing servers. just to make sure, i understand you correctly:
correct? what is the name of the key file? is it one of the default keys such as what does your ploy.conf look like that defines the host? |
Hi Tom! Yes, both of those are correct. As for the key file, it is not a 'default' key. Firstly, I don't believe I was aware there was a default key, but secondly, I figured that different hosts ought to have different keyfiles. I had guessed that it might look for the key in ~/.ssh/ez-master name, but I figured if that didn't work, adding it to ssh-agent would work (since that works in ansible). The ploy.conf file simply looks like:
|
ok, thanks, that clears it up. so this is actually a feature requests to support non-default ssh keys for ploy hosts. let me sleep over it :) |
Essentially, yes. (Thank you, by the way!) Now, I'm not sure, but I think that if I put the key file location in ploy.conf with an ansible variable, like this:
Then it may cause ansible to use the keyfile for connection. But I doubt that ploy uses ansible for everything under the sun. As well, part of this issue is just the fact that there were no documents for ploy OR bsdploy that explained where the program would look for ssh keys. Although I do want the custom key settings, you should probably first add a note in docs explaining where *ploy looks for a keyfile. I'm not even sure where the keyfile is when you're doing the bootstrap process; from what you said earlier, it sounds like it looks for the private key in .ssh/identity and public key (for the bootstrapped system) in .ssh/identity.pub? |
I'm not sure what the best option for you is. Setting You could also set the ssh key in your Why do you think a key per host makes sense? If your computer is compromised, then all your keys are most likely compromised. Do you have a long passphrase for all of your keys, or do you use some kind of keychain to avoid typing the passphrase to get it into ssh-agent? If you do the latter, then I don't see the point, you could just use one key with a good passphrase instead of one password for your keychain. For a practical attack one would have to either brute force your passphrase (for the keychain or your keys) or install a key logger. The threat level for each looks kinda the same for me, but using a ssh key per host is less practical. (I'm always talking about your own ssh key and the public part of it per host, the hosts need their own unique ssh key, which is the default obviously). |
Actually, what I'm more concerned about is being able to have different keys for different types of instance; one for important servers, one for test machines, etc. Sorry for bugging you with all this stuff. (._.)
|
Please edit File "/usr/local/lib/python2.7/site-packages/ploy/common.py", line 214, in config_id
and let the return on line 214 move to 215. I thought a bit more, you should also be able to add the key to your ~/.ssh/config like this:
Then it should work for both paramiko and ssh. This is nicer than putting it in ploy.conf. In my last reply I didn't think through what host will be looked up. For plain instances it's the content of Be assured, that you are not bugging us, but ploy :) |
Ok, first of all, I have tried moving the ssh key to identify and identity.pub, and bootstrap now does indeed work (I also realized that the bootstrap-fingerprint I had added was unneccessary). however, ssh to the post-bootstrapped system doesn't work. after adding print(self), I get:
|
Could you please try this fix: diff --git a/ploy/plain.py b/ploy/plain.py
index 8adf9fe..1556167 100644
--- a/ploy/plain.py
+++ b/ploy/plain.py
@@ -60,6 +60,8 @@ class InstanceFormattingWrapper(object):
class Instance(BaseInstance):
+ sectiongroupname = 'plain-instance'
+
def get_host(self):
if 'host' not in self.config:
return self.config['ip'] For me this at least fixes the error output. |
YES! It works! (Kind of) Here's the error output it's now able to give me:
How would I fix this? |
If I close the issue, can we still keep talking? |
Just leave the issue open until it's completely resolved. You have to set |
It's working now! (Although you should know that ssh-keyscan doesn't print the fingerprint in the form of xx:xx:...) Shouldn't it have automatically noted the new fingerprint when the bootstrap process was done, though? Or is that something that hasn't been done yet? |
The bootstrap should have created |
I don't see a file like that. There isn't any ssh_host_* files in etc/ either. EDIT: another issue:
This has got to do with the space after the oid name, right? |
... Aaaand today it magically works, but now i get:
|
NEVERMIND I UPGRADED THE PACKAGE AND IT WORKS OKAY I'M CLOSING THE ISSUE AND GETTING OFF YOUR ISSUES LIST I'LL BE SURE TO ANNOY YOU IF I FIND ANYTHING ELSE BYEEEEE |
Hey,
I'm sorry if I missed something, but I can't find a single part of the docs that explains how to setup ssh keys for a jail host without having done the 'bootstrap' step. I tried doing 'ssh-agent zsh && ssh-add ~/.ssh/jailhostname', and although this makes regular ssh work fine, bsdploy gives some error messages and dies whenever attempting to do 'ploy ssh' or 'ploy configure'. It also appears that ploy hits an error while trying to print the 'connection failed' error message:
What steps do I need to take to make bsdploy use my key?
The text was updated successfully, but these errors were encountered: