Linux 板


LINE

有一阵子没有登入实验室主机(Ubuntu), 今天使用terminal登入时, 发现无法登入. 尝试登入太多次後, 有时会出现 ssh: connect to host XX port 22: Connection timed out 有时会出现 ERROR: ssh: connect to host XX port 22: Connection refused 有时会出现 Permission denied (publickey,password). 我知道登入太多次会直接被ban, 然後Connection refused, 要隔一段时间才能尝试登入. 查过(publickey,password)的问题, 有可能没有验证成功, 所以也试了ssh-copy-id. 发现应该是被网管(学弟)改了帐号权限. 问了学弟, 他说他不懂Ubuntu, 只是被叫来做网管, 如果有被他改到什麽地方, 他不知道也不清楚. 他说也没有root密码, su -他没用过, 他只会用sudo xxx这样. 我试着用scp, 结果可以登入, 改用winscp, 也可以登入, 但是就是不能使用terminal模式登入. 请问Ubuntu突然变成scp可以登入但ssh不能登入, 是甚麽地方被改到了? --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 223.137.160.192 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Linux/M.1614588577.A.A37.html ※ 编辑: ruthertw (223.137.160.192 台湾), 03/01/2021 16:54:24
1F:→ holishing: 你学弟知道怎麽查 log 吗? 知道怎麽从 03/01 17:01
2F:→ holishing: /etc/ssh/sshd_config 检查修改设定吗? 03/01 17:01
刚刚我拉出sshd_config # $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm 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 prohibit-password #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 #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 看起来被有心人士加了很多# 学弟说他可以用terminal连接主机. 但是他好像也不能使用sudo xxx了 ※ 编辑: ruthertw (223.137.160.192 台湾), 03/01/2021 17:10:49
3F:→ holishing: 那个一堆 # 通常是系统内建给你参考的 template..... 03/01 17:12
4F:→ holishing: sudo -i 进不去 root shell? 03/01 17:13
5F:→ MOONY135: https://reurl.cc/4yjVp3 感觉是这篇的反过来 03/01 17:41
6F:→ MOONY135: ssh -vvv username@host 可以看log 03/01 17:43
7F:→ CMJ0121: 该不会 login shell 被拔了吧? 03/01 20:08
8F:推 tomsawyer: # 是系统内建给你的设定档 预设关闭的那种 03/01 20:40
9F:→ tomsawyer: 有可能是login shell 至於sudo是sudo group被拔吧 03/01 20:40
10F:推 Hurricaneger: 把那个帐号的硬碟空间砍掉一些垃圾就可以了! 03/01 22:50
11F:推 ucrxzero: 把PermitRootLogin 开起来重新service ssh restart看看 03/04 20:01







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:BuyTogether站内搜寻

TOP