V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  fourstring  ›  全部回复第 13 页 / 共 18 页
回复总数  360
1 ... 5  6  7  8  9  10  11  12  13  14 ... 18  
2016-08-09 20:07:40 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@larsenlouis 另外由客户端生成密钥和服务端生成密钥都试过,均失败
2016-08-09 20:07:02 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@larsenlouis sshd_config:
# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 63842
# 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
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

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

# 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 no

# 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

ssh config :
Host hexo
HostName xxx
Port 63842
User git
IdentityFile ~/.ssh/hexo
2016-08-09 19:41:44 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@larsenlouis 没有啊- -都是 pts ?
2016-08-09 19:36:08 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@larsenlouis 对,安装 ubuntu 的时候确实会送这个。问题是我是 VPS 啊。。。 root 用 ssh 可以正常访问的。我都进不去服务器本地- -
2016-08-09 19:31:41 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@oxoxoxox 这个刚刚尝试了一下,貌似并没有什么用。。。/var/run/auth.log 里也没有报权限错误
2016-08-09 19:29:17 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@larsenlouis 密码可以登录。我用 adduser 命令添加的用户,应该不会自动加密吧? root 是可以正常访问 git 用户的$home 目录的
2016-08-09 19:16:40 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@crazycen 请问.ssh 目录不手动建立该如何建立呢?另外生成 key 的方式是不是运行 ssh-keygen 命令?
2016-08-09 19:16:06 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@wweir 我用的是 adduser 命令添加用户,自动建立了主目录,刚刚又去检查了一下,$HOME 的权限是正确的
2016-08-09 19:14:57 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@finian 实际上我没有改过配置,那个配置是默认就有的。我也尝试过重启 sshd ,没有效果。私钥是这个,没有出错。
2016-08-09 19:14:15 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@ipeony .ssh 目录下 config 文件是用 IdentifyFile 选项加载 privatekey 么?如果是的话我应该没有配置错。
另外和能正常登陆的 root 用户的-vvv 比较了一下,好像就只有 debug 信息的最后几行,正常的是
debug2: we sent a publickey packet, wait for reply
之后就收到 auth succeed 的回复然后进入 shell
2016-08-09 19:11:54 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@shenqi 您觉得是哪里描述不清楚呢?请指出
2016-08-09 19:11:36 +08:00
回复了 fourstring 创建的主题 Linux Ubuntu14.04 普通用户无法通过 sshkey 登陆
@sopato auth.log 没有任何错误……而且我还运行过 tail -f /var/run/auth.log ,在连接失败时该日志没有任何变化
@julyclyde 对,这个我知道。然而我在 php.ini 里配置了 default-socket 也无果
@kn007 可能原因是我开了 tincd ,怪不得最近这几天才挂……
@kn007 lo 是有的,这个我确认
@kn007 好了,非常感谢!
@extreme 对啊,我自己都觉得很奇怪。。。
另外有人跟我说他的 percona 也出过一次各种地方毫无错误但是就是连不上启动不了的错误……
@kn007
mysql> use mysql; select host,user from user ;
Database changed
+-----------+-----------+
| host | user |
+-----------+-----------+
| localhost | mysql.sys |
| localhost | root |
+-----------+-----------+
2 rows in set (0.00 sec)
@kn007 是的。。。重启并且执行了这个刷新权限的语句。。。然而 依然无解 http://ww3.sinaimg.cn/bmiddle/62e721e4gw1et02ek7u61j200k00k3y9.jpg
@kn007
mysql> USE mysql;GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';FLUSH PRIVILEGES;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
ERROR 1133 (42000): Can't find any matching row in the user table
Query OK, 0 rows affected (0.00 sec)

这是什么原因呢? user 表中没有符合条件的数据?
1 ... 5  6  7  8  9  10  11  12  13  14 ... 18  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1392 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms · UTC 17:42 · PVG 01:42 · LAX 10:42 · JFK 13:42
Developed with CodeLauncher
♥ Do have faith in what you're doing.