by do_not_redeem · 1y ago · 0 comments
Also it hallucinated (as usual) some extra args to ssh-keygen.
This GPT did the thing it was supposed to do: produce an implementation using a previous script's structures and processes. I'd bet explaining the reasoning, discussing potential vulnerabilities, or changing the business processes, wasn't in the prompt. Or that metadata wasn't included in GP for brevity.
But it has succeeded in sparking discussion, similar to rubber-duck debugging. A good org will look at this as a starting point, discuss the details, and iterate.
> Also it hallucinated (as usual) some extra args to ssh-keygen.
I don't see a hallucination here. I can confirm it works, and is correct on my system with OpenSSH on it.
I assume you mean the slightly strange `["-N", ""]` argument pair? This tells ssh-keygen to create the file with no passphrase and no prompting for a passphrase.
[N] /tmp> "ssh-keygen" "-t" "rsa" "-f" foo "-N" ""
Generating public/private rsa key pair.
foo already exists.
Overwrite (y/n)?
It seems to me like you are assuming ChatGPT is always going to be wrong (which in itself is not an unreasonable place to start), which is coloring your use of the tool. if os.path.exists(keyfile):
print("Key file {} already exists. Skipping generation.".format(keyfile))But: The LLMs can produce rather good code. They can cover a lot of typing and low to mid level design work from a short description. I'm bringing value to my company and my life by using this tool, plain and simple.
[I] /tmp> "ssh-keygen" "-t" "rsa" "-f" foo "-N" ""
Generating public/private rsa key pair.
Your identification has been saved in foo
[...] ssh-keygen -t rsa -f ~/{0}
Chatgpt's version: ["ssh-keygen", "-t", "rsa", "-f", keyfile, "-N", ""]
It added `-N ''`, which means don't set a passphrase—a second potential security downgrade.