Zaczynamy instalując pakiet sshfs.
Kod: Zaznacz cały
$ sudo apt-get install sshfs
Kod: Zaznacz cały
$ ssh-keygen
Kod: Zaznacz cały
[I]Generating public/private rsa key pair.
Enter file in which to save the key (/home/sector/.ssh/id_rsa):[/I][B][Enter][/B]
[I]Enter passphrase (empty for no passphrase): [/I][B][Enter][/B]
[I]Enter same passphrase again: [/I][B][Enter][/B]
[I]Your identification has been saved in /home/sector/.ssh/id_rsa.
Your public key has been saved in /home/sector/.ssh/id_rsa.pub.
The key fingerprint is:
33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9 sector@debian[/I]
Kod: Zaznacz cały
$ sector@debian: ssh-copy-id -i ~/.ssh/id_rsa.pub host
Kod: Zaznacz cały
[I]$ sector@host's password: [/I][B][Tutaj wpisujemy hasło użytkownika na hoście][/B]
Kod: Zaznacz cały
Now try logging into the machine, with "ssh 'remote-host'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
Kod: Zaznacz cały
$ ssh host
Teraz można użyć programu sshfs do podmontowania folderów zdalnego hosta. Odpalamy sshfs z następującymi parametrami:
Kod: Zaznacz cały
sshfs host:/folder /media/dysk_sieciowy
Kod: Zaznacz cały
fusermount -u /media/dysk_sieciowy