共享文件夾

分成4種情況,win->win映射、linux->linux映射、linux->win、win->linux。
這裏只介紹後面兩種情況。

linux映射到windows

  1. 虛擬機可以安裝vmware-tools,開啓文件夾共享
  2. 安裝samba,按照以下步驟
# install depend softwares
# install samba
apt install samba
# modify profile
# uncomment all configure of `homes` labels
vim /etc/samba/smb.conf
# add users
smbpasswd -a root
# restart samba
service samba restart

在這裏插入圖片描述在這裏按照提示輸入地址,賬號密碼。如果不行就關閉防火牆,selinux service ufw stop && setenforce 0

windows映射到linux

  1. 同上!虛擬機共享
  2. 按照下面步驟
# on windows, enable sharing and build a share directory
# install samba client
apt install samba-client cifs-utils

新建腳本文件mount_windows.sh添加以下內容。
mount.cifs //windows_ip_address/directory_of_share /root -o username=windows_user,password=windows_password
運行這個文件就掛在在root目錄下了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章