ssh没有正确扩展〜?

时间:2014-09-16 12:07:09

标签: ssh

因此,出于许可原因,我必须将我的默认主目录更改为非标准位置。

我做了export HOME=/non/standard/home,然后确认这与

一起使用
$ cd ~
$ pwd
/non/standard/home

尽管man ssh表示它在~/.ssh中查找了密钥和身份文件,但它似乎并不是:

$ ls ~/.ssh
cluster_key  cluster_key.pub  config
$ ssh host
Could not create directory '/home/myname/.ssh'.
The authenticity of host 'host (<ip address deleted>)' can't be established.
RSA key fingerprint is <finerprint deleted>.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/myname/.ssh/known_hosts).
Permission denied (publickey,gssapi-with-mic).

它坚持要查看/home/myname是什么?查询HOME环境变量的手册页状态。使用-F选项也无法正常工作。

$ ssh -version
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
Bad escape character 'rsion'.

1 个答案:

答案 0 :(得分:0)

当您运行“export”命令时,实际上只会影响您的BASH / SH进程。当.ssh查找它时,它拥有自己的实例,因此查找默认目录。您需要运行命令usermod -m -d /path/to/new/home/dir userNameHere(更改.ssh使用的用户,可能是管理员)