Ubuntu 22.04 ﻲﻓ ﺔﻨﻴﻌﻣ ﺬﻓﺎﻨﻣ ﻭﺃ USB ﻡﺎﻈﻧ ﻞﻴﻄﻌﺗ ﺔﻴﻔﻴﻛ


.Ubuntu ﻲﻓ ،ﺔﻨﻴﻌﻣ USB ﺬﻓﺎﻨﻣ ﻭﺃ ﻞﻣﺎﻜﻟﺍ ﻲﻋﺮﻔﻟﺍ ﻡﺎﻈﻨﻟﺍ ءﺍﻮﺳ ،USB ﻞﻴﻄﻌﺗ ﺔﻴﻔﻴﻛ ﻲﻤﻴﻠ

:ﻕﺮﻃ ﺙﻼﺛ ﺮﺒﻋ USB ﻞﻴﻄﻌﺗ ﺔﻴﻔﻴﻛ ﺎﻨﻫ ﻚﻟ ﺢﺿﻭﺄﺳ ،ﻯﺮﺧﻷﺍ Linux ﺔﻤﻈﻧﺃ ﻢﻈﻌﻣﻭ Ubuntu ﻞﻴﻐﺸ

  • ﻡﺎﻈﻧ ﻞﻴﻄﻌﺗ USB ﻞﻣﺎﻜﻟﺎﺑ ﻲﻋﺮﻔﻟﺍ
  • ﻦﻳﺰﺨﺗ ﺓﺪﺣﻭ ﻞﻴﻄﻌﺗ USB ﻂﻘﻓ - ﺹﺍﺮﻗﺃ ﻙﺮﺤﻤﻟ ﻝﻮﺻﻮﻟﺍ ﻞﻴﻄﻌﺘﺑ ﻢﻗ USB ﻂﻘﻓ ﻯﺮﺧﻷﺍ ﻦ
  • ﺬﻔﻨﻣ ﻞﻴﻄﻌﺗ USB ﺩﺪﺤﻣ

ﻯﺮﺧﻷﺍ Linux ﺔﻤﻈﻧﺃﻭ Ubuntu ﻲﻓ ﻲﻋﺮﻔﻟﺍ USB ﻡﺎﻈﻧ ﻞﻴﻄﻌﺗ :1 ﺭﺎﻴﺨﻟﺍ

.ﻦﺤﺸﻠﻟ ﺔﻗﺎﻃ ﻰﻠﻋ USB ﺬﻓﺎﻨﻣ ﻱﻮﺘﺤﺗ ﻻﻭ .ﺙﻮﺗﻮﻠﺒﻟﺍﻭ ﻊﺑﺎﺻﻷﺍ ﺕﺎﻤﺼﺑ ﺉﺭﺎﻗﻭ ﺐﻳﻮﻟﺍ ﺍﺮﻴﻣﺎﻛ

.BIOS ﺕﺍﺩﺍﺪﻋﺇ ﻲﻓ ﻪﻨﻳﻮﻜﺗ ﻰﻟﺇ ﻞﻘﺘﻧﺎﻓ ،ﺔﻗﺎﻄﻟﺍ ﺭﺯ ﻰﻠﻋ ﻂﻐﻀﻟﺎﺑ ﻪﻠﻴﻄﻌﺗ ﺪﻳﺮﺗ ﺖﻨﻛ ﺍﺫﺇ .

1. ﻡﺩﺎﺨﺑ ﻝﺎﺼﺗﻻﺎﺑ ﻢﻗ ،ﻻًﻭﺃ Ubuntu ﻰﻠﻋ ﻂﻐﺿﺍ ﻭﺃ ،ﻚﺑ ﺹﺎﺨﻟﺍ Ctrl+Alt+T<

sudo nano /etc/default/grub

ﻝﺍﺪﺒﺘﺳﺍ ﻚﻨﻜﻤﻳ ،ﺐﺘﻜﻤﻟﺍ ﺢﻄﺳ ﺭﺍﺪﺻﻹ ﺔﺒﺴﻨﻟﺎﺑ nano ـﺑ gedit

