安全也挺让人心烦的 ---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算法技巧总结(二):双指针和滑动窗口技巧
我把双指针技巧再分为两类,一类是「快慢指针」,一类是「左右指针」.前者解决主要解决链表中的问题,比如典型的判定链表中是否包含环:后者主要解决数组(或者字符串)中的问题,比如二分查找. 一.快慢指针的常 ...
随机推荐
- Hash算法简介
Hash算法性质 Hash算法用于计算消息摘要(Message Digest),可以将任意长的输入信息快速地转换为固定长度的输出.在区块链中主要利用了Hash算法的三种性质: 抗冲突性(Collisi ...
- spring boot:使用多个线程池实现实现任务的线程池隔离(spring boot 2.3.2)
一,为什么要使用多个线程池? 使用多个线程池,把相同的任务放到同一个线程池中,可以起到隔离的作用,避免有线程出错时影响到其他线程池,例如只有一个线程池时,有两种任务,下单,处理图片,如果线程池被处理图 ...
- selenium-无窗口模式
引入options即可 from time import sleep from selenium import webdriver from selenium.webdriver.chrome.opt ...
- qemu-kvm安装and配置桥接和SR-IOV
kvm和docker的区别:kvm是全虚拟化,需要模拟各种硬件,docker是容器,共享宿主机的CPU,内存,swap等.本文安装的qemu-kvm属于kvm虚拟化,其中:kvm负责cpu虚拟化和内存 ...
- Microsoft.Extensions.DependencyInjection中的Transient依赖注入关系,使用不当会造成内存泄漏
Microsoft.Extensions.DependencyInjection中(下面简称DI)的Transient依赖注入关系,表示每次DI获取一个全新的注入对象.但是使用Transient依赖注 ...
- java应用启动报错Unable to access jarfile xxxxx.jar
当使用命令:javar -jar xxxx.jar 启动应用时,报错Unable to access jarfile xxxxx.jar,这种主要是 jar 的名称或者路径有问题:
- [阿里DIN]从论文源码学习 之 embedding_lookup
[阿里DIN]从论文源码学习 之 embedding_lookup 目录 [阿里DIN]从论文源码学习 之 embedding_lookup 0x00 摘要 0x01 DIN代码 1.1 Embedd ...
- MFiX中DEM颗粒信息随时间变化
之前在"DEM轨迹后处理"这篇文章中的第二种方法中介绍过一种方法,但是那种方法只适用于反应器内颗粒数量一定,没有新进入的颗粒的情况.后来在MFiX论坛询问了一下,解决了这个问题.具 ...
- 文件中pe到内存中pe
前言 学pe的时候被困扰了很久,终于在某处给我找到了,打算打出来读一读代码 这边我们是从文件中的pe转到运行中的pe,然后再缩小存储到文件的pe 这边我们需要知道内存中对齐是0x1000,文件对齐是0 ...
- Lucas(卢卡斯)定理模板&&例题解析([SHOI2015]超能粒子炮·改)
Lucas定理 先上结论: 当p为素数: \(\binom{ N }{M} \equiv \binom{ N/p }{M/p}*\binom{ N mod p }{M mod p} (mod p)\) ...