Fedora, where to put my ssh keys to login?

2,479

You can use the option -i to specify to ssh which identity file it should use.

Also have you checked with ssh - v what really happen? I mean the keys are really not used or are they used but doesn't match?

Share:
2,479

Related videos on Youtube

Jeff Norman
Author by

Jeff Norman

Updated on September 18, 2022

Comments

  • Jeff Norman
    Jeff Norman over 1 year

    I am trying to redirect my site from https://localhost (but written with the ip, like https://10.0.7.8) to another https location like https://mysite.com

    My current configuration is:

    <rewrite>
      <rules>
        <rule name="Rewrite to mysite.com" enabled="true" stopProcessing="true">
          <match url="(.*)" />
          <action type="Redirect" url="https://mysite.com/{R:0}" redirectType="Permanent" />
          <conditions logicalGrouping="MatchAll">
            <add input="{HTTP_HOST}" pattern="https://10.0.7.8*" />
          </conditions>
         </rule>
      </rules>
    </rewrite>
    

    And when I am accessing https://10.0.7.8 it does not go to https://mysite.com, it stays on https://10.0.7.8

    Any idea what am I doing wrong?

    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' about 9 years
      Have you checked all the permissions? The .ssh directory must be 700 (drwx------), the authorized_keys file must be 644 or 640 or 600 (-rw-r--r-- or -rw-r----- or -rw-------), and your home directory must not be group-writable. If you can't figure out whether the permissions are correct, post the output of ls -ld ~ ~/.ssh ~/.ssh/authorized_keys on the server and ls -ld ~ ~/.ssh ~/.ssh/id_rsa on the client.
    • Startec
      Startec about 9 years
      This is correct. I did have appropriate permissions on the .ssh directory. That fixed it. Also, can you tell me what file actually gets checked? is it the authorized_keys or the id_rsa.pub file?
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' about 9 years
      The id_rsa.pub file is never read by ssh (but it's useful to keep it around to easily determine where a public key is coming from). The server reads authorized_keys and the client needs id_rsa.
    • Startec
      Startec about 9 years
      when you say "to keep around" - if I set up keys on another computer I just append the key to the existing id_rsa.pub and authorized_keys files correct? Is ssh somehow able to parse the files to read the different keys?
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' about 9 years
      The SSH server reads authorized_keys. To authorize multiple keys, just append the .pub files to it. Each line in that file represents one authorized key.