Linux快捷控制

Linux快捷控制

  • 工具安装
yum -y install lrzsz wget curl net-tools git
  • 防火墙
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
  • 宝塔
yum install -y wget && wget -O install.sh https://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec
  • 主机名称

hostnamectl set-hostname 192.168.1.94

  • 防火墙开放端口
## 开放端口8848 9848 9849
firewall-cmd --zone=public --add-port=8848/tcp --permanent
firewall-cmd --zone=public --add-port=9848/tcp --permanent
firewall-cmd --zone=public --add-port=9849/tcp --permanent

## 重启防火墙
firewall-cmd --reload

## 查看所有开启的端口
firewall-cmd --zone=public --list-ports

  • jdk 在线
wget -c https://repo.huaweicloud.com/java/jdk/8u151-b12/jdk-8u151-linux-x64.tar.gz
tar -zxvf ./jdk-8u151-linux-x64.tar.gz -C /usr/local/
rm -rf /usr/local/javaJDK
mv /usr/local/jdk1.8.0_151  /usr/local/javaJDK
rm -rf ./jdk-8u151-linux-x64.tar.gz
echo "JAVA_HOME=/usr/local/javaJDK
PATH=\$JAVA_HOME/bin:\$PATH
CLASSPATH=\$JAVA_HOME/jre/lib/ext:\$JAVA_HOME/lib/tools.jar
export PATH JAVA_HOME CLASSPATH" >> /etc/profile
source /etc/profile 
java -version 

你可能感兴趣的:(Linux,服务器)