root@a1000:~# ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
SIOCSIFHWADDR: Device or resource busy - you may need to down the interface
root@a1000:~# ifconfig eth0 down
root@a1000:~# ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
root@a1000:~# ifconfig eth0 up
不过重启又没了 可通过配置文件 /etc/sysconfig/network-scripts/… 进行配置并 service network restart 有的板子没有这些服务或配置文件,可以搞个脚本或命令放到/etc/profile,不过每次起来IP都会变,所以把ip也一起配置了,必须up之后才能配置ip:
root@a1000:~# ifconfig eth0 down
root@a1000:~# ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
root@a1000:~# ifconfig eth0 up
root@a1000:~# ifconfig eth0 xx.xx.10.xx broadcast xx.xx.11.255 netmask 255.255.252.0
root@a1000:~#
#!/bin/sh
mkdir ~/.ssh/
cat > ~/.ssh/authorized_keys /etc/profile |