* [sisyphus] Q: how to set password on first login
@ 2007-07-05 2:45 sergey ivanov
2007-07-05 8:26 ` Andrew G. Klepcha
2007-07-05 13:33 ` Sergey
0 siblings, 2 replies; 6+ messages in thread
From: sergey ivanov @ 2007-07-05 2:45 UTC (permalink / raw)
To: ALT Linux Sisyphus discussion list
Привет всем.
Помогите пожалуйста, не могу справиться с задачкой.
Надо позволить пользователю установить себе пароль при первом входе в
систему по ssh по ключу.
Я пробовал suid script вызывающий passwd, пробовал NOPASSWD:
---
<login> ALL=(ALL) NOPASSWD: /usr/bin/passwd <login>
---
и даже
---
<login> ALL=(ALL) NOPASSWD: /bin/su -c "/usr/bin/passwd <login>"
---
Везде или sudo или passwd запрашивает текущий пароль пользователя
прежде чем позволить ему установить новый.
А задачка в том и состоит чтобы на массе серверов автоматом сделать кучу
аккаунтов имея для них public keys но не зная их паролей. И дать им
потом возможность пользоваться sudo, но не беспарольно, - следовательно
им надо установить себе пароли которые они сами захотят.
Прямо кроме установки всем им начаьного пароля типа 'changeme' ничего
пока более осмысленного не получается.
С уважением,
Сергей Иванов.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Q: how to set password on first login
2007-07-05 2:45 [sisyphus] Q: how to set password on first login sergey ivanov
@ 2007-07-05 8:26 ` Andrew G. Klepcha
2007-07-05 9:45 ` Slava Semushin
2007-07-05 13:33 ` Sergey
1 sibling, 1 reply; 6+ messages in thread
From: Andrew G. Klepcha @ 2007-07-05 8:26 UTC (permalink / raw)
To: sisyphus
В сообщении от Thursday 05 July 2007 06:45:04 sergey ivanov написал(а):
> Привет всем.
> Помогите пожалуйста, не могу справиться с задачкой.
> Надо позволить пользователю установить себе пароль при первом входе в
> систему по ssh по ключу.
не уверен, что правильно понял вашу задачу...
в пору, когда мне довелось админить/заводить кучу пользователей и захотелось,
чтобы они сами назначали себе пароль, то я вписывал всем в ~/.profile
следующее:
------------------------
CUR_PASS=`passwd -s|/usr/local/bin/gawk '{print $2}'`
while [[ $CUR_PASS != PS ]];
do
passwd
CUR_PASS=`passwd -s|/usr/local/bin/gawk '{print $2}'`
done
if [[ $CUR_PASS != PS ]]; then
exit
fi
------------------
надеюсь, идея понятна....
зы
правда это делалось на sco unixware
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Q: how to set password on first login
2007-07-05 8:26 ` Andrew G. Klepcha
@ 2007-07-05 9:45 ` Slava Semushin
2007-07-05 9:37 ` Andrew G. Klepcha
0 siblings, 1 reply; 6+ messages in thread
From: Slava Semushin @ 2007-07-05 9:45 UTC (permalink / raw)
To: ALT Linux Sisyphus discussion list
05.07.07, Andrew G. Klepcha<drew / mogilev.beltelecom.by> написал(а):
[...]
> CUR_PASS=`passwd -s|/usr/local/bin/gawk '{print $2}'`
Видимо, passwd -s в вашем случае выдавала пароль пользователя. В ALT'е
passwd, судя по ману, поддерживает всего две опции, в CentOS чуть
больше, но опции -s я нигде не нашел. Пути узнать текущий пароль
тоже...
На ум преходит взять хэш пароля из /etc/shadow (для CentOS) или из
/etc/tcb/$USER/shadow (для ALT Linux) и сверить с хэшем для дефолтного
пароля, но эта операция недоступна простым смертным...
[skip]
--
+ Slava Semushin | slava.semushin @ gmail.com
+ ALT Linux Team | php-coder @ altlinux.ru
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Q: how to set password on first login
2007-07-05 9:45 ` Slava Semushin
@ 2007-07-05 9:37 ` Andrew G. Klepcha
0 siblings, 0 replies; 6+ messages in thread
From: Andrew G. Klepcha @ 2007-07-05 9:37 UTC (permalink / raw)
To: sisyphus
В сообщении от Thursday 05 July 2007 13:45:44 Slava Semushin написал(а):
> > CUR_PASS=`passwd -s|/usr/local/bin/gawk '{print $2}'`
>
> Видимо, passwd -s в вашем случае выдавала пароль пользователя. В ALT'е
точнее -- не сам пароль, а его состояние (задан/не задан/проч.) . но сути это
все равно не меняет
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Q: how to set password on first login
2007-07-05 2:45 [sisyphus] Q: how to set password on first login sergey ivanov
2007-07-05 8:26 ` Andrew G. Klepcha
@ 2007-07-05 13:33 ` Sergey
2007-07-06 3:52 ` Slava Semushin
1 sibling, 1 reply; 6+ messages in thread
From: Sergey @ 2007-07-05 13:33 UTC (permalink / raw)
To: ALT Linux Sisyphus discussion list
sergey ivanov wrote:
> Помогите пожалуйста, не могу справиться с задачкой.
> Надо позволить пользователю установить себе пароль при первом входе в
> систему по ssh по ключу.
> Я пробовал suid script вызывающий passwd, пробовал NOPASSWD:
> ---
> <login> ALL=(ALL) NOPASSWD: /usr/bin/passwd <login>
> ---
[skip]
Сам себе отвечаю:
видимо плохо пробовал. Наверно опечатка была где-то. Сейчас всё нахорошо
работает.
--
Сергей.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Q: how to set password on first login
2007-07-05 13:33 ` Sergey
@ 2007-07-06 3:52 ` Slava Semushin
0 siblings, 0 replies; 6+ messages in thread
From: Slava Semushin @ 2007-07-06 3:52 UTC (permalink / raw)
To: ALT Linux Sisyphus discussion list
2007/7/5, Sergey <seriv / parkheights.dyndns.org>:
[...]
> > Я пробовал suid script вызывающий passwd, пробовал NOPASSWD:
> > ---
> > <login> ALL=(ALL) NOPASSWD: /usr/bin/passwd <login>
> > ---
> [skip]
> Сам себе отвечаю:
> видимо плохо пробовал. Наверно опечатка была где-то. Сейчас всё нахорошо
> работает.
Ээээ... Кажется вы не с той стороны копаете. Это делается проще/иначе в АЛЬТе:
# control gpasswd public
Тогда все пользователи могут изменять свой пароль, или
# control gpasswd wheelonly
В таком случае пароль изменить смогут только пользователи, входящие в
группу wheel.
--
+ Slava Semushin | slava.semushin @ gmail.com
+ ALT Linux Team | php-coder @ altlinux.ru
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-07-06 3:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-05 2:45 [sisyphus] Q: how to set password on first login sergey ivanov
2007-07-05 8:26 ` Andrew G. Klepcha
2007-07-05 9:45 ` Slava Semushin
2007-07-05 9:37 ` Andrew G. Klepcha
2007-07-05 13:33 ` Sergey
2007-07-06 3:52 ` Slava Semushin
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/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 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git