Samba の導入
Linux 機に立てたファイルサーバを Mac、Windows ともに参照するなら samba の方が良いのではないかということで、proftpd を停止して samba を導入することに。
ftpd はそのうちつかうことになるかもなので残したまま作業した足跡。
apt-get で samba をインストール。
$ sudo apt-get install samba [sudo] password for ubuntu: パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 以下の特別パッケージがインストールされます: libcups2 libtalloc1 libwbclient0 samba-common 提案パッケージ: cups-common openbsd-inetd inet-superserver smbldap-tools 以下のパッケージが新たにインストールされます: libcups2 libtalloc1 libwbclient0 samba samba-common アップグレード: 0 個、新規インストール: 5 個、削除: 0 個、保留: 0 個。 8100kB のアーカイブを取得する必要があります。 この操作後に追加で 22.4MB のディスク容量が消費されます。 続行しますか [Y/n]? Y 取得:1 http://jp.archive.ubuntu.com intrepid-updates/main libcups2 1.3.9-2ubuntu6.1 [170kB] 取得:2 http://jp.archive.ubuntu.com intrepid/main libtalloc1 1.2.0~git20080616-1 [14.5kB] 取得:3 http://jp.archive.ubuntu.com intrepid-updates/main libwbclient0 2:3.2.3-1ubuntu3.4 [87.6kB] 取得:4 http://jp.archive.ubuntu.com intrepid-updates/main samba-common 2:3.2.3-1ubuntu3.4 [3459kB] 取得:5 http://jp.archive.ubuntu.com intrepid-updates/main samba 2:3.2.3-1ubuntu3.4 [4369kB] 8100kB を 4s で取得しました (1822kB/s) パッケージを事前設定しています ... 未選択パッケージ libcups2 を選択しています。 (データベースを読み込んでいます ... 現在 17796 個のファイルとディレクトリがインストールされています。) (.../libcups2_1.3.9-2ubuntu6.1_i386.deb から) libcups2 を展開しています... 未選択パッケージ libtalloc1 を選択しています。 (.../libtalloc1_1.2.0~git20080616-1_i386.deb から) libtalloc1 を展開しています... 未選択パッケージ libwbclient0 を選択しています。 (.../libwbclient0_2%3a3.2.3-1ubuntu3.4_i386.deb から) libwbclient0 を展開しています... 未選択パッケージ samba-common を選択しています。 (.../samba-common_2%3a3.2.3-1ubuntu3.4_i386.deb から) samba-common を展開しています... 未選択パッケージ samba を選択しています。 (.../samba_2%3a3.2.3-1ubuntu3.4_i386.deb から) samba を展開しています... Processing triggers for man-db ... Processing triggers for ufw ... libcups2 (1.3.9-2ubuntu6.1) を設定しています ... libtalloc1 (1.2.0~git20080616-1) を設定しています ... libwbclient0 (2:3.2.3-1ubuntu3.4) を設定しています ... samba-common (2:3.2.3-1ubuntu3.4) を設定しています ... Creating config file /etc/samba/smb.conf with new version samba (2:3.2.3-1ubuntu3.4) を設定しています ... Generating /etc/default/samba... tdbsam_open: Converting version 0 database to version 3. account_policy_get: tdb_fetch_uint32 failed for field 1 (min password length), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 2 (password history), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 3 (user must logon to change password), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 4 (maximum password age), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 5 (minimum password age), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 6 (lockout duration), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 7 (reset count minutes), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 8 (bad lockout attempt), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 9 (disconnect time), returning 0 account_policy_get: tdb_fetch_uint32 failed for field 10 (refuse machine password change), returning 0 Importing account for nobody...ok Importing account for ubuntu...ok * Starting Samba daemons ...done. Processing triggers for libc6 ... ldconfig deferred processing now taking place
Ubuntuシステムユーザをsambaユーザとして追加する。
$ sudo smbpasswd -a ubuntu New SMB password: Retype new SMB password: Added user root.
samba ホームディレクトリを作成して、設定ファイルを書き換える。
$ sudo mkdir /home/samba $ sudo chmod 777 /home/samba $ sudo vi /etc/samba/smb.conf ... browseable = no writable = yes create mask = 0744 directory mask = 0755 path = /home/samba guest ok = yes share modes = no
sambaデーモンを再起動する。
$ sudo /etc/init.d/samba restart * Stopping Samba daemons ...done. * Starting Samba daemons ...done.
Mac から接続確認してみる。
Finder > 移動 > サーバへ移動 を選択して、smb://Ubuntuアドレス を入力。
Mac からは接続 OK。
Windows もダイジョブだべー