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

如何在Mac上通过SSH连接XAMPP-VM?附挂载目录权限设置求助

Hey there, let's tackle your two XAMPP-VM issues one by one—these are super common pain points for Mac users running the VM version:

一、SSH连接XAMPP-VM虚拟机的可行方法

XAMPP-VM uses a Bitnami-built stack, so the default SSH credentials aren't the typical root/password you might expect. Here's how to connect:

  • Step 1: Ensure SSH service is running
    Open your XAMPP Manager, switch to the Manage Servers tab, and check if the "SSH" service is listed as "Running". If not, select it and click Start.

  • Step 2: Connect via SSH using the default Bitnami credentials
    Open your Mac's Terminal and run this command:

    ssh bitnami@192.168.65.2
    

    When prompted for a password, enter bitnami (this is the default password for the bitnami user, which has full sudo access).

  • Step 3: Switch to root if needed
    Once logged in as bitnami, you can elevate to root with:

    sudo su -
    

    Enter the same bitnami password when prompted—no separate root password is required by default.

If you still can't connect, double-check that your Mac's firewall isn't blocking SSH traffic to 192.168.65.2, and that the VM's default SSH port (22) is open.

二、设置挂载目录的写入权限

The /opt/lampp directory in the VM is owned by system users (usually daemon:daemon or bitnami:daemon) by default, which is why your local mounted path doesn't have write access. Here are two reliable fixes:

Since the mount syncs with the VM's filesystem, modifying permissions inside the VM will reflect on your local mount:

  1. First, SSH into the VM using the method above.
  2. Run this command to give the bitnami user full ownership of /opt/lampp (this won't break Apache/Nginx since the web server runs with permissions to access these files):
    sudo chown -R bitnami:bitnami /opt/lampp
    
  3. Alternatively, if you want to keep the original ownership but add write access for the bitnami user:
    sudo chmod -R u+w /opt/lampp
    
    After running either command, you should be able to write to the local ~/.bitnami/stackman/machines/xampp/volumes/root path immediately.

Option 2: Fix UID/GID mismatch (for advanced users)

Sometimes the local Mac user's UID/GID doesn't match the bitnami user in the VM, causing permission issues. Here's how to align them:

  1. In the VM, check the bitnami user's UID and GID:
    id bitnami
    
    You'll get output like uid=1000(bitnami) gid=1000(bitnami).
  2. On your Mac, modify the mounted directory's permissions to match this UID/GID:
    sudo chown -R 1000:1000 ~/.bitnami/stackman/machines/xampp/volumes/root
    
    Replace 1000:1000 with the actual UID/GID from the VM if they're different.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.25 06:30:17