简体   繁体   English

无法激活MacPorts安装的Zsh

[英]Unable to activate Zsh installed by MacPorts

I put unsuccessfully Zsh installed by MacPorts as my login shell by setting the following path to Settings 通过将以下路径设置为“设置”,我将MacPorts安装的Zsh失败作为我的登录shell。

/opt/local/bin/zsh

I put it to the Advanced options at the User accounts too. 我也将其放在“用户”帐户的“高级”选项中。 I get the following error alt text http://dl.getdropbox.com/u/175564/macportsError.png 我收到以下错误替代文本http://dl.getdropbox.com/u/175564/macportsError.png

I put the following path unsuccessfully to Settings 我将以下路径设置失败

/opt/local/var/macports/software/zsh/4.2.7_0+mp_completion

I get the following error when I start my shell again 再次启动我的外壳程序时出现以下错误

login: /opt/local/var/macports/software/zsh/4.2.7_0+mp_completion: Permission denied

[Process completed]

How can you activate your Zsh as a login shell? 如何激活Zsh作为登录外壳?

As Norbert says, I think the answer is in /etc/shells. 正如诺伯特所说,我认为答案在/ etc / shells中。 Mine has this: 我的有:

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

Add /opt/local/bin/zsh to that list, and you should be fine. /opt/local/bin/zsh到该列表,就可以了。 You should then be able to change the shell (individually for each user) using chsh . 然后,您应该能够使用chsh更改外壳程序(针对每个用户)。

I know this question was marked answered, but 我知道这个问题被标记为已回答,但是

/opt/local/var/macports/software/zsh/4.2.7_0+mp_completion /opt/local/var/macports/software/zsh/4.2.7_0+mp_completion

is not even an executable file in macports. 在macports中甚至不是可执行文件。 That's why you got the error. 这就是为什么您得到错误。 Shells must be executable. Shell必须是可执行的。

You wanted to set your shell to /opt/local/bin/zsh . 您想将shell设置为/ opt / local / bin / zsh。

This worked for me both in Leopard and in snow leopard. 这在豹子和雪豹中都对我有用。 OSX does not actually use /etc for configuration management, it uses NetInfo ( Leopard ) and now it uses Directory Services ( Snow Leopard) . OSX实际上不使用/ etc进行配置管理,它使用NetInfo(Leopard),现在使用目录服务(Snow Leopard)。 You wanted to set that in by right clicking on your user in System Preferences > Accounts,( SL) or by using Netinfo Manager (Leopard) 您想通过在“系统偏好设置”>“帐户”(SL)上右键单击您的用户或使用Netinfo Manager(Leopard)来进行设置

EDIT: 编辑:

Snow Leopard: sudo dscl . 雪豹:sudo dscl。 -create /Users/chiggsy UserShell /opt/local/bin/zsh -创建/ Users / chiggsy UserShell / opt / local / bin / zsh

(create creates or updates ) (创建创建或更新)

EDIT: Please picture me covered in foul, stinking shame. 编辑:请想象我被犯规掩盖了,令人羞耻。 I'm using iTerm, and changing the shell in my account worked flawlessly. 我正在使用iTerm,并且在我的帐户中更改外壳程序的工作非常顺利。 In Terminal, I got the same result as the OP, and fixed it by editing /etc/shells. 在Terminal中,我得到了与OP相同的结果,并通过编辑/ etc / shells对其进行了修复。 Now, it seems to me that I should not be able to bypass the /etc/shells restriction by simply using a 3rd party terminal, but it seems that is the case. 现在,在我看来,我不应该仅通过使用第3方终端就能绕过/ etc / shells限制,但事实就是如此。

Did you enter the shell into /etc/shells. 您是否将Shell输入到/ etc / shells中。 It seems that Mac OS manages the valid shells in there. 看来Mac OS在那里管理有效的外壳程序。 I can't tell exactly because I'm not on Mac 我不能确切地说是因为我不在Mac上

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

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