Options

SSH RSA key

high1432007high1432007 Member Posts: 37 ■■□□□□□□□□
hi all I try to follow JNCIP study guide create the ssh-rsa key for root-auth, hwever getting error below,


error: authorized-key: '1024-key-data-pasted-from-terminal': Must follow SSHv2 or SSHv1 RSA key format
error: statement creation failed: ssh-rsa


anyone can help~~~~urgent tks

Comments

  • Options
    tierstentiersten Member Posts: 4,505
    You're not doing the key right.

    If it is a SSHv2 key then:

    set system root-authentication ssh-rsa "ssh-rsa blahblahblah...

    If it is a SSHv1 key then:

    set system root-authentication ssh-rsa "1024 blahblahblah...

    In both cases, the part you paste in is exactly what is in the public key file. You don't add ssh-rsa or 1024 to it as it'll have it already there for whatever type of key you're using.
  • Options
    high1432007high1432007 Member Posts: 37 ■■□□□□□□□□
    Hi Tiersten, am still confused, so will exact command I should?

    set system root-authentication ssh-rsa "??????????"
  • Options
    tierstentiersten Member Posts: 4,505
    Hi Tiersten, am still confused, so will exact command I should?

    set system root-authentication ssh-rsa "??????????"
    Yes. I was pointing out that the usual cause of that error is because you're mangling the key by altering it when you shouldn't i.e. adding in "ssh-dsa" or "1024" when you shouldn't.
  • Options
    high1432007high1432007 Member Posts: 37 ■■□□□□□□□□
    but when I just follow exactly what book tot(set system root-authentication ssh-rsa key-data-pasted-from-terminal, it still prompt me error~~~~~!
  • Options
    tierstentiersten Member Posts: 4,505
    but when I just follow exactly what book tot(set system root-authentication ssh-rsa key-data-pasted-from-terminal, it still prompt me error~~~~~!
    Post what you did along with the errors. You don't need to do the whole key just the first 10-20 characters. It is difficult to work out what you're doing wrong if you don't say what you did.
  • Options
    high1432007high1432007 Member Posts: 37 ■■□□□□□□□□
    Tks, Here you go

    # set system root-authentication ssh-rsa "key-data-pasted-from-terminal"
    error: authorized-key: 'key-data-pasted-from-terminal': Must follow SSHv2 or SSHv1 RSA key format
    error: statement creation failed: ssh-rsa


    #run show version
    Model: m10i
    JUNOS Base OS boot [8.5S3]
    JUNOS Base OS Software Suite [8.5S3]
    JUNOS Kernel Software Suite [8.5S3]
    JUNOS Crypto Software Suite [8.5S3]
    JUNOS Packet Forwarding Engine Support (M/T Common) [8.5S3]
    JUNOS Packet Forwarding Engine Support (M7i/M10i) [8.5S3]
    JUNOS Online Documentation [8.5S3]
    JUNOS Routing Software Suite [8.5S3]
  • Options
    tierstentiersten Member Posts: 4,505
    # set system root-authentication ssh-rsa "key-data-pasted-from-terminal"
    error: authorized-key: 'key-data-pasted-from-terminal': Must follow SSHv2 or SSHv1 RSA key format
    You're supposed to put the key there... I think you should do some reading up on what SSH is and how it works.
  • Options
    high1432007high1432007 Member Posts: 37 ■■□□□□□□□□
    Tks any ref or link can provide?
  • Options
    ChuckzeroChuckzero Registered Users Posts: 1 ■□□□□□□□□□
    It is a simple two-steps approach to configure RSA key

    set system services ssh protocol-version 1 or 2
    set system root-authentication ssh-rsa "ssh-rsa 1024 65537"
Sign In or Register to comment.