新创建的用户 .ssh 文件夹位于错误的位置

新创建的用户 .ssh 文件夹位于错误的位置

我正在尝试在我的 Media Temple (dv) 3.5 上创建具有与测试版帐户相同访问权限的新用户。这样做的原因是,我的开发团队可以使用 GitHub 进行源代码管理,而不会破坏权限等。

我可以弄清楚如何创建用户,但是当我尝试使用 连接到 GitHub 时出现错误。ssh -vT [email protected]

我创建的主目录位于/var/www/vhosts/beta.domain/web_users/username——当我登录时,cd ~它会把我放在正确的位置。

然而,当我尝试连接到 GitHub 时,它正在寻找而.ssh/不是/var/www/vhosts/beta.domain/.ssh/var/www/vhosts/beta.domain/web_users/username/.ssh

我使用此命令来创建用户:

useradd -d /var/www/vhosts/beta.domain/web_users/username -m -ou 10001 -g psacln -s /bin/bash username

我是否漏掉了某个步骤?我使用命令行的时间不长,这是我第一次与新用户打交道。任何帮助都将不胜感激。

提前致谢!

编辑

以下是我在 $HOME 中找到的内容:

[[email protected] ~]$ echo $HOME
/var/www/vhosts/beta.domain/web_users/username

这是的输出:ssh -vT [email protected]

OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [000.000.000.000] port 22.
debug1: Connection established.
Could not create directory '/var/www/vhosts/beta.domain/.ssh'.
debug1: identity file /var/www/vhosts/beta.domain/.ssh/identity type -1
debug1: identity file /var/www/vhosts/beta.domain/.ssh/id_rsa type -1
debug1: identity file /var/www/vhosts/beta.domain/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
The authenticity of host 'github.com (000.000.000.000)' can't be established.
RSA key fingerprint is aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/var/www/vhosts/beta.domain/.ssh/known_hosts).
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
Connection closed by 000.000.000.000

答案1

检查是否$HOME设置为/var/www/vhosts/beta.domain。如果是,找出它设置在哪里。

您可以下载源代码,构建它并在调试器下运行它。

相关内容