ubuntu学习(一)
修改计算机名:
1、修改 /etc/hostname 下的主机名;
2、修改 /etc/hosts 文件,替换原主机名,我替换的是 127.0.1.1 后的主机名
3、使用 hostname 进行测试
修改IP:
1、ubuntu系统修改IP地址:sudo vi /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.50
netmask 255.255.255.0
gateway 192.168.1.1
2、ubuntu系统修改DNS: sudo vi /etc/resolv.conf
search localdomain
nameserver 218.30.19.50
nameserver 61.134.1.4
3、使网络生效:sudo /etc/init.d/networking restart 或 service networking restart
sudo ifconfig eth0 192.168.1.50 netmask 255.255.255.0
sudo route add default gw 192.168.1.1 dev eth0
Ubuntu8.04虚拟机更换host主机后开机无法加载网卡,提示:No such device
删除缓存文件,重启后解决。
sudo rm /etc/udev/rules.d/70-persistent-net.rules
reboot
安装SSH
1、更新
sudo apt-get update
2、安装openssh-server
sudo apt-get install openssh-server
3、确认sshserver是否启动
ps -e | grep ssh
4、重启ssh服务
sudo /etc/init.d/ssh resart
5、配置文件
/etc/ssh/sshd_config
6、禁用sshd反查客户端的dns
注释掉配置文件中如下两行
#GSSAPIAuthentication yes
#GSSAPIDelegateCredentials no