From: Michael Shigorin <mike@osdn.org.ua> To: ALT Linux Community general discussions <community@lists.altlinux.org> Subject: Re: [Comm] home of users Date: Thu, 19 Nov 2009 22:02:53 +0200 Message-ID: <20091119200253.GY22337@osdn.org.ua> (raw) In-Reply-To: <9bd187690911191028w543e0869p67c099950a09bf9c@mail.gmail.com> On Thu, Nov 19, 2009 at 08:28:25PM +0200, Andriy Dobrovol`s`kii wrote: > >> - Можно ли одним махом восстановить умолчательное состояние > >> каталогов для пользователей? > > Мах придётся написать самому -- что-то вроде прохода по > > /etc/passwd (или `getent passwd`), выделения login/uid/gid > > и собствено homedir, копирования /etc/skel (и, кажется, поверх > > ещё /etc/skel.нужная_локаль) как homedir и смены прав на uid:gid. > Да как раз этого и хотедось избежать. :) Ну нет -- так нет. > Хотя была б удобная штука. Вот тебе заготовка: http://fixunix.com/freebsd/298962-re-fsck.html --- > # awk -F: '$3>999{print $1}' /etc/passwd | xargs mkdir > # for i in *; do chown $i:$i $i; done It might help to copy the stuff out of /usr/share/skel, too, like this (untested): cd /home for user in `awk -F: '$3>999{print $1}' /etc/passwd`; do cp -r /usr/share/skel ./$user for dotfile in $user/dot.*; do mv $dotfile `echo $dotfile | sed 's#/dot\.#.#'` done chown -R $user:$user $user done Take a look at /usr/sbin/adduser to see how it does it --- Итеративно искал по: /etc/passwd mkdir chown skel /etc/passwd mkdir chown skel for "all users" /etc/passwd mkdir chown skel for "all users" recreate -- ---- WBR, Michael Shigorin <mike@altlinux.ru> ------ Linux.Kiev http://www.linux.kiev.ua/
prev parent reply other threads:[~2009-11-19 20:02 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-11-18 18:47 Andrii Dobrovol`s`kii 2009-11-19 17:41 ` Michael Shigorin 2009-11-19 18:28 ` Andriy Dobrovol`s`kii 2009-11-19 20:02 ` Michael Shigorin [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20091119200253.GY22337@osdn.org.ua \ --to=mike@osdn.org.ua \ --cc=community@lists.altlinux.org \ --cc=shigorin@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git