Tôi đã cố gắng để thiết lập một mật khẩu ít ssh b / w Ađể Bvà Bđể Alà tốt. Tạo khóa chung và khóa riêng bằng ssh-keygen -trsacả hai máy. Sử dụng các ssh-copy-idtiện ích để sao chép các công chìa khóa từ Ađể Bcũng như Bđể A.
Ssh không mật khẩu hoạt động từ Ađến Bnhưng nottừ Bđến A. Tôi đã kiểm tra các quyền của thư mục ~ / ssh / và dường như là bình thường.
A's .ssh quyền thư mục:
-rw------- 1 root root 13530 2011-07-26 23:00 known_hosts
-rw------- 1 root root 403 2011-07-27 00:35 id_rsa.pub
-rw------- 1 root root 1675 2011-07-27 00:35 id_rsa
-rw------- 1 root root 799 2011-07-27 00:37 authorized_keys
drwxrwx--- 70 root root 4096 2011-07-27 00:37 ..
drwx------ 2 root root 4096 2011-07-27 00:38 .
B's .ssh quyền thư mục:
-rw------- 1 root root 884 2011-07-07 13:15 known_hosts
-rw-r--r-- 1 root root 396 2011-07-27 00:15 id_rsa.pub
-rw------- 1 root root 1675 2011-07-27 00:15 id_rsa
-rw------- 1 root root 2545 2011-07-27 00:36 authorized_keys
drwxr-xr-x 8 root root 4096 2011-07-06 19:44 ..
drwx------ 2 root root 4096 2011-07-27 00:15 .
Alà một Ubuntu 10.04 (OpenSSH_5.3p1 Debian-3ubfox4, OpenSSL 0.9.8k 25/03/2009) Blà một máy debian (OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8g ngày 19 tháng 10 năm 2007)
Từ A:
#ssh B
hoạt động tốt
Từ B:
#ssh -vvv A
...
...
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /root/.ssh/identity ((nil))
debug2: key: /root/.ssh/id_rsa (0x7f1581f23a50)
debug2: key: /root/.ssh/id_dsa ((nil))
debug3: Wrote 64 bytes for a total of 1127
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,gssapi,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug3: no such identity: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug3: Wrote 368 bytes for a total of 1495
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /root/.ssh/id_dsa
debug3: no such identity: /root/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
root@192.168.122.1's password:
Điều đó có nghĩa là nó không xác thực bằng cách sử dụng tệp /root/id_rsa. Tôi chạy ssh-addlệnh trong cả hai máy là tốt.
Phần xác thực của /etc/ssh/sshd_configtệp là
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
Tôi đang cạn kiệt ý tưởng. Bất kỳ trợ giúp sẽ được đánh giá cao.
yes, nếu không, người dùng sẽ không được nhắc nhập mật khẩu.
PermitRootLogintrong/etc/ssh/sshd_configtrên A?