.ﻱﻮﻧﺎﻨﻟﺍ ﺹﻮﺼﻨﻟﺍ ﺭﺮﺤﻣ ﻦﻣ ﺝﻭﺮﺨﻠﻟ Ctrl+Xﻭ ،ﻆﻔﺤﻠﻟ Ctrl+S ﻰﻠﻋ ﻂﻐﺿﺍ ﻢﺛ

2. ﻦﻳﻮﻜﺗ ﺚﻳﺪﺤﺘﻟ ﺮﻣﻷﺍ ﻞﻴﻐﺸﺘﺑ ﻢﻗ ،ﻚﻟﺫ ﺪﻌﺑ grub:

sudo update-grub

ﻞﻴﻐﺸﺘﻟﺍ ﻡﺎﻈﻨﻟ ﺔﺒﺴﻨﻟﺎﺑ ﺮﻣﻷﺍ ﺍﺬﻫ ﻒﻠﺘﺨﻳ ﺪﻗ :ﺔﻈﺣﻼﻣ Linux ﺐﻠﻄﻟﺍ ﻢﻳﺪﻘﺘﻟ ﻚﺑ ﺹﺎﺨﻟﺍ

."ﺔﻣﺎﻌﻟﺍ ﺕﺍﺩﺍﺪﻋﻹﺍ" ﺐﻳﻮﺒﺘﻟﺍ ﺔﻣﻼﻋ ﻰﻟﺇ ﻝﺎﻘﺘﻧﻻﺍ ﻝﻼﺧ ﻦﻣ kernel ﺔﻤﻠﻌﻣ ﺔﻓﺎﺿﺇﻭ ﻲﻣﻮﺳﺮﻟﺍ

ﻂﻘﻓ USB ﻦﻳﺰﺨﺗ ﺯﺎﻬﺟ ﻞﻴﻄﻌﺗ :2 ﺭﺎﻴﺨﻟﺍ

.ﻞﻤﻌﺗ ﻯﺮﺧﻷﺍ ﺔﺠﻣﺪﻤﻟﺍ USB ﺓﺰﻬﺟﺃﻭ ﺱﻭﺎﻤﻟﺍﻭ ﺢﻴﺗﺎﻔﻤﻟﺍ ﺔﺣﻮﻟ ﻙﺮﺗﻭ ،ﻂﻘﻓ ﻯﺮﺧﻷﺍ USB ﻦﻳﺰﺨﺗ

1. ﺔﻴﻓﺮﻄﻟﺍ ﺓﺪﺣﻮﻟﺍ ﺢﺘﻓﺍ ،ﻻًﻭﺃ (Ctrl+Alt+T) ﻩﺮﻳﺮﺤﺗﻭ ﻦﻳﻮﻜﺘﻟﺍ ﻒﻠﻣ ءﺎﺸﻧﻹ ﺮﻣﻷﺍ

sudo nano /etc/modprobe.d/blacklist-usb-storage.conf

ﻝﺍﺪﺒﺘﺳﺍ ﺎﻀًﻳﺃ ﻚﻨﻜﻤﻳ nano ﻚﻳﺪﻟ ﻞﻀﻔﻤﻟﺍ ﺹﻮﺼﻨﻟﺍ ﺭﺮﺤﻤﺑ. ﻦﻴﻴﻟﺎﺘﻟﺍ

blacklist usb_storage
blacklist uas

.ﻱﻮﻧﺎﻨﻟﺍ ﺹﻮﺼﻨﻟﺍ ﺭﺮﺤﻣ ﻦﻣ ﺝﻭﺮﺨﻠﻟ Ctrl+X ﻰﻠﻋﻭ ،ﻆﻔﺤﻠﻟ Ctrl+S ﻰﻠﻋ ﻂﻐﺿﺍ ﻢﺛ

