惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
U
Unit 42
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
IT之家
IT之家
MyScale Blog
MyScale Blog
V
Visual Studio Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
I
InfoQ
博客园 - 司徒正美

herrkaefer

"Vibe planning \u003e vibe coding" "Anything to Markdown" "Built anocus: anonymous commenting for static sites" "日记与小说 -- AI 续写小说欣赏" "Any-podcast: from newsletters to a podcast" "Made MicPipe: a simple voice input tool using ChatGPT dictation" "关于 Tools 和 Skills 的一点感想" "Realtime monitoring of ComEd hourly price" "Introducing SwiftEdgeTTS" "Thoughts on the philosophy of building AI-native apps" "jelly鼻屎" "等饭的人" "Use home assistant to motivate my kid to brush teeth" "Migrated Blog to Hugo and Cloudflare Pages" "Easy Aspen monitoring for Chicago parents" "Introducing HabitBuilder: A simple Telegram bot for habit tracking" "鼓捣" "Open folder or file with Sublime Text from Finder toolbar" "Python dev workflow on macOS" "Create new text file from Finder toolbar" "Uno reinvented for 3-year-old kids" "Uno变身儿童数字游戏" "自动转发Twitter到微博" "Handle annoying operations of objects in Realm DB" "Move Jekyll blog to Ubuntu VPS" "Introducing Mole" "Note taking without note taking app" "Deploy Python web application on Ubuntu server" "Setup Shadowsocks / VPN on Ubuntu Server" "CLASS Style Adapted for Embedded Systems"
"Linode Notes - Basic Setup"
"herrkaefer" · 2016-10-05 · via herrkaefer

Buy a Linode plan

For location, Tokyo is not available now, and I choose Newark based on speed test (rather than Fremont).

Getting started

Ref: Getting Started with Linode

Deploy an image

  • At Linode manager, enter the dashboard of linode plan.

  • Select “Deploy an Image”. Choose Ubuntu Long Term Support (LTS) release, e.g. Ubuntu 16.04 LTS.

  • Set a password for root user (at least 6 characters long).

  • Click “Deploy” button.

  • When job finished, click “Boot” to power on.

Connect to the server

The IP address can be find in the “Remote Access” panel. Enter the password to log in.

Basic settings

Upgrade packages




sudo apt-get update && apt-get upgrade

Set hostname




echo "hostname" > /etc/hostname



# Set hostname from file



hostname -F /etc/hostname



# Verify hostname



hostname

Edit hosts file

and add a line:




[IP address] [Fully Qualified Domain Name (FQDN)] hostname

>The value you assign as your system’s FQDN should have an “A” record in DNS pointing to your Linode’s IPv4 address.

(Save and close file after editing with nano: CTRL-X, then Y, then ENTER.)

Set timezone:




dpkg-reconfigure tzdata



# Check time



date

Securing Your Server

Ref: Securing Your Server

Add a Limited User Account

Create user:

Add user to sudo group:




adduser example_user sudo

Switch to example_user:




exit



ssh example_user@[IP]

Authentication by SSH key pair

On local machine,

Press Enter three times to use default filenames and empty passphrase.

Two files id_rsa and id_rsa.pub are generated in /home/your_username/.ssh.

On Linode,




mkdir -p ~/.ssh && sudo chmod -R 700 ~/.ssh/

Upload public key to server:




scp ~/.ssh/id_rsa.pub example_user@[IP]:~/.ssh/authorized_keys

Exit and log into Linode again. No password is needed now.

Adjust SSH settings

Edit /etc/ssh/sshd_config




# Disable SSH password authentication



PasswordAuthentication no



# Disable PAM authentication



UsePAM no



# Disallow root logins over SSH



PermitRootLogin no

Apply new ssh configurations:




sudo systemctl restart sshd

Use Fail2Ban for SSH Login Protection




sudo apt-get install fail2ban

Remove Unused Network-Facing Services

To see your Linode’s running network services:




sudo netstat -tulpn

And remove unused services accordingly.

Enable the Firewall

Refs:

zsh

Ref: Getting oh-my-zsh to work in Ubuntu

Prereq:




sudo apt-get install zsh



sudo apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh




wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

and then you change your shell to zsh

and then reboot

Because the default theme does not show hostname, we may want to change a theme (zsh themes).

Edit ~/.zshrc file




ZSH_THEME="alanpeabody"

Cyberduck for File transfer

Use Cyberduck: Transfer Files with Cyberduck on Mac OS X

Install desktop

Ref: Install VNC on Ubuntu 16.04

Install full desktop:




sudo apt-get install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

Or, install desktop environments without full packages (no tools like office and browser, small size, however there exists coding problem for Chinese font):




sudo apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

During the install process, you will be asked whether or not to change a system file to the new version. Type y then enter to use the updated version.

Install VNC server:




sudo apt-get install vnc4server

Exit and reconnect with command:




ssh -L 5901:127.0.0.1:5901 user@[IP]

start vnc server (for first time, set a password after prompt):

Then connect with VNC viewer.

Ignore the “unencrypted connection” message. And a gray screen showed.

Close VNC server:

And edit ~/.vnc/xstartup file to add a few lines to the end:




gnome-panel &



gnome-settings-daemon &



metacity &



nautilus &

Start VNC server again and connect from client. Desktop should show.

In case that VNC viewer shows connection error: “Too many Security Failures”, restart the server:




vncserver -kill :1



vncserver :1

Install Chrome

How To Install Chrome Browser In Linux Or Ubuntu VPS

Troubleshooting

Perl locale warning

like this:




perl: warning: Setting locale failed.



perl: warning: Please check that your locale settings:



LANGUAGE = (unset),



LC_ALL = (unset),



LANG = "en_US.UTF-8"



are supported and installed on your system.



perl: warning: Falling back to the standard locale ("C").

Solution: comment out line from /etc/ssh/sshd_config:




AcceptEnv LANG LC_*

Ref: link