1

I tried ssh-copy-id but I get errors:

Password: ^ % Invalid input detected at '^' marker. ^ % Invalid input detected at '^' marker. ^ 

I believe MOS doesn't support that command.

How can I ssh using my keys instead of always using the password?

1 Answer 1

2

You're right, MOS doesn’t support ssh-copy-id or interactive shell commands in the same way. Instead, you typically manually add your public SSH key to the correct location.

Login as you do now with the password and then:

  1. Create the .ssh directory under the user you login as and set permissions. mkdir -p ~/.ssh followed by chmod 700 ~/.ssh.
  2. Manually add your public key to the authorized_keys file in the above directory. Example: /home/admin/.ssh/authorized_keys or /home/<username>/.ssh/authorized_keys. Simply edit the file with vi like: vi ~/.ssh/authorized_keys and paste the key text followed by saving (type :wq - write and quit).
  3. Set the correct permissions: chmod 600 ~/.ssh/authorized_keys.

Now you should be able to login.

Just make sure you set the permissions correctly.

  • ~/.ssh is 700
  • ~/.ssh/authorized_keys is 600
2
  • Thanks! Does EOS fix that? Commented Apr 18 at 23:22
  • 1
    @None Yes, EOS supports ssh-copy-id. Commented Apr 19 at 17:00

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.