2. ﺚﻳﺪﺤﺘﻟ ﺮﻣﻷﺍ ﻞﻴﻐﺸﺘﺑ ﻢﻗ ،ﻚﻟﺫ ﺪﻌﺑ initramfs.

sudo update-initramfs -u

.USB ﻦﻳﺰﺨﺗ ﺓﺰﻬﺟﺃ ﻰﻟﺇ ﻝﻮﺻﻮﻠﻟ (uasusb_storage) kerne

ﺩﺪﺤﻣ USB ﺬﻔﻨﻣ ﻞﻴﻄﻌﺗ :3 ﺭﺎﻴﺨﻟﺍ

.ﺔﻠﺑﺎﻘﻤﻟﺍ USB ﺬﻓﺎﻨﻣ "ﻞﻴﻄﻌﺗ" ﻡﺪﺨﺘﺴﻤﻠﻟ ﻦﻜﻤﻳ ،usbguard ﺔﻣﺪﺧ ﻡﺍﺪﺨﺘﺳﺍ ﻭﺃ ﻢﺋﺍﺪﻟﺍ ﻖﻴﻠ

ﻚﻳﺪﻟ ﺩﺪﺤﻤﻟﺍ USB ﺬﻔﻨﻤﺑ ﺹﺎﺨﻟﺍ sys ﺯﺎﻬﺟ ﺪﻠﺠﻣ ﻒﺸﺘﻛﺍ :1 ﺓﻮﻄﺨﻟﺍ

.ﻻًﻭﺃ ﻚﺑ ﺹﺎﺨﻟﺍ USB ﺬﻔﻨﻤﻟ ﺺﺼﺨﻣ ﺎﻬﻨﻣ ﻱﺃ ﺔﻓﺮﻌﻣ ﻚﻴﻠﻋ ،ﺔﻴﻋﺮﻔﻟﺍ ﺕﺍﺪﻠﺠﻤﻟﺍ ﻦﻣ ﻪﺑ ﺱﺄﺑ ﻻ

