Demo

Usage

curl localhost:8000/generate | jq
Output
{
  "command": "ssh-keygen -f '9760d9d9-4188-4f15-bc2e-448ae89a8c3c' -N '' -C ''",
  "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC6UXaE0/gMCvC/QeIG1ndDPtKxNcUa5NUN4jqi6UwDSaJsd7nDltcPLrKN171YGWk6gaSGBUnnklyoZL3OCXrrVzsqWP4OJgrCMZx4zeA8HWl6Wfcl4MPXI4pbD5DKBfmgZyZojYTnI8246AAMldbDlot93PMoaCVhLtf4KXgdx89GQJsP+dNQsR+otYIRj8Q1TVv6H4feXC9mX7FSIETAUepl+5g5oN83re4puolicKRnlx5v9Lep6IPUOQL9KjZUA8mL/FdAHY3GH+kZJqFypk83jQ8fuy8HfK4O/6GjrtR2V8cOhkEnvfRDIENretkb54vX0vXS/pv/rM2bUp8GY6qK/s6P7cBDx76Aql11druBHDvyCaInRR4nrX77mP8vxMiSSvpkTs/ulhvt0ZLWjcljQgobASYuhwmBSrdd4DMHwdNa1wwb/3FtTv33iY9djfisEpXkkoN6VOD7+DZBFSWLThF8ENPLeETTT9gRltWCpsv21HLV0KAYQZSHIuM= \n",
  "private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn\nNhAAAAAwEAAQAAAYEAulF2hNP4DArwv0HiBtZ3Qz7SsTXFGuTVDeI6oulMA0mibHe5w5bX\nDy6yjde9WBlpOoGkhgVJ55JcqGS9zgl661c7Klj+DiYKwjGceM3gPB1peln3JeDD1yOKWw\n+QygX5oGcmaI2E5yPNuOgADJXWw5aLfdzzKGglYS7X+Cl4HcfPRkCbD/nTULEfqLWCEY/E\nNU1b+h+H3lwvZl+xUiBEwFHqZfuYOaDfN63uKbqJYnCkZ5ceb/S3qeiD1DkC/So2VAPJi/\nxXQB2Nxh/pGSahcqZPN40PH7svB3yuDv+ho67UdlfHDoZBJ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SSH PRIVATE KEY-----\n"
}
curl localhost:8000/generate?t=ED25519 | jq
Output
{
  "command": "ssh-keygen -f '9a22091b-3f68-4697-b5a1-391ca870d839' -N '' -C '' -t 'ED25519'",
  "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFVmNIlMrrkoykPpo+2Iu62ZSYrAEnBL4NtDdzRUq+h1 \n",
  "private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\nQyNTUxOQAAACBVZjSJTK65KMpD6aPtiLutmUmKwBJwS+DbQ3c0VKvodQAAAIjQfFDS0HxQ\n0gAAAAtzc2gtZWQyNTUxOQAAACBVZjSJTK65KMpD6aPtiLutmUmKwBJwS+DbQ3c0VKvodQ\nAAAEBHPcOzygxLDV7UOsv6Syglz0lCEO9XTb8tgtxFaq8CYFVmNIlMrrkoykPpo+2Iu62Z\nSYrAEnBL4NtDdzRUq+h1AAAAAAECAwQF\n-----END OPENSSH PRIVATE KEY-----\n"
}
curl 'localhost:8000/generate?t=RSA&b=2048&N=this_is_password&C=this_is
_comment' | jq
Output
{
  "command": "ssh-keygen -f 'fae498ff-1c88-4150-ba14-6b388dcbe3ac' -N 'this_is_password' -C 'this_is_comment' -t 'RSA' -b '2048'",
  "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/4Hjd1htUr4xeGkObT0bbQOS/gAwun7jr1q8Z8q0IJDlX/9BSspnEyl4DD1FilZiZ/PFjhSFf810LkMU1Ly3Py7m/8iPAZbseTnNTS58MgQcFXTiur4kAwDfNn25ylT4FoVQe9jnPfjqso8eZpkj7BfBj9umqqrGAnUieAXQlzDQYIyWqVO1Bw47+gaD9SEOYGLh714H4FpK3RUTZnVw/sT4lOUnFkomEPjXJfPh2ozgs2DU42A3fa67TxtFpL1/aRWDxkZO9dheXqViciylbR+nrjO1XFkxZ9xxj+JMWJS4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sWbPaw7kdofPVFYjdMyFzjtN\n+qw/Ni8AB+HxtqEUjp5iRMPgYHHZLsHKt4gD+5cJJnVqIS6HvIwqBBkMx92FlQnM75doHC\n1toPaDiW7x0EbrVlvZ7/z6Ma2NegZVqv6zqOzpHjeB6nywV+HztgHVWJhiaXH4vH2ovkRr\nViBNWVEwtNjN09HTuln44AZWFdbaRDA0AUV4es4FfCsvMy/SejCGulDBECvwFHcBTk49n3\noF620ePHQg91Cr3X36t1Yr/f0XMTsvvRxoQta3DdOxA8cm38gCjxjp+G7aQG2fiXBI9hvt\nU+VVrvgVk8bcy2k2c71r1NzBU63ki3FtkwduhJwtvZqhYycSh1Gxmt2yqeL70mSvhxMDpc\n3FT7nmM78uTuWxWSCagYBQ+aWnD0tqOD2dyHdgd4cD7uQAeG7BPgS6IE27KblCThpHE2JU\nI5ug0imS48XMt1/P/Oj2crRC3xqZpeWILdAqCKqo3aUAOLXCruamaDloZi7mfD85FF4056\ncGtV5GQZQ8WJdHD9NuH/tBHjns1hGhDhwhB4mEiLA2lkr3HYWywjkLJVZWw17qglVwCHPX\nBCWIVWV8WEIcBirOtVSQUendpJjrVK53pXyfwcL1D4UgwR4rfF63ebfIURetg5n8EeNg9a\n4nXcvc/LjiIfnnI+mat0GaaEfqVbVofFjRj9VrAkhOKHDcjC+AIIxq6WuhiQKsJgsWH2sn\nVcQs5iUzac9v/blXUNlOZSVcTa9ZMxU8vY7PW66lpgvsMTijBZnIBHTbasZ6OFhfaIEHqJ\nF7qIS6X129xX5OojChPzBpF21Okg0=\n-----END OPENSSH PRIVATE KEY-----\n"
}

Deploy

git clone https://github.com/GitHub30/ssh-keygen-laravel
cd ssh-keygen-laravel
# For Xserver
#curl -s https://getcomposer.org/installer | php8.3
#alias php=php8.3
#alias composer='php8.3 composer.phar'
composer install
composer run-script post-root-package-install
composer run-script post-create-project-cmd
php artisan serve