Ubuntu基础设置

ssh

1.检查是否启动

1
sudo ps -e |grep ssh

2.修改配置允许root登陆:

1
vim /etc/ssh/sshd_confg

找到:修改PermitRootLogin 为 PermitRootLogin yes

1
2
service ssh stop
service ssh start

固定IP

1
vim /etc/network/interfaces

添加如下信息

1
2
3
4
5
6
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.8.150
netmask 255.255.255.0
gateway 192.168.8.1

DNS

1
vim /etc/resolv.conf  && vim /etc/resolvconf/resolv.conf.d/base

写入相同的内容:

1
2
nameserver 192.168.8.1
nameserver 8.8.8.8

设置主机名

1
echo nginx.master >/etc/hostname

设置时区

1
2
tzselect
ntpdate time.windows.com