我在ubuntu服务器上工作,但没有root权限。默认外壳为<html>
<head>
<script>
<!--
function login() {
document.form1.action="http://fritz.box";
document.form1.submit();
}
//-->
</script>
</HEAD>
<BODY onLoad="login()">
<form NAME="form1" id=form1 method="POST" >
<input type=hidden name="uiUser" value="admin">
<input type=hidden name="uiPass" value="mypassword">
</form>
</body>
</html>
。
当我尝试更改默认外壳程序时,它告诉我它没有权限。
dash
权限问题无法解决,因此每次登录时我都转向user@host:~$ chsh -s "which zsh"
You may not change the shell for 'binjie'.
运行bash。将~/.profile
添加到echo something
时,将执行它。但是,当我将~/.profile
添加到exec -c bash
时,通过SSH登录后,shell失去了响应。单击~/.profile
后,连接已关闭。我很困惑有人可以帮忙吗?
答案 0 :(得分:0)
好吧,我在仪表板手册中找到了解决方法:
登录外壳程序首先从文件/ etc / profile和.profile中读取命令(如果存在)。如果环境变量ENV是在交互式Shell的入口处设置的,或者是在登录Shell的.profile中设置的,则该Shell接下来将从ENV中命名的文件中读取命令。因此,用户应将仅在登录时要执行的命令放在.profile文件中,并将对ENV文件内每个交互式shell执行的命令。要将ENV变量设置为某个文件,请将以下行放在主目录的.profile中
ENV=$HOME/.shinit; export ENV
用“ .shinit”替换您想要的任何文件名。
但是仍然有人可以向我解释为什么将exec -c bash
直接添加到.profile
无效吗?