lk/networking/ssh/tricks.md

30 lines
639 B
Markdown
Raw Normal View History

2022-01-16 18:20:39 +00:00
---
2022-02-05 17:47:46 +00:00
title: "ssh tricks"
tags: [ "Documentation", "Networking", "ssh", "tricks" ]
2022-01-16 18:20:39 +00:00
---
2020-01-02 00:04:35 +00:00
Mount a remote filesystem locally with fuse-sshfs:
```bash
sshfs *user*@192.168.0.10:/home/*user* /tmp/mnt
```
2020-01-02 00:04:35 +00:00
Unmount with:
```bash
fusermount -u /tmp/mnt
```
2020-01-02 00:04:35 +00:00
Set it up on /etc/fstab with:
```bash
sshfs#bkp@bkp.a-server.ninja:/media/store1/bkp /backup fuse defaults,allow_other,reconnect,delay_connect 0 0
```
2020-01-02 00:04:35 +00:00
Make image backup of sda1 and sda2 from one machine and pass it through ssh to another.
```bash
for i in {1,2};do sudo dd if=/dev/sda$i | ssh -C *user*@192.168.0.10 "dd of=/mnt/Backup/winback-oct-\"$i\".img" status=progress; done
```
2020-01-02 00:04:35 +00:00