Sharp wrote on 25/06/11 21:14:
On Sat, Jun 25, 2011 at 8:56 PM,<[email protected]>  wrote:
$ sudo echo "# oneadmin test">>  /vz/private/164/etc/rc.d/rc.local
-bash: /vz/private/164/etc/rc.d/rc.local: Permission denied

Does someone have any ideas what can be the reason of insufficient
privileges for regular user with full root rights granted via sudo?

That's simple. Your echo command is running as root because of sudo.
But the shell that's redirecting echo's output is still running as
you.

You can become a root and do that command without any problems.
Thanks for quick reply!

I need to do that in a script. I found the solution:
$ sudo  bash -c 'echo "# oneadmin test 2" >> /vz/private/164/etc/rc.local'

Regards,
Nikolay.

_______________________________________________
Users mailing list
[email protected]
https://openvz.org/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
https://openvz.org/mailman/listinfo/users

Reply via email to