6
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ファイルサーバーのユーザー移行

Posted at

sambaのファイルサーバーのユーザー移行手順めも

前提条件

移行前サーバー

centOS4.9
samba3.0
sambaユーザーのパスワード管理は「smbpasswd」でファイル管理

移行後サーバー

cantOS6.3
samba3.5
sambaユーザーのパスワード管理は「smbpasswd」でファイル管理のままにする

必要ファイルの取得

移行前サーバーでの作業

移行のために必要なユーザー情報の取得

cd
mkdir userdate
cd userdate
cp /etc/group .
cp /etc/gshadow .
cp /etc/passwd .
cp /etc/shadow .
cp /etc/samba/secrets.tdb .
cp /etc/samba/smbpasswd .
cp /etc/samba/smbusers .
cp /etc/samba/smb.conf .
cd ..
tar zcvf userdate.tar.gz userdate

scpなりなんなりでローカルに持ってくる

ユーザー情報ファイルの設置

移行後サーバーでの作業

scpなりなんなりで固めたファイルをあらかじめ置いておく

tar zxvf userdate.tar.gz
cd userdate
mv /etc/group /etc/group.def
mv /etc/gshadow /etc/gshadow.def
mv /etc/passwd /etc/passwd.def
mv /etc/shadow /etc/shadow.def
cp group /etc/
cp gshadow /etc/
cp passwd /etc/
cp shadow /etc/
chmod 000 /etc/shadow
chmod 000 /etc/gshadow
mv /etc/samba/secrets.tdb /etc/samba/secrets.tdb.def
mv /etc/samba/smbpasswd /etc/samba/smbpasswd.def
mv /etc/samba/smbusers /etc/samba/smbusers.def
mv /etc/samba/smb.conf /etc/samba/smb.conf.def
cp secrets.tdb /etc/samba/
cp smbpasswd /etc/samba/
cp smbusers /etc/samba/
cp smb.conf /etc/samba/

念のため置いてきたファイルの権限がdefに変えた元ファイルと変わりがないか確認しておく(重要)

smbpasswdを読むようにconfの記述追加

vi /etc/samba/smb.conf
[global]
…
        passdb backend = smbpasswd
        smb passwd file = /etc/samba/smbpasswd
…

testparm -v #sambaのデフォルトの設定も表示

testparm -vの出力内容を見て記述変更した内容に書き変わっていればOK

shutdown -r now

願いながら再起動を行い、移行したユーザーでsamba接続が行えれば無事終了。

6
8
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
6
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?