Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo over ssh #136

Open
berzia opened this issue May 10, 2016 · 4 comments
Open

sudo over ssh #136

berzia opened this issue May 10, 2016 · 4 comments
Labels

Comments

@berzia
Copy link

berzia commented May 10, 2016

Hi,

I want to run this command over ssh "sudo pw userdel user" and when I try, lshell return "*** forbidden shell escape". Can you help me pls ?

PS : shell.conf
allowed : 'all' - ['sh','czh','chpass']
sudo_commands : all
overssh : ['grep', 'cut', 'uname', 'sudo', 'pw']

Have a nice day.

Berzia

@ghantoos
Copy link
Owner

Hello,

It looks like the pw command is using exec call, which are intercepted by lshell. I am not sure what is pw, can you tell me what hides behind it?

@berzia
Copy link
Author

berzia commented May 19, 2016

Hi,

Thanks for your answer.

pw is used to manage accounts (users and groups) on FreeBSD. I try to delete an user with a ssh script.
( https://www.freebsd.org/cgi/man.cgi?pw%288%29)

I have an other problem, when I try to start a daemon like this : /usr/local/etc/rc.d/example start, lshell returns "forbidden command". I don't know if I miss something or if it's a bug.

bye

@ghantoos
Copy link
Owner

Have you tried adding pw(8) to the allowed list?

About the daemons, you will need to add /usr/local/etc/rc.d/ to the path of your user in order not to get rejected for "forbidden path". Then add "/usr/local/etc/rc.d/example" to the allowed list.

@ghantoos
Copy link
Owner

You can also use allowed_cmd_path: ['/usr/local/etc/rc.d/'] then add example to your allowed list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants