-
-
Save withinboredom/84067b9662abc1f968dfadfe799cfcb2 to your computer and use it in GitHub Desktop.
ssh auth using github
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// etc/ssh/auth.php | |
namespace auth; | |
if (($argv[1] ?? '') === 'root') { | |
echo file_get_contents('https://github.com/withinboredom.keys'); | |
} | |
die(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add these lines to /etc/ssh/sshd_config | |
AuthorizedKeysCommand /usr/bin/php /etc/ssh/auth.php %u | |
AuthorizedKeysCommandUser nobody |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment