当前位置:网站首页>Busybox login: can't execute'/bin/bash': no such file or directory solution
Busybox login: can't execute'/bin/bash': no such file or directory solution
2022-07-27 16:02:00 【xhoufei2010】
1. Problem description
Embedded development board , Start up and execute login, When logging in , Pop up the prompt
login: can’t execute ‘/bin/bash’: No such file or directory
2. Problem analysis
busybox Support ash、hush、msh Three shell, But not supported bash
3. Modification method
3.1 Method 1、 modify login Source code , Change it to sh perform
In this paper, the busybox Version is busybox-1.22.1
The source path is busybox-1.22.1/loginutils/login.c
perform login Action in int login_main(int argc UNUSED_PARAM, char **argv) Function , Source code is as follows
/* Exec login shell with no additional parameters */
run_shell(pw->pw_shell, 1, NULL, NULL);
/* return EXIT_FAILURE; - not reached */among
run_shell(pw->pw_shell, 1, NULL, NULL);pw->pw_shell For the actual shell command , The content is “/bin/bash”, therefore login, use /bin/bash How to execute .
Modification method , take /bin/bash It is amended as follows /bin/sh, The modified code is as follows
/* Exec login shell with no additional parameters */
//run_shell(pw->pw_shell, 1, NULL, NULL);
// modified by houfei, use the "/bin/sh" exec login, default "pw->pw_shell" is "/bin/bash"
run_shell("/bin/sh", 1, NULL, NULL);
/* return EXIT_FAILURE; - not reached */
3.2 Method 2 modify rcS file
modify etc/init.d/rcS Of documents shell The parser is sh Or others .
边栏推荐
- [sword finger offer] interview question 42: the maximum sum of continuous subarrays -- with 0x80000000 and int_ MIN
- 低代码是开发的未来吗?浅谈低代码平台
- 可载100人!马斯克发布史上最强“星际飞船” !最早明年上火星!
- vant-ui toast和dialog使用
- [sword finger offer] interview question 46: translating numbers into strings - dynamic programming
- Mlx90640 infrared thermal imager temperature sensor module development notes (VII)
- : 0xC0000005: 写入位置 0x01458000 时发生访问冲突----待解
- Causes and solutions of deadlock in threads
- 减小程序rom ram,gcc -ffunction-sections -fdata-sections -Wl,–gc-sections 参数详解
- 渗透测试-干货 | 80篇+网络安全面试经验帖(面试篇)
猜你喜欢

IP protocol of network layer

Is the array name the address of the first element?

Single machine high concurrency model design

Spark troubleshooting finishing

网络原理(2)——网络开发

Openwrt adds RTC (mcp7940 I2C bus) drive details

线程中死锁的成因及解决方案

juc包下常用工具类

/Dev/loop1 takes up 100% of the problem

Analysis of spark task scheduling exceptions
随机推荐
[regular expression] single character matching
网络层的IP协议
openwrt 编译驱动模块(在openwrt源代码外部任意位置编写代码,独立模块化编译.ko)
[sword finger offer] interview question 50: the first character that appears only once - hash table lookup
Flask连接mysql数据库已有表
一款功能强大的Web漏洞扫描和验证工具(Vulmap)
QT (VI) value and string conversion
Talk about ThreadLocal
synchronized和ReentrantLock的区别
Summary of network device hard core technology insider router (Part 2)
[sword finger offer] interview question 39: numbers that appear more than half of the time in the array
Half find
突发!海康/大华/商汤/旷视/依图/科大讯飞等28家中国实体被美列入黑名单
DRF学习笔记(一):数据序列化
Multimap case
这些题~~
Openwrt增加对 sd card 支持
C language: custom type
juc包下常用工具类
Using Lombok results in the absence of parent class attributes in the printed toString