找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 85|回复: 10

求Debian大佬解决一个 Debian 10 sshd的问题 tty1不登入无法连接ssh

[复制链接]

10

主题

19

回帖

76

积分

注册会员

积分
76
发表于 2019-2-9 23:54:55 | 显示全部楼层 |阅读模式
本帖最后由 夜桜 于 2019-2-11 00:21 编辑

我是萌新QAQ

我修改了一下Vicer的DebianNET.sh脚本(不然会出错),在阿里云轻量上安装了Debian 10
但是发现一个很奇怪的现象
每次重新启动之后,必须用阿里云后台的VNC连接,在登入tty1以后,才可以连接ssh
不然会提示连接被拒绝
就是每次要登入过tty1 哪怕登入了tty1再exit 也是可以连接的
就是重启后要登入过一次tty1才行

我检查过sshd_config和sshd.service也没发现什么问题
就很困扰

所以有大佬有相关的经验,或者知道问题的可能所在吗?
求教~TAT
回复

使用道具 举报

809

主题

9909

回帖

2万

积分

论坛元老

积分
22327
发表于 2019-2-10 13:43:26 | 显示全部楼层
你好萌新,我是大佬,我还在研究Debian1.0,已经10了吗?那我还是继续回去用centos1.0吧。
回复

使用道具 举报

22

主题

233

回帖

564

积分

高级会员

积分
564
发表于 2019-2-10 02:51:10 | 显示全部楼层
可能Debian 10 不稳定吧
回复

使用道具 举报

10

主题

19

回帖

76

积分

注册会员

积分
76
 楼主| 发表于 2019-2-10 01:08:04 | 显示全部楼层
竟然没人知道 哭了
回复

使用道具 举报

95

主题

957

回帖

2229

积分

金牌会员

积分
2229
发表于 2019-2-10 02:34:13 | 显示全部楼层
你该贴的东西贴上来啊,光说有问题有什么用

回复

使用道具 举报

62

主题

224

回帖

686

积分

高级会员

积分
686
发表于 2019-2-10 02:35:16 | 显示全部楼层
把那两个文件怼上来     
-----来自LOC手机客户端
回复

使用道具 举报

15

主题

693

回帖

1497

积分

金牌会员

积分
1497
发表于 2019-2-10 02:44:57 | 显示全部楼层
journalctl -u sshd 瞅瞅
回复

使用道具 举报

15

主题

693

回帖

1497

积分

金牌会员

积分
1497
发表于 2019-2-10 02:46:43 | 显示全部楼层
https://bbs.archlinux.org/viewtopic.php?id=241346 和你一毛一样
回复

使用道具 举报

10

主题

19

回帖

76

积分

注册会员

积分
76
 楼主| 发表于 2019-2-10 06:00:17 | 显示全部楼层
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2019-02-09 22:52:15 CST; 6h ago
     Docs: man:sshd(8)
           man:sshd_config(5)
Main PID: 372 (sshd)
    Tasks: 1 (limit: 2362)
   Memory: 3.5M
   CGroup: /system.slice/ssh.service
           └─372 /usr/sbin/sshd -D

Feb 09 22:51:08 debian systemd[1]: Starting OpenBSD Secure Shell server...
Feb 09 22:52:15 debian sshd[372]: Server listening on 0.0.0.0 port 22.
Feb 09 22:52:15 debian sshd[372]: Server listening on :: port 22.
Feb 09 22:52:15 debian systemd[1]: Started OpenBSD Secure Shell server.
Feb 09 22:52:35 debian sshd[389]: Accepted password for root from (擦去ip) port 7096 ssh2
Feb 09 22:52:35 debian sshd[389]: pam_unix(sshd:session): session opened for user root by (uid=0)
Feb 10 05:43:59 debian sshd[15850]: Accepted password for root from (擦去ip) port 6623 ssh2
Feb 10 05:43:59 debian sshd[15850]: pam_unix(sshd:session): session opened for user root by (uid=0)

-- Logs begin at Sat 2019-02-09 22:51:07 CST, end at Sun 2019-02-10 05:45:36 CST
-- No entries --
回复

使用道具 举报

10

主题

19

回帖

76

积分

注册会员

积分
76
 楼主| 发表于 2019-2-10 06:37:09 | 显示全部楼层

半世烟尘 发表于 2019-2-10 02:35

把那两个文件怼上来     -----来自LOC手机客户端

#        $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile        .ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no

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

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# 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

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation sandbox
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

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

# override default of no subsystems
Subsystem        sftp        /usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#        X11Forwarding no
#        AllowTcpForwarding no
#        PermitTTY no
#        ForceCommand cvs server

PermitRootLogin yes
Port 22
ClientAliveInterval 60
ClientAliveCountMax 3


[Unit]
Description=OpenBSD Secure Shell server
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target auditd.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStartPre=/usr/sbin/sshd -t
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/usr/sbin/sshd -t
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755

[Install]
WantedBy=multi-user.target
Alias=sshd.service
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2025-3-12 22:46 , Processed in 0.022018 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表