安全也挺让人心烦的 ---login shell
今天查问题时, ssh 登录后台发现 需要输入密码,输入密码后弹出一个二维码, 然后扫码获取秘钥。输入秘钥登陆!!!
真是恶心了一把,找手机都花了不少时间!!!!
那么怎样干掉输入密码这些操作呢???
所以需要思考一番!!!!
man 文档中有 When bash is invoked as an interactive login shell, or as a non-inter‐ active shell with the --login option, it first reads and executes com‐mands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior. When a login shell exits, bash reads and executes commands from the files ~/.bash_logout and /etc/bash.bash_logout, if the files exists.When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of ~/.bashrc.
意思是啥呢??
也就是说登录后, 首先执行的是 /etc/profile; 然后执行各种 bash 啥;
root:x:0:0:root:/root:/bin/bash
在 passed 文件中, 最后一行有个 bash,此时表示的意思是,用户登录后,启动一个进程,但是负责将用户的操作传给内核,这个进程是用户登录到系统后运行的命令解释器或某个特定的程序,即Shell,
所以:
我们只需要看下 passwd 中的 /bin/bash 是不是被修改了, 然后创建 profile 并且执行bash
就可以绕过这些麻烦的校验;

也就是登陆后 会跑xxx.sh脚本
执行xxx.sh脚本过程中先执行 profile
然后执行 login_shell_cli ---这里面会要求各种校验。二维码审核啥的

所以直接 在profile 中添加sh/bash 执行, 进入 控制台------------------------------------------
安全也挺让人心烦的 ---login shell的更多相关文章
- How to install the zsh shell in Linux && how to set it as a default login shell
Z shell’s (zsh) popularity has increased in the last years. I have not moved too zsh yet, but I am g ...
- login shell 和 non-login shell 的区别
介绍之前先思考一个问题:有时我们通过su命令切换用户后,却发现并没有进入该用户的shell环境.这是为什么? login shell:取得bash时需要完整的登录流程.就是说通过输入账号和密码登录系统 ...
- Linux中环境变量到底写在哪个文件中?解析login shell 和 no-login shell
login shell:取得bash 时需要完整的登入流程,就称为login shell.举例来说,同tty1~tty6登入时, 需要输入用户名和密码,此时取得的bash就称为login shell ...
- login shell与non-login shell的区别
Bash应该是我们每天日常工作接触最多的东西了,就像我们最忠实的朋友,我们有必要了解一下这位朋友的“习性”. Bash有几种不同的运行模式,login shell与non-login shell,in ...
- login shell 和 non-login shell 的区别
login shell:去的bash时需要完整的登录流程.就是说通过输入账号和密码登录系统,此时取得的shell称为login shell non-login shell:取得sb ...
- [转载] login shell和non-login shell
原文地址:这里. 在linux中我们知道当你输入一条命令的时候,命令的查找是根据环境变量PATH来查找的,如果想知道一个命令的源文件存放在什么地方可以用which或whereis指令.那么PATH变量 ...
- login shell 和 non-login shell 的相关问题
问题:通过su命令切换用户并没有进入该用户的shell环境.这是为什么? 要解决这个问题,我们必须清楚用login shell 和non-login shell的区别. login sh ...
- socket服务器开发中的SO_REUSEADDR选项与让人心烦的TIME_WAIT
1 发现问题 我在开发一个socket服务器程序并反复调试的时候,发现了一个让人无比心烦的情况:每次kill掉该服务器进程并重新启动的时候,都会出现bind错误:error:98,Address al ...
- LC算法技巧总结(二):双指针和滑动窗口技巧
我把双指针技巧再分为两类,一类是「快慢指针」,一类是「左右指针」.前者解决主要解决链表中的问题,比如典型的判定链表中是否包含环:后者主要解决数组(或者字符串)中的问题,比如二分查找. 一.快慢指针的常 ...
随机推荐
- day08 Pyhton学习
一.昨日内容回顾 .1.基础部分的补充 join() 把列表变成字符串, 拼接 split() 切割 删除: 列表和字典不能在循环的时候进行删除. 把要删除的内容记录在一个新列表中,然后循环新列表, ...
- Python函数递归调用
函数的递归调用: 是函数嵌套调用的一种特殊形式 具体是指: 在调用一个函数的过程中又直接或间接地调用到了本身 # 直接调用本身 def func(): print('我是func') func() f ...
- JavaWeb中的域对象
域对象:可以在不同Servlet之间传递数据的对象,就是域对象,它们内置了map集合,都有setAttribute和getAttribute方法: Java Web有ServletContext.Se ...
- forword与redirect
1.从地址栏显示来说 forward是服务器请求资源,服务器直接访问目标地址的URL,把那个URL的响应内容读取过来,然后把这些内容再发给浏览器.浏览器根本不知道服务器发送的内容从哪里来的,所以它的地 ...
- eclipse 包与子包的视图显示方式切换
上图Package Presentation ---> Hierarchical(如下图显示父包与子包) 参考:https://zhidao.baidu.com/question/2205086 ...
- filezilla pureftpd 读取目录列表失败
放行 21, 39000 - 40000端口
- Vulkan Driver for VC4(Raspberry Pi 3b) base on mesa
这是一篇关于在raspberry Pi 3b上移植实现vulkan 驱动的文章. 经过一段时间的代码搬运,终于实现了零的突破,可以在树莓派3B上运行Vulkan triangle/texture.当然 ...
- android自带下拉刷新SwipeRefreshLayout
也是一个布局容器,只有一个子组件,类似scrollView <?xml version="1.0" encoding="utf-8"?> <a ...
- B. Kay and Snowflake 解析(思維、DFS、DP、重心)
Codeforce 685 B. Kay and Snowflake 解析(思維.DFS.DP.重心) 今天我們來看看CF685B 題目連結 題目 給你一棵樹,要求你求出每棵子樹的重心. 前言 完全不 ...
- F2. Same Sum Blocks (Hard) 解析(思維、前綴和、貪心)
Codeforce 1141 F2. Same Sum Blocks (Hard) 解析(思維.前綴和.貪心) 今天我們來看看CF1141F2(Hard) 題目連結 題目 給你一個數列\(a\),要你 ...