Wednesday, November 1, 2017

ssh passwordless login FortiOS

In this example, I will show you  how to setup  a ssh  password-less logins the forortiOS.  In fortiOS you can craft  up to 3each  ssh-pub-keys  per admin users.


Any one the keys can be called up,  and used for  ssh access.


1st

      you need to generate a  rsa key

       ssh-keygen -t rsa -b 2048 -f mysshkey

Next, COPY OUT JUST THE PUBkey information. It should start withe ssh-rsa

example


ssh-rsa AAAAB3NzaC1yc2EAAAADAQBBAAABAQCpEk1+5wsYkdFQ1huDWybkJhjbhQkymfaY+4yRy69PyAlp682NYM5emjgpPPtq1UpDWHdg65lGFo68nAyv2ersoitgI7Qe/sxe100wWqBZGuK5NzxQPropYN1r8kYKWeNbjryPJXsbd93/PHCDmXJaiyIPIb5mWkDbWifNl9dREFYI3uCdvmemshcDsVcRz+VXSTYbNPapFyBZYl17hPKwt5/tUBf9Gak0AxqjltUMrijltiMymULK3F95gf8vThOf7rvwhfmONmkE4j/xeagaz7kRbHTpfEu9IPEFTTUNQzGZPbmTHJh9UPQwNeG3xwN8JjhmuPpr5Jv5M7baiV8x kfelix@macattack.localdomain

This will be applied into the configuration via the  cli;

Here's a directory of my ssh rsa keys






Now we call the ssh-priv-key when we want to login. If  you have a passpharse on the priv-key ( that will be prompt )





And  another example;







ssh keygen has a max size you can use, but  I 've never seen issues on  the fortigate  with using keys  larger than 2048 bits modulus keys.











Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o
        /  \


No comments:

Post a Comment