> For the complete documentation index, see [llms.txt](https://blog.micsoftvn.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.micsoftvn.com/use-cases/for-sysadmin/scripts/bash-script-gen-ssh-key.md).

# Bash Script Gen SSH key

```
#!/bin/bash

if [[ $1 && $2 ]]
then
    ssh-keygen -t rsa -f ./$1 -b 2048  -C "$2"
else
    echo 'Usage: ./keygen.sh filename-for-key comment-for-key';
fi
```
