Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hello,
- this is just an idea not sure if its a secure method or not (it can be extended as long as you know bash) :
- on Node :
- useradd -d console-user
- passwd console-user
- create file /home/console-user/enter.sh with below content :
- #!/bin/bash
- exec sudo /usr/sbin/vzctl enter Container-ID
- now add root powers to that user to execute vzctl via sudo
- execute visudo
- and add
- console-user ALL=(ALL) NOPASSWD: /usr/sbin/vzctl
- last thing
- chmod 755 /home/console-user/enter.sh
- usermod -s /home/console-user/enter.sh console-user
- now when you login with console-user you will enter to VPS with Container-Id (specified in our enter.sh) as root .
- Highest Regards
- Mohammed H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement