论坛风格切换切换到宽版
  • 1283阅读
  • 4回复

[问题求助]双网卡的SSH问题 [复制链接]

上一主题 下一主题
离线blesssj.
 
发帖
2064
C币
-60594
威望
382
贡献值
1
银元
0
铜钱
4611
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
一台主机作为局域网网关,装有双网卡,系统是RedHat9.0。eth0.为.内网地址,eth1为公网地址。在局域网内SS.H用内网地址或公司地址都可以登陆主机。但从公网上用SSH不能登陆主机。           建材
请问如何配置.SSH才能从公网上登陆主机?--- 印刷
谢谢!!
/etc/ssh/sshd_config配.置如下:.
#       $OpenBSD:. sshd_config,v 1.56 2002/06/.20 23:37:12 markus Exp $虚拟主机

# This is the. sshd server system-wide configuration. file.  See.
# sshd_conf..ig(5) for more information.学习

# This sshd was compiled. .with PATH=/usr/local/bin:/bin:/usr/bin外贸

# The. strategy used for opti.ons in the default sshd_config shipped with.
# OpenSSH i..s to specify options with their default value where--- 印刷
# possible, .but leave them c.ommented.  Uncommented options change a学习
# def.ault value.电脑

#Port 22
#Protocol 2,1
#.ListenAddress 0.0.0.0虚拟主机
#ListenAddress .::<性病>

# HostKey for p.r.otocol version 1.
#Host.Key /etc/s.sh/ssh_host_key.
# HostKeys fo.r proto.col version 2.
#HostKey ./etc/ssh/ssh_host_r.sa_key           女人
#HostKey /etc/ssh../ssh_host_dsa_key教育

# Lifetime and size of ephemeral .version 1 server ke.y            杀毒
#KeyRegenerationI.nterval 36.00教育
#S.erverKeyBits 768电脑

# Logging
#obsoletes QuietMode and Fasci.stL.ogging.
#SyslogFacil.ity AUTH.
SyslogF.acility AUTHPRIV              乙肝
#LogLevel INFO

# Authentica.tion:外贸

#Logi.nGraceTime 600.
#PermitRootLogin ye.s外贸
#Stri.ctModes yes.

#RSAAuthentication y.es    外汇
#PubkeyAuthentica.tion yes.
#AuthorizedKeysFile     .ssh/authori.zed._keys.

# rhos.ts auth.entication should not be used服务器
#Rho.stsAuthentication no[成人用品]
# Don't read the us.er's ~/.rh.osts and ~/.shosts files.
#Ig.noreRhosts yes          婚庆
# For this to work you will also. need host keys in /etc/ss.h/ssh_known_hosts虚拟主机
#Rhosts.RSAAuthenticat.ion no    外汇
# simil.ar for pro.tocol version 2[成人用品]
#HostbasedAuthe.ntication. no             汽车
# Change to yes if you don't trust .~/.ssh/known_ho.sts for          婚庆
# RhostsRSAAuthentication and .HostbasedAuthen.tication           鲜花
#.IgnoreUserKnownHosts no    健康

# To di.sable tunneled clear text passwor.ds, change to no here!虚拟主机
#Password.Authent.ication yes            杀毒
#PermitEmptyPasswords .no             电子

# Change t.o no. to disable s/key passwords.
#Challe.ngeResponseAuthenti.cation yes电脑

# Kerberos op.tions
#Ker.berosAuthenticat.ion no电脑
#KerberosOrLocalPasswd .ye.s教育
#Ker.berosT.icketCleanup yes.

#A.FSTokenPassing no.

# Ker.beros TGT Passing only works with the AFS kaserv.er.
#KerberosTgtPa.ssing no--- 印刷

# S.et this to 'yes' to enable PAM keyboard-interact.ive authentication.
# Warning: enabling this may bypass the. .setting of 'PasswordAuthentication'.
#PAMAuth.enticationViaKbdInt y.es           建材

#X11Forwarding. no--- 印刷
X11Forwardi.ng yes电影
#X1.1DisplayOffset 10(广告)
#X1.1UseLocalhost yes.
#PrintMotd yes
#PrintLastLo.g yes.
#KeepAlive yes
#UseLogin no
#.UsePrivilege.Separation yes--------------彩票
#Compressi.on yes.

#M.axStartups 10.
# no defa.ult banner path    健康
#Banner /some./path服务器
#.VerifyReverseMapping no(        游戏          )

# .override default .of no subsystems.
Subsystem       sftp    /usr/libexe.c/openssh/sftp-server.[成人用品]

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线vcdesign.
发帖
2016
C币
-60934
威望
345
贡献值
1
银元
-2
铜钱
4414
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
#ListenAddress 0.0.0.0
#ListenAddress ::
呵呵,是否明白了?
改成
ListenAddress 外网ip
ListenAddress 内网ip
service sshd restart

离线jingweb.
发帖
1957
C币
-152764
威望
349
贡献值
1
银元
-2
铜钱
4257
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-13
还是不行。
修改如下:
Port 22
#Protocol 2,1
ListenAddress 202.3.96.28
ListenAddress 192.168.1.254
SSH服务也重起了/etc/rc.d/init.d/sshd restart
谢谢!!

离线yahaba88.
发帖
2115
C币
-235507
威望
411
贡献值
1
银元
-2
铜钱
4751
人人网人气币
0
只看该作者 地板  发表于: 2010-04-13
你的防火牆對外開了嗎?

离线豆芽.
发帖
2088
C币
-235103
威望
411
贡献值
1
银元
-3
铜钱
4793
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-13


QUOTE:原帖由 "guilin" 发表:
一台主机作为局域网网关,装有双网卡,系统是RedHat9.0。eth0为内网地址,eth1为公网地址。在局域网内SSH用内网地址或公司地址都可以登陆主机。但从公网上用SSH不能登陆主机。
请问如何配置SSH才能从公网上登陆主机..........


注意 查看 防火墙设置
快速回复
限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
上一个 下一个