RaspberryPI3 sambaサーバ導入

Nextcloudは思うような使い方ができなかったので、sambaをインストールしてみました。

 

設定→Add / Remove Software を起動して以下二つのパッケージをインストールします。

・SMB/CIFS file,print,and login server for Unix
 samba-2:4.5.12+dfsg-2+deb9u4

・Samba common files used by both the server and the client
 samba-common-bin-2:4.5.12+dfsg-2+deb9u4

インストールが出来たら、samba用のアカウントを作成します。

以下条件で利用者を作成しています。

 ユーザ名:pi

 パス:pipass 

 

sudo smbpasswd -a pi
New SMB password:password
Retype new SMB password:password
Added user pi.

 

windowsからアクセスする際は、エクスプローラのアドレス入力域にRaspberryPIのアドレスを入力します。

 

これで、home/pi 配下がwindowsエクスプローラからアクセスできるようになります。

 

ですが、Windowsからファイルを配置しようとすると書き込みエラーになります。

設定ファイルを開いて、読み取り専用をnoにします。

 

vi /etc/samba/smb.conf

187 [homes]
188 comment = Home Directories
189 browseable = no
190
191 # By default, the home directories are exported read-only. Change the
192 # next parameter to 'no' if you want to be able to write to them.
193 read only = yes
 ↓
193 read only = no

 

これでWindowsからも書き込みが可能になります。