linux - SSh:拒绝连接到本地主机

标签 linux ubuntu hadoop ssh

我想在ubuntu上安装hadoop

我正在学习本教程:Running Hadoop on Ubuntu Linux

但是我在ssh localhost这一步遇到了问题

hduser@r:~$ ssh -vvv localhost -p 8047
OpenSSH_6.2p2 Ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 11 Feb 2013
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 8047.
debug1: connect to address 127.0.0.1 port 8047: Connection refused
ssh: connect to host localhost port 8047: Connection refused

hduser@r:~$ which ssh
/usr/bin/ssh
hduser@r:~$ which sshd
hduser@r:~$ 

这是我的/etc/ssh/sshd_config:

只添加了最后 5 行!

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# 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
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

AllowGroups hduser


# disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

在此先感谢(也感谢您没有投反对票 :D ))

编辑:

hduser@r:~$ r@r:~$ netstat -tulpn

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:17500           0.0.0.0:*               LISTEN      -               
udp        0      0 127.0.1.1:53            0.0.0.0:*                           -               
udp        0      0 0.0.0.0:68              0.0.0.0:*                           -               
udp        0      0 0.0.0.0:631             0.0.0.0:*                           -               
udp        0      0 0.0.0.0:17500           0.0.0.0:*                           -               
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           -               
udp        0      0 0.0.0.0:26575           0.0.0.0:*                           -               
udp        0      0 0.0.0.0:47235           0.0.0.0:*                           -               
-         

最佳答案

你需要安装openssh服务器

sudo apt-get install openssh-server

关于linux - SSh:拒绝连接到本地主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22254756/

相关文章:

apache-spark - 从一个配置单元读取所有表,然后使用 spark 写入另一个集群上的另一个配置单元

logging - 跨多个作业聚合 Hadoop 作业计数器

linux - Ambari 文件 View 构建失败

linux - 在 BASH 中,有没有办法准确找到所有接口(interface)的 IP 地址?并删除所有其他信息?

linux - Nano - 文件已被编辑 - 如何切换到打开的文件?

node.js - 在 Ubuntu 环境中在一天中的特定时间运行 Node 服务器?

hadoop - 如何以csv2格式从beeline hive下载数据?

python - 图像 "Black Ink Level"的横轴直方图

c - Linux libudev 测试应用程序未接收到 REMOVE 事件

laravel - Sqlsrv pdo 驱动程序扩展适用于修补程序,但不适用于 Web 应用程序