使用 X2Go 客户端登录 ubuntu 终端时如何添加/编辑 PATH

使用 X2Go 客户端登录 ubuntu 终端时如何添加/编辑 PATH

我是菜鸟。我想在我的账户下将一个文件夹添加到 PATH。尝试搜索答案很长一段时间。最终获得诸如在我的 home 目录 (~) 下创建 .profile .bash_profile 之类的方法,并在其中添加一行包含新路径信息。到目前为止没有任何效果。我正在 Windows 桌面上使用 X2Go 客户端登录 ubuntu 服务器的终端。不确定此过程是否不评估“.profile”或“.bash_profile”?我获得的 PATH 始终是在 /etc/environment 中定义的(我无法修改)。如果是这种情况,我如何在某个地方添加我自己的 PATH,只有当我从 X2Go 登录时才可用?

非常感谢您的任何意见。

答案1

我必须查看 X2Go 的维基百科页面才能找到It provides secure remote sessions via ssh。因此,通过阅读man ssh在线 ssh 手册页)发现:

 Additionally, ssh reads ~/.ssh/environment, and adds lines of the format “VARNAME=value” to the environment if the file exists and users are allowed to
 change their environment.  For more information, see the PermitUserEnvironment option in sshd_config(5).

...

~/.ssh/environment
         Contains additional definitions for environment variables; see ENVIRONMENT, above.

相关内容