trinity-users@lists.pearsoncomputing.net

Message: previous - next
Month: November 2012

Re: [trinity-users] SED and PAM

From: Kate Draven <borglabs4@...>
Date: Wed, 28 Nov 2012 16:45:18 -0500
On 11/28/12, Neil Youngman <ny@...> wrote:
> On Wednesday 28 November 2012 02:55:48 Kate Draven wrote:
>> Hi
>>
>> I know this isn't exactly a Trinity-centric question but it will
>> eventually apply to it as I switch from KDE3 to TDE. So please bare
>> with me.
>>
>> Does anyone have any experience with SED and PAM?
>> I need to replace the default admin user (arklinux) with 2 new users.
>>
>> I normally use sed -i -e 's,arklinux,NewUser,g' /etc/pam.d/* to change
>> the admin user in PAM.
>>
>> How to a pose it so it adds two more users?
>
> Something like this?
>
> $ sed -i.bak -e 's/\(.*\)arklinux\(.*\)/\1NewUser1\2\
> \1NewUser2\2/' /etc/pam.d/*
>
> The obvious limitation on that is it will probably only work where arklinux
>
> appears once on a line. Multiple occurrences would need a bit more
> thought.
>
> Test carefully before use and note the -i.bak to backup the originals in
> case of mistakes.
>
> HTH
>
> Neil Youngman
>

Hi Neil

Thanks. I spoke to my guru Bero and he gave me this line.

 sed -i -e 's|arklinux|NewUser1,NewUser2,NewUser3|g' /etc/pam.d/*

It works great. I'm making note of your line as it creates instant
backups. I always tar.bz2 everything before I alter it. So the PAM
directory has been backed up quite tidy.

Thank you for your help, it's greatly appreciated.

Kate


> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> trinity-users-unsubscribe@...
> For additional commands, e-mail:
> trinity-users-help@...
> Read list messages on the web archive:
> http://trinity-users.pearsoncomputing.net/
> Please remember not to top-post:
> http://trinity.pearsoncomputing.net/mailing_lists/#top-posting
>
>