1. ﺯﺎﻬﺟ ﻞﻴﺻﻮﺘﺑ ﻢﻗ ،ﻻًﻭﺃ USB (ﻝﻮﻤﺤﻤﻟﺍ ﺹﺍﺮﻗﻷﺍ ﻙﺮﺤﻣ ﻭﺃ ﺱﻭﺎﻤﻟﺍ ﻭﺃ ﺢﻴﺗﺎﻔﻤﻟﺍ ﺔ

2. ﺔﻴﻓﺮﻄﻟﺍ ﺓﺪﺣﻮﻟﺍ ﺢﺘﻓﺍ ﻢﺛ (Ctrl+Alt+T) ﺓﺰﻬﺟﺃ ﻊﻴﻤﺟ ﺩﺮﺴﻟ ﺮﻣﻷﺍ ﻞﻴﻐﺸﺘﺑ ﻢﻗﻭ

lsusb

.ﺔﺠﻟﺎﻌﻤﻟﺍ ﺎﻬﺗﺎﻓﺮﻌﻣ ﻰﻟﺇ ﺔﻓﺎﺿﻹﺎﺑ ﺔﻴﻋﺮﻔﻟﺍ ﺕﺍﺪﻠﺠﻤﻟﺍ ﺩﺮﺴﻟ ﻩﺎﻧﺩﺃ ﻱﺩﺮﻔﻟﺍ ﺮﻣﻷﺍ

cd /sys/bus/usb/devices && for d in *; do if [ -f $d/idProduct ]; then prod=$( cat $d/idProduct ); vend=$( cat $d/idVendor ); echo Device: "${d}", ID: "${vend}:${prod}"; fi; done

.(... ،usb1، usb2 ،2-1 ،1-1 ،ﻝﺎﺜﻤﻟﺍ ﻞﻴﺒﺳ ﻰﻠﻋ) ﺯﺎﻬﺠﻟﺍ ﺕﺍﺪﻠﺠﻣ ءﺎﻤﺳﺃ ﺔﻓﺮﻌﻤﻟ ﻑﺮﻌﻤﻟ

ﺔﻴﻜﻠﺳﻼﻟﺍ ﺢﻴﺗﺎﻔﻤﻟﺍ ﺔﺣﻮﻠﺑ ﻞﺼﺘﻤﻟﺍ USB ﺬﻔﻨﻣ ﻮﻫﻭ ،3151:3020 ـﻟ ﺺﺼﺨﻣ "1-2" ﻲﻋ

USB ﺯﺎﻬﺠﻟ ﻲﺋﺎﻘﻠﺘﻟﺍ ﻖﻴﻠﻌﺘﻟﺍ (ﻱﺭﺎﻴﺘﺧﺍ) :2 ﺓﻮﻄﺨﻟﺍ

.USB ﻱﺬﻔﻨﻤﻟ (2-1ﻭ 1-1) ﺔﻠﺑﺎﻘﻤﻟﺍ ﺔﻴﻋﺮﻔﻟﺍ ﺕﺍﺪﻠﺠﻤﻟﺍ ﺖﻔﺸﺘﻛﺍ ،1 ﺓﺮﻴﺧﻷﺍ ﺓﻮﻄﺨﻟﺍ ﻲﻓ

.ﺎﻤًﺋﺍﺩ ﻪﻘﻴﻠﻌﺗ ﻢﺘﻴﺳ ﻚﻟﺬﻟ ،ﺔﻴﻧﺎﺛ ﻲﻠﻠﻣ 0 ﻰﻠﻋ ﺮﻴﺧﺄﺘﻟﺍ ﻂﺒﺿﻭ ،ﻝﺎﺜﻤﻟﺍ ﻞﻴﺒﺳ ﻰﻠﻋ 1-1

echo 0 | sudo tee /sys/bus/usb/devices/1-1/power/autosuspend_delay_ms
echo "auto" | sudo tee /sys/bus/usb/devices/1-1/power/control

.ﺕﺍﺩﺍﺪﻋﻹﺍ ﻊﻴﻤﺟ ﻂﺒﺿ ﺓﺩﺎﻋﺇ ﻊﻣ ﻦﻜﻟﻭ ،ﻯﺮﺧﺃ ﺓﺮﻣ ﺎﻴًﺋﺎﻘﻠﺗ ﺪﻠﺠﻤﻟﺍ ﺍﺬﻫ ءﺎﺸﻧﺇ ﻢﺘﻳ ،ﻯﺮﺧﺃ

.ﻲﻓﺎﺿﺇ ﻥﻮﻜﻣ ﻞﻛ ﻲﻓ ﺎﻴًﺋﺎﻘﻠﺗ ﻩﻼﻋﺃ ﻦﻳﺭﻮﻛﺬﻤﻟﺍ ﻦﻳﺮﻣﻷﺍ ﻞﻴﻐﺸﺗ ﻦﻣ ﻦﻜﻤﺘﺗ ﻢﻟ ﺎﻣ .ﺬﻔﻨﻤﻟﺎﺑ

USBGuard ﻡﺪﺨﺘﺳﺍ (ﻞﻀﻓﻷﺍ ﺭﺎﻴﺨﻟﺍ) :2 ﺓﻮﻄﺨﻟﺍ

.USB ـﻟ ﺔﻴﺳﺎﺳﻷﺍ ءﺍﺩﻮﺴﻟﺍ ﺔﻤﺋﺎﻘﻟﺍﻭ ءﺎﻀﻴﺒﻟﺍ ﺔﻤﺋﺎﻘﻟﺍ ﺕﺎﻧﺎﻜﻣﺇ ﺬﻴﻔﻨﺘﻟ ﺔﻴﻔﻠﺨﻟﺍ ﻲﻓ sys

:ﺔﻣﺰﺤﻟﺍ ﺖﻴﺒﺜﺘﻟ ﺮﻣﻷﺍ ﻞﻴﻐﺸﺘﺑ ﻢﻗﻭ ﺔﻴﻓﺮﻄﻟﺍ ﺓﺪﺣﻮﻟﺍ ﺢﺘﻓﺍ ،ﻻًﻭﺃ .1

sudo apt install usbguard

:ﺔﻣﺪﺨﻟﺍ ﻩﺬﻬﻟ ﻦﻳﻮﻜﺘﻟﺍ ﻒﻠﻣ ﺮﻳﺮﺤﺘﻟ ﺮﻣﻷﺍ ﻞﻴﻐﺸﺘﺑ ﻢﻗ ﻢﺛ .2

sudo nano /etc/usbguard/rules.conf

ﻝﺪﺒﺘﺳﺍ ،ﻡﻮﻨﺟ ﻰﻟﺇ ﺔﺒﺴﻨﻟﺎﺑ nano ـﺑ gedit (22.04 ﻡﺪﻗ

.ﺎﻫﺮﻳﺮﺤﺗ ﺪﻋﺃ ﻢﺛ ،ﺎﻴًﺋﺎﻘﻠﺗ ﺪﻋﺍﻮﻘﻟﺍ ءﺎﺸﻧﺈﺑ ﻪﻟ ﺡﺎﻤﺴﻠﻟ ﺔﻈﺤﻟ ﺮﻈﺘﻧﺍ .ﻒﻠﻤﻟﺍ ﻖﻠﻏﺄﻓ

!ﺕﺍﺮﻴﻴﻐﺘﻟﺍ ﺓﺩﺎﻌﺘﺳﺍ ﺔﻟﻮﻬﺴﺑ ﻚﻨﻜﻤﻳ ،ﻚﻟﺬﻟ .ﻲﺿﺍﺮﺘﻓﻻﺍ ﻯﻮﺘﺤﻤﻟﺍ ﻦﻣ ﺔﺨﺴﻧ ﻞﻤﻋ ﻞﻀﻓﻷﺍ ﻦﻣ ،

.ﺍﺬﻫ USB ﺬﻔﻨﻣ ﻞﻴﻄﻌﺘﻟ (ﻚﻟﺬﻟ ﺎﻘًﻓﻭ '1- "1" ﺮﻴﻴﻐﺘﺑ ﻢﻗ) "1-1" ﺬﻔﻨﻤﻟﺍ ﺮﺒﻋ ﺮﻈﺣ

.ﺔﻣﺪﺨﻟﺍ ﻞﻴﻐﺸﺗ ﺪﻋﺃ ،ﺍﺮًﻴﺧﺃﻭ .4

systemctl restart usbguard.service

.ﺔﻠﻴﻠﻗ ﺕﺎﻈﺤﻟ ﺪﻌﺑ ﺮﻴﻴﻐﺘﻟﺍ ﻖﻴﺒﻄﺗ ﻢﺘﻴﺳﻭ

:usbguard ﺖﻴﺒﺜﺗ ءﺎﻐﻟﺈﺑ ﻢﻗ ﻢﺛ ،ﺕﺎﻣﺪﺨﻟﺍ ﻑﺎﻘﻳﻹ ﺮﻣﺍﻭﻷﺍ ﻡﺪﺨﺘﺳﺍ ،ﺮﻴﻴﻐﺘﻟﺍ ﺍﺬﻫ ﻦﻋ ﻊﺟﺍﺮ

sudo systemctl disable --now usbguard.service
sudo systemctl stop usbguard-dbus.service
sudo systemctl mask usbguard-dbus.service
sudo apt remove --purge usbguard

:etc/ ﻞﻴﻟﺪﻟﺍ ﻦﻤﺿ ﺓﺩﻮﺟﻮﻤﻟﺍ ﻦﻳﻮﻜﺘﻟﺍ ﺕﺎﻔﻠﻣ ﺔﻟﺍﺯﺈﺑ ﻢﻗ ،ﺍﺮًﻴﺧﺃ

sudo rm -rf /etc/usbguard/


كل الحقوق محفوظة. © Linux-Terminal.com • 2023-2024