安全也挺让人心烦的 ---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算法技巧总结(二):双指针和滑动窗口技巧
我把双指针技巧再分为两类,一类是「快慢指针」,一类是「左右指针」.前者解决主要解决链表中的问题,比如典型的判定链表中是否包含环:后者主要解决数组(或者字符串)中的问题,比如二分查找. 一.快慢指针的常 ...
随机推荐
- (SpringBoot-Jpa)使用Idea数据库自动脚本Generate POJOS生成 Entity对象,
因:使用SpringBoot -jpa,需要手动配置Entity 但是如果你的表中有很多属性,或者有很多表怎么办?? 每个手动写? 还是用mybatis.写mapper??? 解决:使用idea自动工 ...
- BigInteger和BigDecimal
BigInteger BigInteger的作用是对整数做计算,一般的使用String类型初始化BigInteger,它除了封装了基本的加减乘除运算外还提供了signum(),abs()等函数,使用方 ...
- echo输出彩色文字
开启转义功能 echo -e表示开启转义功能,比如: 彩色文字语法 echo -e "\e[前景;背景;特效m""hello""\e[0m" ...
- 【暑假集训】HZOI2019 水站 多种解法
题目内容 已知有一个\(n\)层的水站: \(W_i\)表示未操作之前第\(i\)层的已有水量: \(L_i\)表示第\(i\)个水站能够维持或者储存的水的重量: 表示在第\(P_i\)层进行减压放水 ...
- swoft 使用协程 初试
控制器访问 /hi /** * @Swoft\Bean\Annotation\Mapping\Inject("UserService") * @var UserService */ ...
- 【机器学习 Azure Machine Learning】Azure Machine Learning 访问SQL Server 无法写入问题 (使用微软Python AML Core SDK)
问题情形 使用Python SDK在连接到数据库后,连接数据库获取数据成功,但是在Pandas中用 to_sql 反写会数据库时候报错.错误信息为:ProgrammingError: ('42000' ...
- MySQL数据库基础-3-SQL 基本概念
SQL 基本概念 约束:constraint,表中的数据要遵守的限制 主键:一个或多个字段的组合,填入的数据必须能在本表中唯一标识本行:必须提供数据,即NOT NULL,一个表只能有一个 惟一键:一个 ...
- app 自动化测试 - 多设备并发 -appium+pytest+ 多线程
1.appium+python 实现单设备的 app 自动化测试 启动 appium server,占用端口 4723 电脑与一个设备连接,通过 adb devices 获取已连接的设备 在 pyth ...
- Android 限制控件多次点击
有时候多次点击页面会连续弹出多个页面,这时候写一个方法控制一下就OK. private static long lastClickTime; public synchronized static b ...
- ASP.NET Core托管运行Quartz.NET作业调度详解
Quartz.NET这么NB的作业调度系统,不会还行? 今天介绍一下Quartz.NET的托管运行,官网传送门. 一.前言 Quartz.NET,按官网上的说法,是一款功能齐全的任务调度系统,从小 ...