added a function to easily generate ssh key
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
function sshkey --description "generate a SSH key"
|
||||||
|
if test (count $argv) -ne 1
|
||||||
|
echo "Usage: sshkey <file>"
|
||||||
|
echo "example: sshkey ~/.ssh/your_key_name"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set file $argv[1]
|
||||||
|
|
||||||
|
if test -e "$file"
|
||||||
|
echo "Error: $file already exists."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
ssh-keygen -t ed25519 -f "$file" -C "$(hostname)" -N ""
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user