夜桜 发表于 2019-2-9 23:54:55

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

本帖最后由 夜桜 于 2019-2-11 00:21 编辑

我是萌新QAQ

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

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

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

zrj766 发表于 2019-2-10 13:43:26

你好萌新,我是大佬,我还在研究Debian1.0,已经10了吗?那我还是继续回去用centos1.0吧。

tony601818 发表于 2019-2-10 02:51:10

可能Debian 10 不稳定吧

夜桜 发表于 2019-2-10 01:08:04

竟然没人知道 哭了

winwin50 发表于 2019-2-10 02:34:13

你该贴的东西贴上来啊,光说有问题有什么用
sweat.gif

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

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

shiro 发表于 2019-2-10 02:44:57

journalctl -u sshd 瞅瞅

shiro 发表于 2019-2-10 02:46:43

https://bbs.archlinux.org/viewtopic.php?id=241346 和你一毛一样

夜桜 发表于 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: Starting OpenBSD Secure Shell server...
Feb 09 22:52:15 debian sshd: Server listening on 0.0.0.0 port 22.
Feb 09 22:52:15 debian sshd: Server listening on :: port 22.
Feb 09 22:52:15 debian systemd: Started OpenBSD Secure Shell server.
Feb 09 22:52:35 debian sshd: Accepted password for root from (擦去ip) port 7096 ssh2
Feb 09 22:52:35 debian sshd: pam_unix(sshd:session): session opened for user root by (uid=0)
Feb 10 05:43:59 debian sshd: Accepted password for root from (擦去ip) port 6623 ssh2
Feb 10 05:43:59 debian sshd: 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 --

夜桜 发表于 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



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


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


WantedBy=multi-user.target
Alias=sshd.service
页: [1] 2
查看完整版本: 求Debian大佬解决一个 Debian 10 sshd的问题 tty1不登入无法连接ssh