Chrooting returns exec format error的合理解释

Knowledge Base:Chrooting returns exec format error

Synopsis

During the installation of Gentoo Linux, attempting to chroot into the new environment breaks with the following error:

root # chroot /mnt/gentoo /bin/bash
chroot: failed to run command `/bin/bash': Exec format error

Environment

This article applies to Gentoo Linux installations on an x86_64 platform (amd64 architecture).

Analysis

The error Exec format error means that the binary being executed is made for a different architecture than the environment currently booted. It usually occurs when the system has been booted on a 32-bit system when a 64-bit environment is trying to load.

Resolution

Reboot the live environment and choose the correct architecture (most LiveCDs support a 64-bit kernel as well as a 32-bit option, although it is not booted by default). Look for entries labeled gentoo64 or linux64 if trying to boot a 64-bit system.

https://wiki.gentoo.org/wiki/Knowledge_Base:Chrooting_returns_exec_format_error


原因就是架构不同,32位与64位架构差别 或者arm与x86架构差别

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS 7中的vsftpd(Very Secure FTP Daemon)是一个轻量级、安全的FTP服务器,用于在Linux系统上提供文件传输服务。虚拟用户配置是vsftpd的一个重要功能,它允许管理员为多个用户创建独立的FTP账户,而无需在系统中为每个用户设置单独的账户。 在CentOS 7中配置vsftpd虚拟用户,通常包括以下几个步骤: 1. **安装和启动vsftpd**: ``` sudo yum install vsftpd systemctl start vsftpd systemctl enable vsftpd ``` 2. **编辑vsftpd配置文件**: ``` sudo vi /etc/vsftpd/vsftpd.conf ``` 打开配置文件后,找到`anonymous_enable`行,将其设为`no`,以禁用匿名访问。 3. **启用虚拟用户模块**: 在配置文件中添加或修改以下行,启用虚拟用户支持: ``` virtual_use_local_privs=YES user_config_dir=/etc/vsftpd/user_conf ``` 还需创建`/etc/vsftpd/user_conf`目录并确保只有root有写权限。 4. **创建虚拟用户和设置权限**: 使用`sudo vsftpd_mkdb`命令初始化vsftpd数据库。然后,为每个虚拟用户创建一个名为`.ftpconfig`的文件,例如: ``` sudo tee /etc/vsftpd/user_conf/myuser.ftpconfig << EOF local_root=/home/myuser/public_html chroot_local_user=YES user_sub_token=YES pasv_enable=YES EOF ``` 这里设置了用户登录后的根目录,并启用了chrooting(限制用户只能在指定目录下操作)。 5. **配置vsftpd用户映射**: 如果需要,可以在`/etc/vsftpd.user_map`中定义用户映射规则。 6. **重启vsftpd服务**: ``` sudo systemctl restart vsftpd ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值