因此,出于许可原因,我必须将我的默认主目录更改为非标准位置。
我做了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'.
答案 0 :(得分:0)
当您运行“export”命令时,实际上只会影响您的BASH / SH进程。当.ssh查找它时,它拥有自己的实例,因此查找默认目录。您需要运行命令usermod -m -d /path/to/new/home/dir userNameHere
(更改.ssh使用的用户,可能是管理员)