adduser newbie gpasswd -a newbie sudo
su - newbie mkdir .ssh chmod 700 .ssh vi .ssh/authorized_keys # paste your key chmod 600 .ssh/authorized_keys
sudo vi /etc/ssh/sshd_config
Port 4917 # change ssh port(optinal)
AllowUsers newbie # restrict only newbie can login through ssh
sudo service ssh restart
sudo ufw allow {port}/tcp sudo ufw show added sudo ufw enable
txtred='\[\033[0;31m\]' # Red txtylw='\[\033[0;33m\]' # Yellow txtrst='\[\033[0m\]' # Text Reset PS1="\u@${txtylw}\h${txtrst}:${txtred}\w${txtrst}$ "
sudo vi /etc/hostname sudo service hostname start
- /etc/motd: The classic, static file. Does not exist anymore in Ubuntu 16.04 LTS, not even as a symbolic link to /var/run/motd. If it is created, however its contents will be printed too.
- /var/run/motd: This was used by Ubuntu’s first implementation. It is not used anymore. It is just ignored by PAM.
- /var/run/motd.dynamic: This is what is shown on login currently. It is updated by /etc/init.d/motd at every boot. It is also updated by PAM by running the scripts in /etc/update-motd.d/, if they exist.
- /etc/motd.tail: The Ubuntu package used to populate /etc/update-motd.d. One of them would cat the contents of this file so it was easy to add static content. That script does not exist in the package anymore, so the file does not have the intended effect.
主要修改以下两处文件
see this post
sudo apt-get update sudo apt-get install zsh curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh chsh -s /bin/zsh
cd .oh-my-zsh/custom/plugins git clone git@git.panezhang.cn:z-zsh.git
修改 .zshrc
/etc/docker/daemon.json
中加入 "iptables": false
,否则 ufw 的配置会失效。