Generally, if you install Jailkit you can init “editors” to have several editors available in your jail as you also do in your operating system. By using
pico it could be possible to running into an error by trying to use them.
The error message could be something like this:
Error opening terminal: unknown.
The problem here is a missing environment so that the editor doesn’t know which environment to use.
Fixing this bug is really easy. You just need to edit the file
/etc/jailkit/jk_chrootsh.ini and add a default environment. So just add the following lines:
[DEFAULT] env = TERM, PATH
However, if you retry using
pico the error message is still the same. What you need to do is reinit the editors. Assuming the jail is located in
/var/jail, the command would be:
jk_init -vf /var/jail editors
Make sure to use the
-f in order to overwrite existing symbolic links and force a reinit.
After that you can use
pico errorless inside the jail.