Compiling sudo version 1.8.6p7
Download path: https://www.sudo.ws/news.html
1. Cross-compiling
#Tar-xvfsudo-1.8.6p7.Tar. GZ # CDsudo-1.8.6p7/# mkdirbuild#./configure--prefix=/home/carrie/sudo/sudo-1.8.6p7/build/cc=aarch64-linux-gnu-GCCar=aarch64-linux-gnu-ar--host=aarch64-linux-gnu# Make& Make Install# lsbuild/#编译产生的文件bin include libexec sbin share
2. Copy files to arm board
Compiled a lot of files, in fact, the useful files only two sudo and sudoers.so, just need to copy the two files to the corresponding directory of ARM board is good
#CP sudo/usr/bin/sudo#CPsudoers.so/usr/local/libexec/sudoers.sosudoModify the permission settings: #chmod 622/usr/bin/sudo# chmodu+s/usr/bin/sudo # ls-al/usr/bin/sudo-rws--x--x1Root root519080Oct - the: the/usr/bin/sudo
Explanation: # # # U+s:setuid: This bit is a program or command that allows a normal user to run only the root account in the root user's role.
3. Create/etc/sudoers on ARM board
# vim/etc/sudoersallall'Defaults targetpw'
# # #这一步可以保证sudo可以被普通用户使用
Cross-compiling sudo