Closed leonardolaiolo closed 2 months ago
Hi @leonardolaiolo, Thank you for opening this issue!
We will review this problem and find a possible solution.
- The command
ssh gadi "cat >> .ssh/authorized_keys <<< '$(cat ~/.ssh/id_gadi.pub)'"
fails. This command worked from my local Linux machine cat ~/.ssh/id_gadi.pub | ssh gadi 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys'
@leonardolaiolo Can you be more specific on why the command failed? What error did you get?
I see in the command that worked you created the .ssh
directory.
Is the absence of the .ssh
directory the reason why the previous command failed?
Hi Davide, i think there may be 2 issues there.
1 - first error I was getting:
/home/leonardo/.ssh/config: line 10: Bad configuration option: usekeychain
. I think UseKeychain
option is specific to macOS, but it isn't recognised in Linux.
2 - after fixing the first issue with UseKeychain
I was getting a different error:
/bin/bash: .ssh/authorized_keys: No such file or directory
when I was running ssh gadi "cat >> .ssh/authorized_keys <<< '$(cat ~/.ssh/id_gadi.pub)'"
. But when I was doing a cat .ssh/authorized_keys
it showed a key. I was clueless then I asked ChatGPT, that suggested the ssh command is not correctly interpreting the redirection and appending the public key to the authorized_keys file on the remote server. The cat >> redirection needs to be properly understood by the shell on the remote system.
Hope this helps?
1 - first error I was getting:
/home/leonardo/.ssh/config: line 10: Bad configuration option: usekeychain
. I thinkUseKeychain
option is specific to macOS, but it isn't recognised in Linux.
Yes the UseKeychain
option will be removed for Linux/Windows.
Thank you for pointing that.
2 - after fixing the first issue with
UseKeychain
I was getting a different error:/bin/bash: .ssh/authorized_keys: No such file or directory
when I was runningssh gadi "cat >> .ssh/authorized_keys <<< '$(cat ~/.ssh/id_gadi.pub)'"
.
The first error you got (/bin/bash: .ssh/authorized_keys: No such file or directory
) and the fact that you did not get the error with your command (in which you created the .ssh
directory) makes me think this issue is caused by the lack of the .ssh
directory on Gadi (when you first issued the command).
But when I was doing a
cat .ssh/authorized_keys
it showed a key.
You were executing that command on Gadi or on your local machine?
It seems strange to me that you got a "no such file or directory" for .ssh/authorized_keys
but right after you could cat .ssh/authorized_keys
without issues.
You were executing that command on Gadi or on your local machine? It seems strange to me that you got a "no such file or directory" for .ssh/authorized_keys but right after you could cat .ssh/authorized_keys without issues.
Yes, I think you're correct - Indeed I was running the command in my local machine and the issue must be caused by the lack of the .ssh directory on Gadi.
It will be reviewed and merged soon.
Thank you @leonardolaiolo for your contribution!
Description
I noticed a couple of tweaks were needed for Linux/Windows users (I couldn't managed to make it work just following the instructions https://access-hive.org.au/getting_started/first_steps/#login-to-gadi).
Why
Errors are related to:
UseKeychain yes
in the ~/.ssh/config (I think this is not needed in Linux, I commented this out).ssh gadi "cat >> .ssh/authorized_keys <<< '$(cat ~/.ssh/id_gadi.pub)'"
fails. This command worked from my local Linux machinecat ~/.ssh/id_gadi.pub | ssh gadi 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys'
Not sure these were the ideal changes to do, but they allowed me to login from the terminal withssh gadi
command.Close Criteria
Instructions are updated