惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
B
Blog
博客园_首页
量子位
博客园 - 叶小钗
L
LangChain Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
雷峰网
雷峰网
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
I
Intezer
H
Help Net Security
The Hacker News
The Hacker News
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
AWS News Blog
AWS News Blog
V
V2EX
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Spread Privacy
Spread Privacy
A
Arctic Wolf
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Last Watchdog
The Last Watchdog
Latest news
Latest news
T
Troy Hunt's Blog
L
LINUX DO - 热门话题

博客园 - Life·Intelligence

OpenClaw 多 Channel 实战总结(Windows 环境) OpenClaw Windows 安装与 Debug 最终版教程(适用于 MiniPC i3-N305 / 无 GPU) miniconda转miniforge | conda | license LightDock | 蛋白质-多肽对接 | peptide-protein docking 蛋白结构预测 | alphafold | colabfold | docking 全栈生信 | PyMol使用教程 细胞通讯推断 | CCI | CellChat | CellphoneDB | iTALK | NicheNet ChromHMM教程 极简 | GRN | SCENIC | pySCENIC | 安装使用最新版scenicplus Linux下载zenodo数据 共定位 | colocalization 分析 | 表观因子 findOverlappingPeaks | peak取交集操作 根据基因名批量查询下载PDB蛋白结构数据库 R小技巧汇总 Signac处理bulk ATAC-seq数据 Differential motif enrichment | CentriMo | meme 亚马逊云 | AWS S3 | 基本操作 ATAC-seq | TOBIAS | footprint分析 TCGA+GTEx基因表达数据合并 | 多癌种表达分析 药物筛选 | drug screen
SSHFS + VS Code 挂载集群代码目录(macOS)| 集群vibe coding
Life·Intelligence · 2026-02-27 · via 博客园 - Life·Intelligence

目标:在 macOS 上通过 SSHFS 挂载集群代码目录,用本地 VS Code 编辑,不使用 Remote-SSH。


SSHFS + VS Code 挂载集群代码目录(macOS)

目标

  • 本地 VS Code 编辑
  • 代码真实存储在集群
  • 不依赖 vscode-server
  • 执行仍在集群(ssh / slurm / tmux)

一、安装依赖

1. 安装 macFUSE

brew install --cask macfuse

安装后:

  • 打开 System Settings → Privacy & Security
  • 允许 macFUSE 系统扩展
  • 重启(如系统提示)

2. 安装 macOS 版本 SSHFS

brew install gromgit/fuse/sshfs-mac
brew link --overwrite sshfs-mac

验证:

sshfs -V

二、创建本地挂载点

mkdir -p ~/dfci_code

⚠️ 只挂载代码目录,不要挂整个 home。

例如远端目录:

/home/zz950/project_code

三、挂载远端目录

sshfs zz950@argos.dfci.harvard.edu:/home/zz950/project_code ~/dfci_code \
-o reconnect \
-o ServerAliveInterval=15 \
-o ServerAliveCountMax=3 \
-o follow_symlinks

验证:

ls ~/dfci_code

如果能看到远端文件,说明成功。


四、在 VS Code 中使用

  1. 打开 VS Code
  2. File → Open Folder
  3. 选择 ~/dfci_code

此时:

  • VS Code 认为这是本地目录
  • 文件实际在集群
  • 不会启动 Remote-SSH
  • 不受 glibc 限制

五、执行仍在集群

编辑和执行分离。

在终端:

ssh zz950@argos.dfci.harvard.edu

或:

ssh zz950@argos.dfci.harvard.edu "bash run.sh"

推荐:

  • 使用 tmux
  • 用 slurm 提交任务
  • Jupyter 在集群运行

六、卸载

diskutil unmount ~/dfci_code

如果挂载卡住:

diskutil unmount force ~/dfci_code

七、避免卡顿(重要)

1. 不要挂载大数据目录

只挂代码,例如:

project_code/

不要挂:

data/
results/

2. 在 VS Code 忽略大目录

.vscode/settings.json 添加:

{
"files.watcherExclude": {
"**/data/**": true,
"**/results/**": true
}
}

避免扫描大量文件。


3. 大数据不要通过 SSHFS 读写

错误方式:

pd.read_csv("~/dfci_code/data/bigfile.csv")

正确方式:

在 ssh 登录的集群终端里运行数据处理。

SSHFS 只用于:

  • 编辑代码
  • 修改 config
  • 写 pipeline
  • 改 slurm 脚本

八、推荐长期结构

本地(Mac):

  • VS Code + GPT
  • 编辑代码
  • 管理结构

集群:

  • 真正计算
  • 大数据
  • Jupyter
  • Slurm

这种结构:

  • 避免 vscode-server 依赖
  • 避免 glibc 限制
  • 保持沉浸式 vibe coding
  • 保留人工执行审计点

九、自动挂载脚本(可选)

创建:

nano mount_dfci.sh

写入:

#!/bin/bash
sshfs zz950@argos.dfci.harvard.edu:/home/zz950/project_code ~/dfci_code \
-o reconnect \
-o ServerAliveInterval=15 \
-o ServerAliveCountMax=3 \
-o follow_symlinks

保存后:

chmod +x mount_dfci.sh

以后只需:

./mount_dfci.sh

十、核心原则总结

  • SSHFS = 编辑层
  • 集群 = 计算层
  • 不混用
  • 不通过 SSHFS 操作大数据

这套结构在老系统科研集群上非常稳健。

最后,关机,进入恢复模式给权限。
在 Recovery 里正确路径是:
1. 退出 Disk Utility
2. 回到 Recovery 主界面
3. 菜单栏 → Utilities
4. Startup Security Utility
5. 选择你的系统磁盘
6. 点击 Security Policy
7. 选择:
✔ Reduced Security
✔ Allow user management of kernel extensions