Editor With NO Shell Access?

Polytropon freebsd at edvax.de
Mon Mar 12 22:10:02 UTC 2012


On Mon, 12 Mar 2012 17:40:10 -0400, Steve Bertrand wrote:
> You can force a user directly into an editor so they have no shell 
> access. For example, if the user has '/bin/csh' as their login shell, 
> adding:
> 
> exec /usr/local/bin/vim
> 
> into their ~/.cshrc file will force them directly into vim. When they 
> exit vim, they are immediately logged off.

Just an idea about extending this idea: What if the shell
field for that user does not contain a shell, but the name
of the editor instead? I assume it has to be "noted" in
/etc/shells to work, but a passwd entry like

	bob:*:1234:1234:Two-loop-Bob:/home/bob:/usr/local/bin/joe

could work (haven't tested that). A list of the files can
be obtained when opening a file ^KE and pressing the Tab key.
It would be worth testing if shell escapes like !command
will work in this constellation...




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list