Linux或者Mac OS生成一个key
ssh-keygen -t rsa
用scp上传到Mikrotik
scp -P端口 ~/.ssh/id_rsa.pub [email protected]:id_rsa.pub
在Mikrotik内导入key
[admin@MikroTik] > /user ssh-keys import public-key-file=id_rsa.pub user=admin
打印查看
[admin@MikroTik] > /user ssh-keys print
Flags: R - RSA, D - DSA
# USER BITS KEY-OWNER
0 R admin 2048 XXXXXXX
抓取主板第一个网卡mac地址
ipmitool raw 0x30 0x21 | tail -c 18 |sed 's/ /:/g'
抓取BMC网口mac地址
ipmitool raw 0x0c 0x02 0x01 0x05 0x00 0x00|tail -c18| sed 's/ /:/g'
or
ipmitool lan print | grep "MAC Address" |tail -c18
none
原文链接 :https://acidborg.wordpress.com/2010/12/30/how-to-connect-to-cisco-devices-via-serial-port-using-gnulinux/
原文标题:How To Connect To Cisco Devices Via Serial Port Using GNU/Linux
Filed under: Linux, SysAdmin — acidborg @ 10:17
Description: to connect your computer to a Cisco device via its console port, you usually need a RJ45 rolled cable. You can use a RJ-45 to DB-9 Female if your computer has a serial port.
RJ-45 to DB-9 Female
To communicate through the serial port with the Cisco device, you need Minicom, a terminal emulator software.
阅读剩余部分...
none
快速整理
#/user set 0 name=NEW-admin #将admin用户更名
/user set 0 password=密码
/user ssh-keys import public-key-file=id_rsa.pub user=admin
/ipv6 nd set [find] disabled=yes
/ip neighbor discovery-settings set discover-interface-list=none
/ip dns set servers=8.8.8.8
/ip ssh set strong-crypto=yes
/ip service disable telnet,ftp,api,api-ssl
/ip service
set www port=3000
set ssh port=3001
set api port=3003
set winbox port=3002
/ip firewall mangle add action=change-mss chain=postrouting new-mss=1420 passthrough=yes protocol=tcp tcp-flags=syn tcp-mss=!0-1420
#关闭ddns动态解析
/ip cloud set ddns-enabled=no update-time=no
/system clock set time-zone-name=Asia/Shanghai
/system identity set name=ROS-Name
#关闭ppp系列
/interface l2tp-server server set enabled=no
/interface pptp-server server set enabled=no
/interface sstp-server server set enabled=no
/interface ovpn-server server set enabled=no
修改用户密码
[admin@MikroTik]>/user #进入操作路径
[admin@MikroTik]/user>print #显示RouterOS用户
[admin@MikroTik]/user>set admin password=123456 #修改admin用户密码为123456
[admin@MikroTik] /user> / #返回根目录
在当前用户下修改密码
[admin@MikroTik]>password #修改本目录用户密码备份命令
阅读剩余部分...
wget http://download2.mikrotik.com/routeros/6.43.8/chr-6.43.8.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
mount -o loop,offset=33554944 chr.img /mnt && \
ADDRESS0=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \
GATEWAY0=`ip route list | grep default | cut -d' ' -f 3` && \
echo "/ip address add address=$ADDRESS0 interface=[/interface ethernet find where name=ether1]
/ip route add gateway=$GATEWAY0
" > /mnt/rw/autorun.scr && \
umount /mnt && \
echo u > /proc/sysrq-trigger && \
dd if=chr.img bs=1024 of=/dev/vda && \
reboot
https://download.mikrotik.com/routeros/7.1beta2/chr-7.1beta2.img.zip
修改/etc/default/grub
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto enforcing=0 vconsole.keymap=us rhgb quiet"
添加 enforcing=0 或者net.ifnames=0 biosdevname=0
GRUB_DISABLE_LINUX_UUID=true
存盘退出
echo "GRUB_DISABLE_LINUX_UUID=true" >> /etc/default/grub
sed -i 's#GRUB_CMDLINE_LINUX="#GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 #g' /etc/default/grub
grub2-mkconfig --output /boot/grub2/grub.cfg
none
背景
Mac系统语言设置的是英文,安装的Office语言默认也是英文。由于习惯了中文Office的使用,想把Office的语言设置成中文,
方法之一就是直接修改系统的默认语言设置,但并不希望直接修改系统语言,仅想修改Office软件的默认语言
实现
1获取App的Bundle Identifier
Bundle Identifier是应用软件的标识,以Microsoft Word为例,Terminal中输入命令:
mdls -name kMDItemCFBundleIdentifier /Applications/Microsoft\ Word.app
2得到结果:
kMDItemCFBundleIdentifier = "com.microsoft.Word"
3修改应用程序默认语言
该操作需要用到第一步查到的应用程序Bundle Identifier,本例中是com.microsoft.Word,Terminal中输入命令:
defaults write com.microsoft.Word AppleLanguages '("zh_CN")'
阅读剩余部分...
none