Ubuntu20.4 security settings and software installation and configuraion

  1. Common commands for ufw Firewall

  2. View process port occupancy information

  3. Exception handling

  4. Common command

  5. install a software

#1.Install ufw Firewall

sudo apt install ufw

#2.View the status of the ufw firewall

sudo ufw status

#3.Enable and activate the firewall

sudo ufw enable

#4.ufw Firewall allows a port to be open

sudo ufw allow 59019

#5.Allow an IP to access the local computer

sudo ufw allow from IP地址 

#6.Disable a port

sudo ufw deny

#7.Prohibit external access to smtp

sudo ufw deny smtp 

#8.Delete a rule that has been established.

sudo ufw delete allow smtp

#9.Turn off ufw Firewall

sudo ufw disable

#10.Restart the firewall

sudo ufw reload

View process port occupancy information

#1.View process information

ps -aux

#2.View the process according to PID

ps -aux | grep pid

#3.Process count, view specified process

ps -aux | wc -l
ps -aux | grep kworker

#4.View port occupancy information

netstat -an

#5.View specified port occupancy information

lsof -i :5353

#6.Find the process number to shut down

top

#7.Terminate the process with caution

Kill [signal code] process ID

#Sending a SIGKILL (9) forces the process to stop immediately and does not perform a cleanup operation.

kill -9 14354

#Terminate all processes you have.

kill -9 -1

#8.Kill all processes directly through the name of the program

killall Name of the running program
ps -ef | grep sendmail

killall -9 sendmail

Exception handling

#1.Image interface crashes 

ps -t tty7

kill -9 Pid

#2.Assume that the current program `talker` takes up a lot of time. Check pid

ps -ef | grep talker

top -Hp pid

sudo gstack pid

Common command

 #1.ps (process status)

#View all processes

ps -A     

#View all processes that contain other users

ps -aux

#Keyword to find a process, which is convenient for ending a specified process

ps -ef | grep <keywords>

#2.The ip route command displays the routing table

ip route

install a software

#1. go install

  1.  sudo wget https://golang.google.cn/dl/go.1.193.linux-amd64.tar.gz
  2. Remove any previous Go installation by deleting the /usr/local/go folder (if it exists), then extract the archive you just downloaded into /usr/local, creating a fresh Go tree in /usr/local/go:
    rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz
    

    (You may need to run the command as root or through sudo).

    Do not untar the archive into an existing /usr/local/go tree. This is known to produce broken Go installations.

  3. Add /usr/local/go/bin to the PATH environment variable.

    You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):

    export PATH=$PATH:/usr/local/go/bin
    

    Note: Changes made to a profile file may not apply until the next time you log into your computer. To apply the changes immediately, just run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.

  4. Verify that you've installed Go by opening a command prompt and typing the following command:
    go version
    
  5. Confirm that the command prints the installed version of Go.

#2.installing deb files with apt  (typora)

sudo apt install ./typora_amd64.deb

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值