Udemy高分付費 2022 面向初學(xué)者的完整 Linux 管理訓(xùn)練營(Ubun

// terminal code:
code
// open a new terminal window
Ctrl + Alt + T
ls
who
whoami
ip add
.sa
ps
sudo apt update && sudo apt install terminator
ping -c 1 8.8.8.8
ping -c 1 127.0.0.1
ping -c 10 8.8.8.8
ls
ls -l -h -all
// storages
df
df -h
man
man ls
ifconfig
cat /etc/passwd
cat .bash_history
cat $HISTORYSIZE
history
sodu su
su
// add a new user: methon1
sudo useradd user1
// add to sudo user list: to use sudo cmd
adduser user1 sudo
// methon2 (recommended)
// add a new user & creat folder
adduser user2
// add to sudo user list: to use sudo cmd
adduser user2 sudo
// change password
sudo passwd root

// CPU information
cat /proc/cpuinfo
// Memory
cat /proc/meminfo
touch linux.txt
stat linux.txt
less /proc/meminfo
tail /proc/meminfo
// check last 2 line on a file
tail -n 2 /proc/meminfo
tar -czvf etc.tar.gz /etc/
apt install build-essential
gcc --version g++ --version
vim hello.c

gcc hello.c -o hello ./hello
apt install bind9 bind9utils bind9-doc systemctl status bind9
// setting a alias
alias c="clear"
echo $0
cat /etc/shells
// run shell script
./script.sh
// setting up a ssh connection
// whatever a diratory in your local client (windows11)?
// run cmd.exe:?
ssh-keygen?
// copy file to linux server?
// note: remove my folder: C:\Users\Administrator\.ssh>
C:\Users\Administrator\.ssh>scp windows11_id_rsa.pub root@xx.xxx.x.xx:~/.ssh?
// login your server with password this time
ssh root@xx.xxx.x.xx
// get into your server's .ssh folder
cd .ssh
//copy public key file to the configuration file of ssh
cat windows11_id_rsa.pub >> authorized_keys?
// login your server with private key?
ssh root@xx.xxx.x.xx -i "C:\Users\Administrator\.ssh\windows11_id_rsa"?
// note: use private key as password to login your server with public key?
// server use your public key to encrypt data, so you use private key open it.?
done?
one more thing:
// create a file: root.bat
// run it, login, without password and '-i "C:\Users\Administrator\.ssh\windows11_id_rsa" '
ssh root@xxx.xx.x.xx