Skip to content

Blog

RHEL9 Activation

Cannot Activate RHEL Server with Free Developer Subscription, it can be fixed by the following commands:

sudo subscription-manager remove --all
sudo subscription-manager unregister
sudo subscription-manager clean
sudo subscription-manager register
sudo subscription-manager refresh
sudo subscription-manager attach --auto

You should do the commands one by one.

[1].https://access.redhat.com/discussions/3312101

[2]. Reverse-Proxy-with-Nginx-on-RHEL

[3]. Reverse-Proxy-with-Caddy-on-RHEL

Introduction to Linux Firewall

sudo firewall-cmd --permanent --add-port=443/tcp

sudo firewall-cmd --permanent --remove-port=443/tcp

sudo firewall-cmd --permanent --add-service=http

sudo firewall-cmd --permanent --remove-service=http

sudo firewall-cmd --reload

[1]. https://goto-linux.com/zh-cn/2020/6/13/%E5%A6%82%E4%BD%95%E5%9C%A8rhel-8-/-centos-8%E4%B8%8A%E5%AE%89%E8%A3%85%E5%92%8C%E9%85%8D%E7%BD%AEsamba/

[2]. Install-Samba-on-RHEL-CentOS-Fedora

[3]. Notes-on-Podman-Network

[4]. SSH-Configuration

Modify file permissions in batches on Linux

During use, you often encounter the following situations: It is necessary to modify the folder permissions in a certain directory to: 0755, the owner is root, the file permissions are: 0644, the owner is root

1. Set the permissions of all folders in a directory individually```

Section titled “1. Set the permissions of all folders in a directory individually```”

find -type d -exec chmod 0755 {} ;

## 2. Set the permissions of all files in a directory individually```
find -not -type d -exec chmod 644 {} \;

3. If you want to set the owner of the folder individually, you only need to change the command to the following:

Section titled “3. If you want to set the owner of the folder individually, you only need to change the command to the following:”
find -type d -exec chown root.root {} \;
u :目录或者文件的当前的用户
g :目录或者文件的当前的群组
o :除了目录或者文件的当前用户或群组之外的用户或者群组
a :所有的用户及群组
```
  • Permission code: ``` r :读权限,用数字4表示 w :写权限,用数字2表示 x :执行权限,用数字1表示 – :删除权限,用数字0表示 s :特殊权限

Install FRP

The latest frp version at the time of publication of this article isv0.36.2. The server uses thex64architecture as an example, and the client uses thearmarchitecture as an example.## Config on Server### 1. Download FRPDownload the latest precompiled package for the corresponding platform from the [release] page of fatedier/frp. Download and unzip anywhere on the server``` wget https://github.com/fatedier/frp/releases/download/v0.36.2/frp_0.36.2_linux_amd64.tar.gz tar -zxvf frp*.tar.gz

### 2. Install FRPS```
cd frp*
mv frps /usr/bin/frps
mkdir /etc/frp
mv frps.ini /etc/frp/frps.ini

From Step2 to Step4 need ROOT authority, you need addsudobefore each command if NOT a ROOT user.

~~3a. Configuration of FRPS(before version 0.52.0)~~Edit the frp config filevim /etc/frps.iniand fill in the following format```

Section titled “~~3a. Configuration of FRPS(before version 0.52.0)~~Edit the frp config filevim /etc/frps.iniand fill in the following format```”

[common] bind_port = [your_port1] token = [your_token] vhost_http_port = [your_port2] bing_udp_port = [your_port3] vhost_https_port = [your_port4]

dashboard_port = [your_port5] dashboard_user = [User_name] dashboard_pwd = [your_Password]

>`bind_port`and`token`under`[common]`are required, the others are optional>
> In newer versions,`bind_port`,`vhost_http_port`,`vhost_https_port`can be set to the same port
### 3b. Configuration of FRPS(newer then 0.52.0)Edit the frp config file`vim /etc/frps.toml`and fill in the following format```
bindAddr = "0.0.0.0"
bindPort = [bind_port]
transport.tcpMux = true
transport.tls.force = false
vhostHTTPPort = [http_port]
vhostHTTPSPort = [https_port]
webServer.addr = "127.0.0.1"
webServer.port = [web_port]
webServer.user = "web_user_name"
webServer.password = "web_user_password"
auth.method = "token"
auth.token = "auth_token"

mv systemd/frps.service /etc/systemd/system/frps.service systemctl daemon-reload systemctl start frps systemctl enable frps

## Config on Client> The client installation method is exactly the same as the server installation method. The only difference is in the configuration file. Therefore, only the differences from the server installation are explained.### 1. Download FRP for Client```
wget https://github.com/fatedier/frp/releases/download/v0.34.0/frp_0.34.0_linux_arm.tar.gz

~~3a. Configuration of FRPC(before 0.52.0)~~Edit the frp config filevim /etc/frpc.iniand fill in the following format```

Section titled “~~3a. Configuration of FRPC(before 0.52.0)~~Edit the frp config filevim /etc/frpc.iniand fill in the following format```”

[common] server_addr = [your_ip] server_port = [your_port] token = [your_token]

[Service] type = [tcp,http,https…] local_ip = 127.0.0.1 local_port = [your_local_service_port] remote_port = [your_remote_service_port]

- `server_addr`Fill in the ipv4 address of FRPS- `server_port`is the port corresponding to`bind_port`of the server- `token`is the`token`corresponding to the server
### 3b. Configuration of FRPC(newer then 0.52.0)Edit the frp config file`vim /etc/frpc.toml`and fill in the following format```
user = "user_name"
serverAddr = "srv_ip"
serverPort = [srv_bind_port]
loginFailExit = false
auth.method = "token"
auth.token = "auth_token"
transport.dialServerTimeout = 10
transport.tcpMux = true
transport.protocol = "tcp"
transport.connectServerLocalIP = "0.0.0.0"
transport.tls.enable = false
[[proxies]]
name = "proxy_name"
type = "tcp/http/https..."
localIP = "127.0.0.1"
localPort = [local_port]

1. Set up domain name resolution on the domain name website- Resolve the A/AAAA record of a custom domain name to the public IP address of the FRP server

Section titled “1. Set up domain name resolution on the domain name website- Resolve the A/AAAA record of a custom domain name to the public IP address of the FRP server”

[SERVICE_NAME] type = http local_ip = 127.0.0.1 local_port = 0000 custom_domains = CUSTOM_DOMAIN.com

- CUSTOM_DOMAIN fill in the domain name set in the previous step## One More Thing> FRP one-click installation script> - linux platform, amd64 architecture> - Default service port`7000`,> - The dashboard username and password are both admin> - Token is random
> ! Onekey script only working for version 0.36.2### 1. Download the one-click installation script```
wget https://gitlab.dashdreams.com:8443/Haoran.Qi/RaspberryPi/-/raw/main/Shell/FRP_OneKey/install_frp.sh

2. Run the script./install_frp.sh> ROOT authority needed, addsudobefore each command if NOT a ROOT user.

Section titled “2. Run the script./install_frp.sh> ROOT authority needed, addsudobefore each command if NOT a ROOT user.”

[2]. Build-Git-Server-Using-Gogs-with-Docker-and-Employ-Frp-with-Caddy-Reverse-Proxy