如何在 Ubuntu 上挂载 Windows 共享

如何在 Ubuntu 上挂载 Windows 共享

目前,通过我的 Ubuntu 16.04 计算机将驱动器安装到 Windows 共享时遇到问题。有什么想法吗?

Sudo nano /etc/fstab

//192.168.4.12/Share/Videos /media/Plex cifs 
defaults,noauto,nofail,username=Plex,password=XX,x-system.requires=network- 
online.target,vers=3.0 0 0'

Sudo mount -a

我没有收到任何错误。浏览到/media/Plex,我看到文件夹突出显示,但看不到任何媒体。当我执行以下操作时,我收到错误:

sudo mount -t cifs //192.168.4.12/Share/Videos /media/Plex
Password for root@//192.168.4.12/Share/Videos:  *****************
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

答案1

以下是我使用过的方法:

Where MY_WIN_NAME is my windows username
      WIN_PASSWD  is my windows login password
      192.168.1.77 is the ip address of my windows box
      SHARE_NAME   is the windows share name
      /home/myacct/m edia is the mount point:                 

mount -t cifs   -o \ user=MY_WIN_NAME,password=WIN_PASSWD,rw,hard,nosetuids,noperm,sec=ntlm \
      //192.168.1.77/SHARE_NAME  \
      /home/myacct/media

答案2

所以您尝试将 Windows“视频”共享文件夹挂载到 Linux 挂载点 /media/Plex ?在这种情况下,错误非常清楚,如下所示:

Password for root@//192.168.4.12/Share/Videos: ***************** mount error(13):

您会看到它要求输入 root 密码,其中应该要求输入用户密码(Windows 上的用户),要更正此问题,您必须执行如下命令:

mount -t cifs //192.168.4.12/Share/Videos /media/Plex --verbose -o user=username 

在上面的命令中,您需要提供 Windows 的用户名,当被要求提供 Windows 用户的密码时,请让我们知道这是否有帮助:)

等待你的回复,

答案3

使用 Ubuntu 22.04:

# if mount issues an error message about cifs or nfs needing a helper:
sudo apt install cifs-utils # cifs only
sudo apt install nfs-common # nfs only

# export some environment variables:
export windows_username=<windows username> # actual windows login user name
export windows_password=<windows password> # actual windows login password
export windows_share=<windows unc share path> # //192.168.1.2/c or //tailscale-system-name/c
export windows_mount_point=<windows mount point> # make sure mount point directory is already created

# example: sudo mount -t cifs -o username=$windows_username,password=$windows_password //7950x-2tb/e /mnt/e

sudo mount -t cifs -o username=$windows_username,password=$windows_password $windows_share $windows_mount_point

# now you can issue some commands. Watch out for permission issues.
# sudo cp -p -r  /mnt/e/bridge/data/data/* .
# sudo chmod 0666 -R *

相关内容