修改 hostname
Here is an example for an older Ubuntu Release:
1 2 3 4 5 6
| auto lo eth0 iface lo inet loopback iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1
|
And here an example for Ubuntu 16.04 and newer:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
source /etc/network/interfaces.d/*
auto lo iface lo inet loopback
auto ens33 iface ens33 inet static address 192.168.1.100 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 dns-nameservers 8.8.8.8 8.8.4.4
|
Changing ubuntu server’s language to english
1
| sudo apt-get install language-pack-en language-pack-en-base manpages
|
1 2
| sudo update-locale LANG=en_US.UTF-8
|
build-essential
1
| apt-get install build-essential
|
or
1 2
| sudo apt-get install aptitude sudo aptitude install build-essential
|
switch between gdm,lightdm
http://www.webupd8.org/2011/07/how-to-switch-between-gdm-lightdm-or.html
1
| sudo dpkg-reconfigure lightdm
|
[How can I define startup applications with the Awesome Window Manager? - Ask Ubuntu](
https://askubuntu.com/questions/57264/how-can-i-define-startup-applications-with-the-awesome-window-manager)
Starting from a template
First you’ll need to copy the template rc.lua file into your home folder
1 2
| mkdir ~/.config/awesome cp /etc/xdg/awesome/rc.lua ~/.config/awesome/
|
Defining applications to start
Now using awesome - edit config copy the following code at the bottom of your new rc.lua file
1 2 3 4 5 6 7 8 9 10 11
| do local cmds = { "firefox", "xedit" }
for _,i in pairs(cmds) do awful.util.spawn(i) end end
|
In this example - firefox and xedit are run on startup.
An excellent wiki page describing this and much more can be found on ArchLinux
rootlogin
root 账号不能登录,提示 ssh permission denied 问题
1 2 3 4 5
| vi /etc/ssh/sshd_config
PermitRootLogin yes
service sshd restart
|
ubuntu 设置静态网络
- 修改 /etc/netplan/00-installer-config.yaml
1 2 3 4 5 6 7 8 9 10 11
| network: version: 2 ethernets: enp0s3: dhcp4: no addresses: [192.168.137.15/24] gateway4: 192.168.137.1 nameservers: addresses: [233.5.5.5, 233.6.6.6]
|
- 执行命令:
netplay apply
即可生效