AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 496805
Accepted
arcomber
arcomber
Asked: 2014-07-13 03:27:57 +0800 CST2014-07-13 03:27:57 +0800 CST 2014-07-13 03:27:57 +0800 CST

无法通过 ssh 登录到远程 Ubuntu 机器 - 连接被拒绝

  • 772

我有一个最近安装的 Ubuntu 盒子,我所做的唯一更改是将主机名更改为邮件和主机文件现在说:

127.0.0.1   localhost
127.0.1.1       mail

无论如何,如果我尝试通过 ssh 登录(这是来自 Windows 7 框),我会这样登录:

C:\Users\angus>ssh -vv [email protected]
OpenSSH_5.4p1, OpenSSL 1.0.0 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.52 [192.168.0.52] port 22.
debug1: connect to address 192.168.0.52 port 22: Connection refused
ssh: connect to host 192.168.0.52 port 22: Connection refused

所以不起作用。

我可以ping通主机。

这是我的 /var/log/auth.log 文件:

acomber@mail:~$ tail -f /var/log/auth.log
Jul 12 11:52:56 mail compiz: PAM unable to dlopen(pam_kwallet.so):  /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
Jul 12 11:52:56 mail compiz: PAM adding faulty module: pam_kwallet.so
Jul 12 11:52:56 mail compiz: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "acomber"
Jul 12 11:58:40 mail compiz: gkr-pam: unlocked login keyring
Jul 12 12:13:44 mail compiz: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
Jul 12 12:13:44 mail compiz: PAM adding faulty module: pam_kwallet.so
Jul 12 12:13:44 mail compiz: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "acomber"
Jul 12 12:14:04 mail compiz: gkr-pam: unlocked login keyring
Jul 12 12:17:01 mail CRON[3639]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 12 12:17:01 mail CRON[3639]: pam_unix(cron:session): session closed for user root

这是什么意思:pam_succeed_if(lightdm:auth):用户“acomber”未满足要求“user ingroup nopasswdlogin”

我必须在 ssh 登录时指定密码吗?

我是 Ubuntu 的新手,所以我认为这是非常基本的错误。

我应该从这里检查什么?

更新

感谢 saiarcot895 的提示。如果我尝试通过 ssh -vv acomber@localhost 在本地登录,我会得到:

acomber@mail:/etc/ssh$ ssh -vv acomber@localhost
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: connect to address 127.0.0.1 port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused

但我可以使用 Xterm 正常登录。所以我假设在本地主机上我可以正常连接。

这让我感到困惑,因为 /etc/ssh/ssh_config 是用于 ssh 客户端配置的?我认为这一定是 ssh 服务器配置中的问题?顺便说一下,我在哪里寻找 ssh 服务器配置?

更多信息

acomber@mail:/etc/ssh$ ps aux | grep ssh
acomber   2095  0.0  0.0  10616   316 ?        Ss   12:47   0:00 ssh-agent -s
acomber   2978  0.0  0.0  15948   916 pts/1    S+   13:08   0:00 grep --color=auto ssh


acomber@mail:/etc/ssh$ netstat -l | grep ssh
unix  2      [ ACC ]     STREAM     LISTENING     13527    /tmp/ssh-joANPbVpPNT3/agent.2094
unix  2      [ ACC ]     STREAM     LISTENING     14292    /run/user/1000/keyring-M9AniG/ssh

那么 XTerm 是如何工作的呢?我假设它必须连接到 ssh 服务器???

ssh
  • 1 1 个回答
  • 7281 Views

1 个回答

  • Voted
  1. Best Answer
    terdon
    2014-07-13T06:32:08+08:002014-07-13T06:32:08+08:00

    您似乎没有正在运行的ssh服务器。如果这是全新安装,则很可能没有安装。

    1. 安装ssh服务器。

      sudo apt-get install openssh-server
      
    2. 如果服务器已经安装,启动它:

      sudo service ssh start
      

    您现在应该能够正常登录。

    • 3

相关问题

  • Gnome-terminal 快捷方式在选项卡中打开多个 ssh 连接

  • 通过 SSH 禁用密码访问?

  • ssh 如何使用多个私钥?

  • 如何通过一个 SSH 连接拥有多个终端会话?

  • 如何与无头服务器进行图形交互?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve