Linux與Window 檔案分享權限設定

來源:互聯網
上載者:User

 命令經常用,再次記錄以下。

 Window access the Linux share folder.

  1. Create the smb account. Then  you can use this username to access the Linux share folder. 

smbpasswd -a username

    Share folder in Ubuntu, you need to install smb.

 Linux access the window share folder.

    It has two steps to  access the share folder.

    1. check which folder the linux server provide to share.       

smbclient -L hostip  --user='domain/username'

    2. mount the share folder to local disk.

smbmount  //hostip/sharefolder  local-path  -o user='domain/username'

 Linux access the window share folder.

    1. installing NFS Services on Ubuntu

    The services required to enable NFS folder sharing are not installed by default on Ubuntu. They can easily be installed, however, by opening a terminal window and entering the following command:

sudo apt-get install nfs-kernel-server

   The installation process should automatically start the NFS service. To verify that the service is indeed running, execute the following command:

sudo /etc/init.d/nfs-kernel-server status

    If the output from the above command indicates that the service is not running, it may started as follows:

sudo /etc/init.d/nfs-kernel-server start

    2. The file server will export share folder.

     Edit the /etc/exports. 

     the format like this:

       /usr/cluster 10.148.218.176(rw)

       /usr/cluster 10.148.218.205(rw)

       /home/raastd 10.148.218.93(rw)

       /root/raas/build/regression_test/output *(ro,sync)

 3. Mount it. 
      sudo mount  hostname:/sharefolder  /localfolder
 4. Unmount it.

        sudo unmount ./localfolder

  the last one , it is easy to access the folder between windows.

Note:

1. there is also one way to access the share folder by GUI interface:  Main Menu; Places/Connecet to server...

2. If you want to mount the folder when you restart your computer, you can update the file  /etc/fstab

    /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0

   //remotepath               /usr/win-share cifs        username=domain\username,passwd=xxx,rw,iocharset=utf8,file_mod=0777,dirmode=0777 0 0

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.