Closed guanana closed 8 years ago
This feature is not implemented for the moment. I will add it to the wishilist.
Were you able to find a temporary solution?
@guanana you just need to comment #sys.exit(0)
, the rest of the lines need to be uncommented to catch the "exit"
Even with your solution I'm unable to avoid the exit
centos-server ~ $ grep -A5 quit /usr/lib/python2.6/site-packages/lshell.py
if self.g_cmd in ['quit', 'exit', 'EOF']:
self.log.error('Exited')
if self.g_cmd == 'EOF':
self.stdout.write('\n')
# sys.exit(0)
centos-server ~ $ lshell
Welcome to your shell
Type '?' or 'help' to get a list of allowed commands
Contact support@company.com with any queries or problems
viewlogs:~$ exit
centos-server ~ $
centos-server ~ $ lshell --version
lshell-0.9.18 - Limited Shell
@guanana what version of lshell are you running?
It is on the previous comment @ghantoos , 0.9.18
Is any possibility that we can restrict exit command in lshell? I'm having env problems trying to login directly with lshell. One solution could be define the shell as bash and then execute lshell. It works perfect, the only problem... the user can just execute exit and come back to the bash. I tried adding exit in the forbidden commands but doesn't work. I also commented in the file /usr/lib/python2.6/site-packages/lshell.py this lines:
No luck neither.
Could you please tell me if is a feature it exists? Am I editing the incorrect file?