nix/home/program/bash/module/Ssh.nix

24 lines
586 B
Nix
Raw Normal View History

{ ... }:
{
text = ''
# Mount FS over ssh. Just extra config for sshfs.
# Usage: ssh_mount <REMOTE> <LOCAL>
function ssh_mount() {
sshfs -o uid=''${UID},auto_unmount "''${@}"
}
2024-04-06 03:03:58 +03:00
# Mount FS over ssh. Just extra config for sshfs.
# Usage: ssh_mount <REMOTE> <LOCAL>
function ssh_mount_ro() {
sshfs -o uid=''${UID},auto_unmount,ro "''${@}"
}
2024-04-06 03:03:58 +03:00
# Generate private an public keys on a local host and print a public key.
function ssh_keygen() {
ssh-keygen && cat ~/.ssh/*.pub
}
2024-04-06 03:03:58 +03:00
complete -o nospace -F _sshfs sshmount
'';
2024-04-06 03:03:58 +03:00
}