Linux:chsh 和 ypchsh 都不起作用,我可以更改我的 shell 吗?

Ogr*_*m33 8 linux shell

我是一个老派的 Unix 人,所以我的 Linux 技能可能有点过时了。但这似乎应该很简单。

在我没有 root 的 Red Hat Linux 系统上(它由公司 IT 部门管理),我希望能够更改我的登录 shell。运行 chsh 给我:

$ chsh -s /bin/bash
chsh: can only change local entries; use ypchsh instead.
Run Code Online (Sandbox Code Playgroud)

所以,我改为运行 ypchsh:

$ ypchsh userid
ypchsh: can't find the master ypserver: Internal NIS error
Run Code Online (Sandbox Code Playgroud)

是什么赋予了?有人有其他想法吗?

use*_*686 8

  • 国家信息系统: ypchsh

  • LDAP:

    $ ldapmodify <<EOF
    dn: YOUR_DN
    changetype: modify
    replace: loginShell
    loginShell: /bin/bash
    -
    EOF
    
    Run Code Online (Sandbox Code Playgroud)

    YOUR_DN可能在形式中uid=$USER,ou=people,dc=example,dc=org;尝试ldapwhoami查看)

  • Hesiod:询问系统管理员。

  • Active Directory:询问系统管理员。


小智 5

我使用了一种解决方法来在登录时更改我的 shell。我刚刚把bash它用来改变我的.profile文件中的外壳。

您可以.profile在用户的主目录中找到- 使用ls -la来查看它。

您的.profile文件可能包含以下内容:

PATH=/usr/bin
export PATH
#Add this to go bash at login
bash
#end
Run Code Online (Sandbox Code Playgroud)

  • 这是一个公平的解决方法。虽然,在一行中只包含 /usr/bin/bash 会更容易。此外,“执行”新 shell 从而替换当前进程可能更好。 (7认同)