You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Emacs Tramp连接Dreamhost共享服务器时路径异常求助

Fix TRAMP Landing in Root Directory on Dreamhost Shared Hosting

I’ve run into this exact issue with TRAMP connecting to Dreamhost shared servers before—super frustrating when you end up in / instead of your home dir! Here are the solutions that worked for me:

  • Specify your home directory directly in the TRAMP connection string
    Dreamhost shared hosting uses /home/your-username as your personal home directory. Instead of using the basic ssh://your-username@your-dreamhost-server.com, use this full path:

    ssh://your-username@your-dreamhost-server.com/home/your-username
    

    TRAMP will land straight in your home directory when you connect.

  • Set a default path for Dreamhost servers in your Emacs config
    To avoid typing the full path every time, add this to your Emacs init file (like ~/.emacs or ~/.emacs.d/init.el):

    (add-to-list 'tramp-default-proxies-alist
                 '("\\.dreamhost\\.com$" nil "/home/your-username/"))
    

    Now any TRAMP connection to a .dreamhost.com server will automatically default to your home directory.

  • Check your local SSH config for conflicts
    If you have a ~/.ssh/config entry for your Dreamhost server, double-check for settings like RemoteCommand or custom User values that might be overriding TRAMP’s default behavior. Make sure those settings don’t force a jump to the root directory.

  • Manually switch directories if you’re already in /
    If you’re stuck in the root directory, use M-x cd in Emacs and enter:

    /ssh:your-username@your-dreamhost-server.com:/home/your-username
    

    Or use C-x C-f to open a file in your home directory—TRAMP will automatically switch to that path.

内容的提问来源于stack exchange,提问作者Micah Cobb

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:03:37