
git config --global core.whitespace cr-at-eol cr-at-eol treats a carriage-return at the end of line as part of the line terminator, i.e. with it, trailing-space does not trigger if the character before such a carriage-return is not a whitespace (not enabled by default). 去掉git提交时出现很多^M提示符, git config --global core.filemode false git 提交时忽略文件权限,该值默认是true
1. 修改dropbear配置: cat /etc/config/dropbear config dropbear option PasswordAuth 'on' option RootPasswordAuth 'on' option Port '22' # option BannerFile '/etc/banner' 修改为: vim /etc/config/dropbear config dropbear option PasswordAuth 'on' option RootPasswordAuth 'on' option Port '22' option Interface 'wan' # option BannerFile '/etc/banner' 2. 使设置生效 /etc/init.d/dropbear restart 3. 关闭防火墙且禁止自启动 /etc/init.d/firewall stop /etc/init.d/firewall disable 关于firewall: /etc/init.d/firewall Syntax: /etc/init.d/firewall [command] Available commands: start Start the service stop Stop the service restart Restart the service reload Reload configuration files (or restart if that fails) enable Enable service autostart disable Disable service autostart 4. 免密码SCP传输文件 将电脑的id_rsa.pub拷贝到路由器/etc/dropbear目录下, cat id_rsa.pub >> authorized_keys chmod 600 authorized_keys 5. 重新启动路由器
ubuntu安装完后只有普通用户,没有超级root用户,虽然安全但很繁琐,建立root用户如下: passwd root dpkg-reconfigure tzdata 修改时区 Asia -> chongqing apt install openssh-server install vim 修改配置文件,允许以 root 用户通过 ssh 登录:vim /etc/ssh/sshd_config找到:PermitRootLogin prohibit-password ,前面加#号禁用添加:PermitRootLogin yes service ssh restart现在可以在win7下用SecureCRT以root通过ssh2登陆ubuntu虚拟机服务器了。 4.安装samba apt install samba samba-commonvim /etc/samba/smb.conf 修改如下:[homes] comment = Home Directories browseable = yes read only = no path = /root valid users = root 截图如下: 添加samba客户端用户:smbpasswd -a root重启ubuntu虚拟机在windows7下映射网络驱动器: \192.168.242.132root
我的总结如下: ubuntu直接安装在移动硬盘后,重启电脑仍然会直接进入windows7 ,不会进入ubuntu ,也没有任何启动选项。这个时候要用EasyBCD安装Grub启动管理器,加载ubuntu启动项。 安装并启动EasyBCD后,默认界面如下,默认已经有Windows7了。 加载ubuntu 启动项: (1)选中Add New Entry (2)选中Linux/BSD (3)Type选中GRUB 2 (4)Name可任意输入名称,一般输入OS的版本号, (5)Drive项要选择ubuntu挂载点/ ,即ubuntu本身启动项所在的驱动器。我的ubuntu bootloader安装在移动硬盘的39G这个分区,所以选择Partition 1(0xA2 - 39GiB) (6)点击Add Entry 选择Edit Boot Menu ,看到如下界面就正确了。 重启电脑验证无误 如果误操作EasyBCD可能会导致电脑的Grub破坏无法引导,成功后避免误操作请卸载掉EasyBCD 。