非root免密码登录异常
2017-12-05 00:00
78 查看
跳板机: vmmelplinf01
远程机:melaitlned02
互信ID:aapp016
1, 在跳板机上使用aapp016登录,结果如下,需要密码
aapp016@vmmelplinf01:~> ssh melaitlned02
Password:
2,查看跳板机和远程机的 authorized_keys是否正确,由传了一次id_rsa.pub
aapp016@melaitlned02:~/.ssh> ll
total 8
-rw-r--r-- 1 root root 399 Dec 19 2016 authorized_keys
-r--r--r-- 1 root root 399 Dec 19 2016 id_rsa.pub
aapp016@melaitlned02:~/.ssh> pwd
/home/aapp016/.ssh
aapp016@melaitlned02:~/.ssh>
3,发现还是需要密码登录,偶然查看远程机的/var/log
4,查看该ID的组
melaitlned02:/sbin # id aapp016
uid=44016(aapp016) gid=55009(ops) groups=55009(ops),100(users)
5,查看配置文件/etc/ssh/sshd_config 中AllowGroups 参数中是否有加入aapp016的所属组,发现没有加进去,于是需要手动添加进去 ops 这个组
vim /etc/ssh/sshd_config
AllowGroups wheel svr_melaitlned02_access svr_melaitlned02_wheel root ops
DenyGroups login_disabled
AllowGroups wheel svr_melaitlned02_access svr_melaitlned02_wheel ops
DenyGroups login_disabled
6,重启sshd服务
/etc/init.d/sshd restart
再次测试, 成功登录
aapp016@vmmelplinf01:~> ssh melaitlned02
Last failed login: Mon Dec 4 17:01:13 AEDT 2017 from vmmelplinf01.aia.biz on ssh:notty
There were 16 failed login attempts since the last successful login.
****************************************************************************
Warning: These facilities are solely for the use of authorized employees or
agents of the Company, its subsidiaries and affiliates. Unauthorized use is
prohibited and subject to criminal and civil penalties. Individuals using this
computer system are subject to having all of their activities on this system
monitored and recorded by systems personnel.
****************************************************************************
aapp016@melaitlned02:~>
#面密码登录的本质是:跳板机上生成一个公钥传到远程机的./ssh/authorized_keys
远程机:melaitlned02
互信ID:aapp016
1, 在跳板机上使用aapp016登录,结果如下,需要密码
aapp016@vmmelplinf01:~> ssh melaitlned02
Password:
2,查看跳板机和远程机的 authorized_keys是否正确,由传了一次id_rsa.pub
aapp016@melaitlned02:~/.ssh> ll
total 8
-rw-r--r-- 1 root root 399 Dec 19 2016 authorized_keys
-r--r--r-- 1 root root 399 Dec 19 2016 id_rsa.pub
aapp016@melaitlned02:~/.ssh> pwd
/home/aapp016/.ssh
aapp016@melaitlned02:~/.ssh>
3,发现还是需要密码登录,偶然查看远程机的/var/log
4,查看该ID的组
melaitlned02:/sbin # id aapp016
uid=44016(aapp016) gid=55009(ops) groups=55009(ops),100(users)
5,查看配置文件/etc/ssh/sshd_config 中AllowGroups 参数中是否有加入aapp016的所属组,发现没有加进去,于是需要手动添加进去 ops 这个组
vim /etc/ssh/sshd_config
AllowGroups wheel svr_melaitlned02_access svr_melaitlned02_wheel root ops
DenyGroups login_disabled
AllowGroups wheel svr_melaitlned02_access svr_melaitlned02_wheel ops
DenyGroups login_disabled
6,重启sshd服务
/etc/init.d/sshd restart
再次测试, 成功登录
aapp016@vmmelplinf01:~> ssh melaitlned02
Last failed login: Mon Dec 4 17:01:13 AEDT 2017 from vmmelplinf01.aia.biz on ssh:notty
There were 16 failed login attempts since the last successful login.
****************************************************************************
Warning: These facilities are solely for the use of authorized employees or
agents of the Company, its subsidiaries and affiliates. Unauthorized use is
prohibited and subject to criminal and civil penalties. Individuals using this
computer system are subject to having all of their activities on this system
monitored and recorded by systems personnel.
****************************************************************************
aapp016@melaitlned02:~>
#面密码登录的本质是:跳板机上生成一个公钥传到远程机的./ssh/authorized_keys
相关文章推荐
- 两个非root用户之间的免密码登录
- 登录异常--ubuntu输入正确密码后不断重复返回登录页面 By Assassin
- 【登录异常解决】Ubuntu 输入正确的密码后重新返回到登陆界面
- 【登录异常解决】Ubuntu 输入正确的密码后重新返回到登陆界面
- ssh 无密码登录异常
- 非root用户下实现SSH免密码登录
- Ubuntu登录异常: 输入正确的密码, 但是却无法进入系统, 总是返回到登录界面, 但是用ctrl+alt+F1-F文字界面登录都可以进入。
- 【登录异常解决】Ubuntu 输入正确的密码后重新返回到登陆界面
- 编写一个登录功能,要求账户名只能由14至10位数字组成,密码只能有6位, 任何不符合账户和密码的要求的情况都视为异常,捕获异常并处理异常。
- 【登录异常解决】Ubuntu 输入正确的密码后重新返回到登陆界面
- hadoop-3.0.0-beta1运维手册(005):hdfs3.0.0分布式构建-hdfs配置、无密码登录
- mysql修改root密码、登录、导入导出等命令小记
- Linux上SSH登录远程服务器免密码
- Permission denied (publickey). SSH用户名密码登录报错
- 易宝典文章——如何设定OWA登录时只使用用户名加密码的方式
- Android 记住密码和自动登录界面的实现(SharedPreferences 的用法)
- 删除登录Lync后保存的密码凭证
- Zip包格式的MySQL的安装,启动,关闭和卸载和1067的错误,登录,修改初始密码
- chromium出现输入密码解锁登录密钥环
- 登录用户名和密码的验证