Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. Hello,
  2. this is just an idea not sure if its a secure method or not (it can be extended as long as you know bash) :
  3.  
  4. on Node :
  5. useradd -d console-user
  6. passwd console-user
  7.  
  8. create file /home/console-user/enter.sh with below content :
  9. #!/bin/bash
  10. exec sudo /usr/sbin/vzctl enter Container-ID
  11.  
  12. now add root powers to that user to execute vzctl via sudo
  13. execute visudo
  14.  
  15. and add
  16. console-user ALL=(ALL) NOPASSWD: /usr/sbin/vzctl
  17.  
  18. last thing
  19. chmod 755 /home/console-user/enter.sh
  20. usermod -s /home/console-user/enter.sh console-user
  21.  
  22. now when you login with console-user you will enter to VPS with Container-Id (specified in our enter.sh) as root .
  23.  
  24. Highest Regards
  25. Mohammed H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement