Raspberry Pi に保存したファイルを Windows に移動させたかったので Raspberry Pi に Samba を入れま した。
環境
- Raspberry Pi 3 Model B
- Raspbian GNU/Linux 9.4 (stretch)
Samba インストール
$ sudo apt install samba
設定
設定ファイルを確認すると以下の様にすでにホームディレクトリの設定が有効になっていました。
$ cat /etc/samba/smb.conf
... snip ...
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
... snip ...
pi ユーザーを smbpasswd に登録してパスワードを設定
$ sudo smbpasswd -a pi
New SMB password:
Retype new SMB password:
Added user pi.
接続
\\XX.XX.XX.XX\pi
で Windows から接続できました。(XX.XX.XX.XX は Raspberry Pi の IP アドレスです)