[augeas-devel] Augtool as a shell

Raphaël Pinson raphink at gmail.com
Thu Nov 18 23:46:06 UTC 2010


To be more precise, this is my little game:

root at dell:~# cat /usr/local/bin/augtool_shell
#!/bin/sh
/usr/bin/augtool -r$HOME

root at dell:~# getent passwd raphink
raphink:x:1001:1001:Raphael
Pinson:/home/raphink:/usr/local/bin/augtool_shell

root at dell:~# find /home/raphink/
/home/raphink/
/home/raphink/etc
/home/raphink/etc/hosts
/home/raphink/etc/services
/home/raphink/.cache
/home/raphink/.cache/motd.legal-displayed

root at dell:~# login raphink
Password:
Last login: Fri Nov 19 00:39:52 CET 2010 on pts/1
Linux dell 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:48:22 UTC 2010
i686 GNU/Linux
Ubuntu 10.04.1 LTS

Welcome to Ubuntu!
 * Documentation:  https://help.ubuntu.com/

*** System restart required ***
augtool> print /files/etc/hosts/3
/files/etc/hosts/3
/files/etc/hosts/3/ipaddr = "::1"
/files/etc/hosts/3/canonical = "localhost"
/files/etc/hosts/3/alias[1] = "ip6-localhost"
/files/etc/hosts/3/alias[2] = "ip6-loopback"
augtool> set /files/etc/hosts/3/alias[last()+1] "localhost-ipv6"
augtool> save
Saved 1 file(s)
augtool> quit

root at dell:~# grep "^::1" /home/raphink/etc/hosts
::1     localhost ip6-localhost ip6-loopback localhost-ipv6


Upon thinking about it a bit, I can see some great potential in this
actually, to prevent providing web interfaces or such things to people who
only need to modify a few conf files on a machine and don't need a full
shell access.


Raphael


2010/11/19 Raphaël Pinson <raphink at gmail.com>

> Hi guys,
>
> Just for fun, I tried using /usr/bin/augtool as a shell for a user. It
> works, I just can't think of a use case that would be practical, maybe
> providing an interface of a maintenance team to only modify some conffiles
> and do nothing else.
>
> I just thought I'd share this in case it inspires some of you :-)
>
>
> Raphael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20101119/2fbcaeeb/attachment.htm>


More information about the augeas-devel mailing list