> For the complete documentation index, see [llms.txt](https://lwang010.gitbook.io/longw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lwang010.gitbook.io/longw/mlops/chap-2.-tools/1.3-script-trick/wfh-server-remote-connection-kit.md).

# WFH server remote connection kit

reconnect:

* mosh + tmux cc/screen

code/data sync-up btw server and local

* minor changes at one part:&#x20;
  * vim/emacs directly
* changes at multiple parts :&#x20;
  * echo -n & nano (nano has less latency than vim)
  * rsync

fswatch -o local-dir | while read f; do&#x20;

&#x20;   rsync -azP local-dir/ server:path/to/remote/dir

done

* * web based (edit at jupyter tree)

### SSH Multiplexing: skip authenticate(even under two factor authentication) in a session (use it cautiously)

in the \~/.ssh/config,&#x20;

add&#x20;

Match host my-server.my-domain.com

&#x20; ControlMaster auto

&#x20; ControlPath \~/.ssh/ctrl-%C

&#x20; ControlPersist yes

ssh tunnel setup:&#x20;

Match host my-server.my-domain.com

&#x20; \# Jupyter Notebook

&#x20; LocalForward 8898 localhost:8898

&#x20; \# Tensorboard

&#x20; LocalForward 6016 localhost:6016

data transfer and backup:

* sftp
* rclone
