我有一个托管的 Debian 服务器。当我通过 ssh 登录时,我看到了一个 sh 环境。如何更改它以便我在 bash 环境中开始?
jor*_*anm 43
作为普通用户,您可以使用该chsh命令更改默认登录 shell 。下面是一个例子:
chsh -s /bin/bash
Run Code Online (Sandbox Code Playgroud)
另一种选择是使用 usermod 作为 root:
usermod -s /bin/bash username
Run Code Online (Sandbox Code Playgroud)
对于您尝试使用共享帐户(无论出于何种原因)并且无法更改默认 shell 的情况,您可以运行
ssh -t <user@hostname> bash -l
Run Code Online (Sandbox Code Playgroud)
如果你需要让你的环境不受其他 shell 的影响,那么你可以先运行那个 shell;例如
ssh -t <user@hostname> ksh -c bash -l
Run Code Online (Sandbox Code Playgroud)
您编辑/etc/passwd最后一个条目是默认 shell 的位置。让它/bin/bash。
或者,您可以更改/bin/sh不是 bash的系统默认值。
| 归档时间: |
|
| 查看次数: |
50954 次 |
| 最近记录: |