网络设置
查看网络是否好使:ifconfig
自动获取IP:sudo dhclient eth0
每次开机都自动获取IP:
sudo gedit /etc/network/interfaces
在该文件中用下面的行来替换有关eth0的行:
# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp
关闭NetworkManager:sudo /etc/init.d/network-manager stop
取消NetworkManager开机启动:chkconfig network-manager off
重启网络:/etc/init.d/networking restart
ssh
远程连接服务器
错误:Unable to negotiate with xxxxport 22: no matching host key type found. Their offer: ssh-rsa
修正方法:cd ~/.ssh && vi config,然后在config中写入以下
Host *
HostKeyAlgorithms +ssh-rsa
scp
- 往服务器传文件或文件夹:scp [-r] /local_path/local_file username@servername:/server_path ,其中servername可以是主机名,也可以是IP地址,"-r"用于文件夹
- 端口:默认为22,可用选项-P 端口号制定