【电脑mac地址】Mac电脑网络账户中修改 shell(chsh)方法

更新时间:2019-11-23    来源:网络相关    手机版     字体:

【www.bbyears.com--网络相关】

在 Mac OS X 上,我们可以在 Users & Groups 设置中指定 Network Account Server 来开启网络账户的登录。但是,当我试图将网络账户的默认 shell 从 bash 修改为 zsh 的时候,出现了问题。


直接执行 chsh 命令,会在默认编辑器中打开下面的内容:

# Changing user information for rzeng.
# Use "passwd" to change the password.
##
# Open Directory: /Active Directory/XXXX/xxxx.com
##
Shell: /bin/bash
Full Name: Rong Zeng
Office Location:
Office Phone:
Home Phone:

当编辑了 shell: 的值之后,保存会出现这样的提示:

chsh: Operation was denied because the current credentials do not have the appropriate privileges. Operation was denied because the current credentials do not have the appropriate privileges.
chsh: no changes made

直接使用 sudo chsh -s /bin/zsh ,也会出现同样的提示。

根据 How do I change a users default shell in OSX? 提到的,按住 Ctrl 键单击 User & Groups 中显示的用户名称,会出现 Advanced Options... 选项,在其中可以设置默认的 shell。

但是,Network Account 没有 Advanced Options ,而其他用户都有。

最后,还是这个问答通过曲线救国的方式解决了问题: chsh doesn’t change $SHELL 。

方法很简单,操作系统不是不让改么?那么就直接改应用程序!

我使用的是 iTerm.app 代替默认的 Terminal 。进行如下的设置即可让 iTerm.app 启动的时候自动启动 zsh。

点击 iTerm.app -> Preferences -> Profiles -> General -> Command ;
设置 Command: 的值为 /bin/zsh 。


其实,如果不怕麻烦,在启动 shell 之后,再敲入 zsh 回车也能达到同样的效果。

本文来源:http://www.bbyears.com/jiaocheng/80661.html

热门标签

更多>>

本类排行