Linux 常用命令,Root 賬戶密碼,允許遠程登錄,修改 Hostname,關閉防火牆

後臺守護運行

nohup java -jar -Xms512m -Xmx512m -Xmn128m -Dspring.config.location=./application.yml /usr/local/webapp/webapp-0.0.1-SNAPSHOT.jar >./start.log &

查看進程

ps -ef|grep name

查看日誌

tail -f log.out

設置 Root 賬戶密碼

sudo passwd root

設置允許遠程登錄 Root

vi /etc/ssh/sshd_config

# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password     //註釋此行
PermitRootLogin yes                             //加入此行
StrictModes yes

重啓服務
service ssh restart

修改 Hostname

# 使用 hostnamectl 命令修改,其中 tboss 爲新的主機名
hostnamectl set-hostname tboss

關閉交換空間

sudo swapoff -a

避免開機啓動交換空間:#註釋 /etc/fstab 中的 swap

關閉防火牆

ufw disable

編輯數據源

vi /etc/apt/sources.list
//刪除全部內容並修改爲
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

歡迎訪問個人主頁:唐悅瑋的博客

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章