R.A. Epigonos et al.

[debian] ダミーユーザの作成

環境設定依存性を評価するためにダミーユーザを作ろうかと思った。ダミーユーザを作成して、環境設定テストをして、ダミーユーザを削除する。その手順。

ユーザを作成して、ユーザIDやグループIDを確認。

# adduser hoge
Adding user `hoge' ...
Adding new group `hoge' (1001) ...
Adding new user `hoge' (1001) with group `hoge' ...
Creating home directory `/home/hoge' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for hoge
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] Y
# grep -e '^hoge' /etc/passwd
hoge:x:1001:1001:,,,:/home/hoge:/bin/bash
# grep -e '^hoge' /etc/group
hoge:x:1001:
# ls -la /home/hoge/
total 20
drwxr-xr-x 2 hoge hoge 4096 *** ** **:** .
drwxr-xr-x 9 root root 4096 *** ** **:** ..
-rw-r--r-- 1 hoge hoge  220 *** ** **:** .bash_logout
-rw-r--r-- 1 hoge hoge 3515 *** ** **:** .bashrc
-rw-r--r-- 1 hoge hoge  675 *** ** **:** .profile

一般ユーザからダミーユーザに切り替える。その後いろいろ作業。

$ su - hoge
Password:
$ cat << 'EOT' | gpg --batch --gen-key
Key-Type: RSA
Key-Length: 4096
Key-Usage: encrypt sign
Subkey-Type: RSA
Subkey-Length: 4096
Subkey-Usage: encrypt
Name-Real: hoge fuga
Name-Email: hoge@example.com
Expire-Date: 0
Passphrase: hoge
%commit
EOT
....+++++
.+++++
.........................+++++
...+++++
gpg: key 02DF0240 marked as ultimately trusted
$ mkdir -p ~/.emacs.d/lisp/wl/;
$ cat << 'EOT' > ~/.emacs.d/init.el
(add-to-list 'load-path "~/.emacs.d/lisp/wl/")
EOT
$ zcat /usr/share/doc/wl-beta/examples/ja/dot.wl.gz > ~/.emacs.d/lisp/wl/dot.wl.el
$ cat << 'EOT' > ~/.emacs.d/lisp/wl/dot.wl.hoge.el
(setq wl-folders-file "~/.emacs.d/lisp/wl/folders")
(setq wl-address-file "~/.emacs.d/lisp/wl/address")
(setq wl-from "hoge@example.com")
(add-hook 'wl-draft-send-hook '(lambda () 
(mime-edit-set-sign t)
))
(setq mime-edit-pgp-signers '("02DF0240"))
; (setq mime-edit-pgp-verbose t)
EOT
$ cat << 'EOT' > ~/.wl
(load "dot.wl.el")
(load "dot.wl.hoge.el")
EOT
$ cat << 'EOT' > ~/.emacs.d/lisp/wl/folders
-gmane.linux.debian.user.announce@news.gmane.org
-gmane.linux.debian.devel.announce@news.gmane.org
-gmane.linux.debian.devel.kernel@news.gmane.org
-gmane.linux.debian.user.news@news.gmane.org
-gmane.linux.debian.user@news.gmane.org
EOT
# deluser --remove-home hoge
Looking for files to backup/remove ...
Removing files ...
Removing user `hoge' ...
Warning: group `hoge' has no more members.
Done.
# deluser --remove-all-files hoge
$ gpg --with-colons --list-keys --with-fingerprint --with-fingerprint

リファレンス

  1. Debian GNU/Linux System Administrator's Manual (Obsolete Documentation) - Managing User Accounts
  2. Unattended GPG key generation - Using the GNU Privacy Guard
  3. http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
  4. Japanese discussion of the Wanderlust mail/news reader for Emacs/XEmacs

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2008-05-16T11:02:15+09:00
  2. Modified: 2008-05-16T11:02:15+09:00
  3. Generated: 2024-11-18T23:09:11+09:00