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

23 lines
551 B
Nix
Raw Normal View History

2024-04-06 03:03:58 +03:00
{ ... }: {
text = ''
# Mount FS over ssh. Just extra config for sshfs.
# Usage: ssh_mount <REMOTE> <LOCAL>
function ssh_mount() {
2024-04-17 01:43:03 +03:00
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() {
2024-06-24 03:32:33 +03:00
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
}
complete -o nospace -F _sshfs sshmount
'';
}