<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "在CentOS Linux中掛載Windows分享之共用資料夾並設定擁有者及群組與存取權限"]]></title>
		<link>https://forum.andowson.com/posts/list/16.page</link>
		<description><![CDATA[Latest messages posted in the topic "在CentOS Linux中掛載Windows分享之共用資料夾並設定擁有者及群組與存取權限"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>在CentOS Linux中掛載Windows分享之共用資料夾並設定擁有者及群組與存取權限</title>
				<description><![CDATA[ 準備工作： 
<br>
1.先在Windows主機中建立一個使用者帳號、並設定密碼，然後建立一個資料夾，設定為共用，在使用權限中設定該使用者可以完全控制。 
<br>
假設Windows主機IP=10.66.19.80 
<br>
使用者帳號=postgres 
<br>
密碼=postgres 
<br>
共用資料夾名稱=pgdata 
<br>
2.登入Linux 
<br>
<br>
環境： 
<br>
Windows主機IP=10.66.19.80 
<br>
使用者帳號=postgres 
<br>
密碼=postgres 
<br>
共用資料夾名稱=pgdata 
<br>
<br>
查詢/etc/passwd和/etc/group得知在Linux主機中postgres使用者的uid=26,gid=26 
<br>
欲掛載之目錄為/mnt/pgdata 
<br>
<br>
步驟： 
<br>
1.在/etc/fstab中加入下列設定，[color=red]不需要重開機[/color] 
<br>
[code=text]//10.66.19.80/pgdata /mnt/pgdata cifs user,uid=26,gid=26,dir_mode=0700,file_mode=0700,username=postgres,password=postgres 0 0[/code] 
<br>
使用cifs做為檔案系統型態，另外credentials=filename的設定，我沒有試成功，所以還是採用直接輸入username和password的方式。 
<br>
<br>
2.建立掛載目錄 
<br>
[code=text]mkdir -p /mnt/pgdata[/code] 
<br>
3.掛載目錄 
<br>
[code=text]mount /mnt/pgdata[/code] 
<br>
4.檢查 
<br>
[code=text][root@eipdb1 ~]# ll /mnt 
<br>
總計 0 
<br>
drwx------ 1 postgres postgres 0 6月 25 09:42 pgdata[/code] 
<br>
這樣子就完成了 
<br>
<br>
如果要卸載目錄，可以輸入下面的指令 
<br>
[code=text]umount /mnt/pgdata[/code] 
<br>
<br>
參考資料： 
<br>
http://linux.die.net/man/8/mount.cifs]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/427/863.page</guid>
				<link>https://forum.andowson.com/posts/preList/427/863.page</link>
				<pubDate><![CDATA[Fri, 25 Jun 2010 10:41:09]]> GMT</pubDate>
				<author><![CDATA[ andowson]]></author>
			</item>
	</channel>
</rss>