简体   繁体   English

如何将zsh设置为openvz容器中的默认外壳?

[英]How to set zsh as default shell in openvz container?

I'm running a vz container (debian) on PVE, and I'd like to use zsh as my default shell when i run : 我在PVE上运行vz容器(debian),我想在运行时使用zsh作为默认外壳程序:

vzctl enter MY_CONTAINER_ID

I tried to run chsh in the container but it as no effect, unless I run su root , i'm still using bash. 我试图在容器中运行chsh ,但没有任何效果,除非我运行su root ,但我仍在使用bash。

Is-it at least possible ? -至少有可能吗?

Anyone has succesfully achieved this ? 有人成功做到了吗?

When there is a will, there is a way ! 有志者事竟成!

I replaced the whole content of ~/.bashrc with : 我用~/.bashrc替换了~/.bashrc的全部内容:

zsh && exit

And it did the job... Maybe it's a bit hacky, but found no other way... 它确实完成了工作...也许有点笨拙,但没有找到其他方法...

openvz上的帖子提出了相同的问题,并且答复表明/ bin / bash硬编码在vzctl的代码中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM