0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Sambaを使ってUbuntuのディレクトリをネットワーク共有する

Last updated at Posted at 2024-07-31

はじめに

UbuntuとWindowsをsamba共有する方法を記載します。

Ubuntuに共有ディレクトリを作成してWindowsからここにアクセスします。
Ubuntuのuser名をuserとします。
Windowsからネットワークでuserでユーザ認証してアクセスします。

samba install

sudo apt-get install -y samba

ユーザ設定

userというUbuntu userはすでに存在しているとします。
samba userを作成します。

console
sudo pdbedit -a user  # samba userを追加します
sudo smbpasswd user   # passwordを設定します
sudo pdbedit -L       # samba user一覧を表示します

共有設定

共有するディレクトリパスなどを設定します
/etc/samba/smb.conf
を編集します。

[Share]
   path = /home/user
   writable = yes
   create mode = 0664
   directory mode = 0755
   share modes = yes
   guest ok = no
   valid users = @user 

smbを再起動します

sudo /etc/init.d/smbd restart

接続確認

Ubuntuにてifconfigコマンドを入力してIPアドレスを取得します。
WindowsにてIPアドレス指定アクセスします。Shareディレクトリが閲覧できれば接続OKです。

接続がうまくいかない場合は/var/log/samba以下のファイルを調査してください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?