各位大佬萌新求助!!
自购 vultr,ip:1.2.3.4
有 namecheap 域名:abc.org
其中以有 A 类解析到 1.2.3.4,我自建的 bottle 服务是可以通过 http://abc.org:8080 访问的
但是我 ssh -p 22 [email protected] 没有反应
请问想通过 ssh [email protected] 的方式登录 VPS 请问大概需要怎么操作?
1
CitizenR 2018-10-15 17:13:40 +08:00 via iPhone 2
我觉得是不是服务器 ssh 服务禁止远程以 root 身份登陆,或者 ssh 服务换个端口。
|
2
MaxTan 2018-10-15 17:18:15 +08:00 1
改 host
|
3
boris1993 2018-10-15 17:18:32 +08:00 via Android 1
首先拿普通用户登录试试
其次永远不要允许 root 远程登录 |
4
abclearner 2018-10-15 17:19:35 +08:00 1
试下用 IP 地址登录 ssh [email protected]
或者 vultr 后台 console 看看什么情况 |
5
abclearner 2018-10-15 17:20:47 +08:00
上面打错了,ssh [email protected]
|
7
zeroze OP @abclearner ok 的可以进 shell
|
9
xmbaozi 2018-10-15 17:36:16 +08:00 1
ssh [email protected] -v
看看报什么错误 |
10
zeroze OP @MaxTan 好主意,但是我想知道为什么现在这个方法不行,我知道 ddns 比如蒲公英都是可以的,我这个 ip 是静态的应该没问题啊。
|
11
zeroze OP @xmbaozi
OpenSSH_7.7p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug1: Connecting to abc.org port 22. debug1: Connection established. debug1: identity file /Users/johndoe/.ssh/id_rsa type 0 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_ed25519-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_xmss type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/johndoe/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_7.7 |
12
zeroze OP ssh_exchange_identification: Connection closed by remote host
|
14
zeroze OP |
15
HannibaI 2018-10-15 22:28:39 +08:00 via iPhone 1
ssh 没开密码登录
|
16
victor97 2018-10-15 22:32:58 +08:00 via Android 1
检查下你 ssh client 的 config 文件,貌似是配置了密钥登录,但找不到密钥文件
|
17
victor97 2018-10-15 22:36:31 +08:00 via Android
或者试一试 ssh root:[email protected]
|
18
zeroze OP @victor97
感谢! 请问是 vps 上的 ssh_config 是吗,但是为啥不是改 sshd_config 呢? 是不是 法一:去掉这项的注释 PasswordAuthentication yes 通过密码登录 法二:ssh-keygen 生成一个 id_rsa,再通过本地通过 ssh -i id_ras.pub [email protected] 登录 VPS 附上 ssh_config Host * # ForwardAgent no # ForwardX11 no # ForwardX11Trusted yes # RhostsRSAAuthentication no # RSAAuthentication yes # PasswordAuthentication yes # HostbasedAuthentication no # GSSAPIAuthentication no # GSSAPIDelegateCredentials no # GSSAPIKeyExchange no # GSSAPITrustDNS no # BatchMode no # CheckHostIP yes # AddressFamily any # ConnectTimeout 0 # StrictHostKeyChecking ask # IdentityFile ~/.ssh/identity # IdentityFile ~/.ssh/id_rsa # IdentityFile ~/.ssh/id_dsa # IdentityFile ~/.ssh/id_ecdsa # IdentityFile ~/.ssh/id_ed25519 # Port 22 # Protocol 2 # Cipher 3des # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc # MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160 # EscapeChar ~ # Tunnel no # TunnelDevice any:any # PermitLocalCommand no # VisualHostKey no # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes |