默认SSH到指定目录? [英] SSH into Specified Directory by Default?
本文介绍了默认SSH到指定目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
默认情况下,当SSH进入客户端时,我将自动放入/ home / marco /,但是我想要放入/ something / other中。我宁愿保留我的主目录,但我想自动路由到/ something / other /
By default, when SSH'ing into a client I am automatically placed into /home/marco/ but instead I would like to be placed into /something/other. I would prefer to keep my home directory where it is, but I would like to be automatically routed to /something/other/
这是可能吗?
*客户端运行Debian 5.04
*The client runs Debian 5.04
推荐答案
您可以将ssh中的命令传递给在登录的同时更改目录:
You can pass the command in the ssh to change the directory at the same time you login:
ssh -t localhost "cd /tmp ; bash"
您可能会在别名后得到您想要的内容:
You might get what you want after an alias:
alias ssh-tmp='ssh -t localhost "cd /tmp ; bash"'
所以命令'ssh-tmp'将直接放在tmp目录中。
So command 'ssh-tmp' will put you directly in the tmp directory.
这篇关于默认SSH到指定目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文