Ubuntu 18.04 Samba share เข้า terminal ภาษาไทยไม่แสดง
ตั้งตั้งค่า locales
1. คำสั่ง
- dpkg-reconfigure locales
2. เลือก
th_TH.UTF-8 UTF-8
Ubuntu 18.04 Samba share เข้า terminal ภาษาไทยไม่แสดง
ตั้งตั้งค่า locales
1. คำสั่ง
th_TH.UTF-8 UTF-8
ที่เครื่อง X1 ที่ต้องการเอาข้อมูล
1. แก้ไฟล์ sshd_config
PermitRootLogin yes
#PermitRootLogin prohibit-password
#StrictModes yes
systemctl restart sshd
ls -la /DATA/e-document/#2025#/001-099/SO25-001/
ให้รูปจาก Datacenter ดึงมาแสดงใน Intranet โดยการสร้าง symbolic-link
ใช้คำสั่ง
ln -s /ปลายทางของไฟล์ที่จะ link ไป/ /ที่อยู่ของ link/
Windows Server 2003 Active Directory (AD) ใช้กับ Ubuntu เพื่อ join
domain ได้ จำกัดอยู่ที่บางเวอร์ชันของ Ubuntu เท่านั้น เนื่องจาก Windows
Server 2003 ใช้ SMB1 และ LDAP แบบเก่า ซึ่งถูกเลิกสนับสนุนในเวอร์ชัน
Ubuntu ที่ใหม่กว่าเพื่อความปลอดภัย
Ubuntu เวอร์ชันที่ยังสามารถ join domain กับ Windows Server 2003 ได้ (โดยทั่วไป):
- Ubuntu 12.04 LTS
- Ubuntu 14.04 LTS
- Ubuntu 16.04 LTS (อาจต้องปรับแต่งเพิ่มเติม)
Ubuntu 18.04 ขึ้นไป เริ่มมีปัญหาเข้ากันไม่ได้โดยตรงกับ Windows Server 2003 AD เพราะ:
Ubuntu ใช้ Samba 4 ที่ตั้งค่าเริ่มต้นปิด SMB1
LDAP/NTLMv1 ถูกปิด ระบบความปลอดภัยและการเข้ารหัสมีการปรับให้รัดกุมขึ้น
ถ้าต้องใช้ Ubuntu ที่ใหม่กว่า:
ยังสามารถ พยายาม join domain ได้โดยการบังคับให้เปิด SMB1 และ NTLMv1 เช่น:
ปรับ smb.conf ให้รองรับ SMB1 (client min protocol = NT1)
แก้ krb5.conf และ nsswitch.conf ให้รองรับ Kerberos แบบเก่า
แต่ ไม่แนะนำอย่างยิ่ง ใน production เนื่องจากความเสี่ยงด้านความปลอดภัย
สรุป:
Ubuntu ที่แนะนำสุดท้ายสำหรับใช้งานร่วมกับ Windows Server 2003 AD คือ Ubuntu 16.04 LTS
เวอร์ชันใหม่กว่านั้นอาจทำงานไม่ได้เลยหรือทำได้แต่ต้องปรับแต่งเสี่ยง
|
Ubuntu คำสั่งหา File ที่ซ้ำกัน ข้อมูลซ้ำกัน ด้วยโปรแกรม fdupes https://itsfoss.com/find-duplicate-files-linux/ ติดตั้งโปรแกรมด้วยคำสั่ง
ใช้งาน
เช่น
หรือเข้าไปที่ Folder ที่ต้องการก่อน
เช่น |
Ubuntu คำสั่ง Scan ดูขนาดพื้นที่แต่ละ Folder ด้วยโปรแกรม ncdu
ติดตั้งโปรแกรม
Alfresco มีปัญหา Run CPU เยอะค้นหาไม่ได้ Error
แก้ปัญหาโดย
ใช้วิธีตั้ง
Crontab ให้ Restart service ตอน 8.40 น. แต่บางวันก็ต้อง Restart Manual
อีกรอบ เป็นทุกวันตอนเช้า หลังจาก Restart ไป
ก็ใช้งานได้ทั้งวันและจะเป็นอีกทีในตอนเช้าของวันต่อไป
Error ค้นหาไฟล์ไม่พบ
search failed due to system error: 0822154976 request failed 500 /solr/alfresco/alfresco?wt=json&fl=dbid%2cscore&rows=500&df=text&start=0&locale=en_us&fq=%7b%21afts%7dauthority_filter_from_json&fq=%7b%21afts%7dtenant_filter_from_json
ส่งผลให้ กิน CPU ที่ตัว Server Alfresco และตัว VMware
มี Process JAVA run CPU สูงผิดปกติ
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 3703 52.5 18.7 2161208 1533760 ? Sl Mar05 372:14 /DATA/alfresco/java/bin/java -Djava.util.logging.config.file=/DATA/alfresco/tomcat/conf/logging.properties -XX:MaxPermSize=512m -Xms128m -Xmx1024m -XX:-DisableExplicitGC -D
เดิมnano /DATA/alfresco/tomcat/scripts/ctl.sh
แก้ใหม่#export JAVA_OPTS="-XX:MaxPermSize=512m -Xms128m -Xmx1024m -XX:-DisableExplicitGC -Djava.awt.headless=true -Dalfresco.home=/DATA/alfresco -Dcom.sun.management.jmxremote -Dsun.security.ssl.allowUnsafeRenegotiation=true"
และexport JAVA_OPTS="-XX:MaxPermSize=1024m -Xms512m -Xmx2048m -XX:-DisableExplicitGC -Djava.awt.headless=true -Dalfresco.home=/DATA/alfresco -Dcom.sun.management.jmxremote -Dsun.security.ssl.allowUnsafeRenegotiation=true"
แก้ใหม่#export JAVA_OPTS="-XX:MaxPermSize=512m -Xms128m -Xmx1024m -XX:-DisableExplicitGC -Djava.awt.headless=true -Dalfresco.home=/DATA/alfresco -Dcom.sun.management.jmxremote -Dsun.security.ssl.allowUnsafeRenegotiation=true"
export JAVA_OPTS="-XX:MaxPermSize=1024m -Xms512m -Xmx2048m -XX:-DisableExplicitGC -Djava.awt.headless=true -Dalfresco.home=/DATA/alfresco -Dcom.sun.management.jmxremote -Dsun.security.ssl.allowUnsafeRenegotiation=true"
Ping Check Internet Switch Network Notification Line.
1. ใช้งานที่ เครื่อง VMware .2.99
1.1.ลากสายจาก Router wifi Fttx เข้า VMware
1.2.ตั้งค่า Virtual switches ชื่อ FttxWifi
1.3.ตั้งค่า Add port group ชื่อ FttxWifi
2. ติดตั้ง 22.04 add network 2 Adapter
- วง 2 DMZ
- และ FTTX รับ DHCP จาก FttxWifi
- update upgrade ตั้ง Time zone
set-timezone Asia/Bangkok
3. config ip
nano /etc/netplan/00-installer-config.yaml
network:
ethernets:
ens160: # Fix .2
dhcp4: false
addresses: [192.168.2.8/24]
nameservers:
addresses: [192.168.2.2,8.8.8.8]
routes:
- to: default
via: 192.168.2.2
ens192: # DHCP form fttx TOT.
dhcp4: true
version: 2
netplan apply
ifconfig
#Down DMZ Network When Start.
@reboot /home/sa/DownDMZ.sh
#Check internet Fttx Wifi.
5 8-18 * * 1-6 bash /home/sa/CheckNet.sh
# 1 Hour switch to fttx wifi disable dmz. For check Fttx again.
0 8-18 * * 1-6 bash /home/sa/SwitchToFttx.sh
linux mint : ไม่สามารถ SSH ไปบางเครื่องได้
root@OD-SUWIT:/home/suwit_j# ssh sa@192.168.2.104
Unable to negotiate with 192.168.2.104 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
ssh-keygen -f "/home/suwit_j/.ssh/known_hosts" -R "192.168.2.104"
/etc/netplan/00-network-manager-all.yaml
sudo apt-add-repository ppa:rodsmith/refind
sudo apt-get update
sudo apt-get install refind
refind-install
reboot
/boot/efi/EFI/refind/refind.config
Ubutun : Terminal แตกไฟล์เอาเฉพาะไฟล์ที่ต้องการ
วิธีนี้แตกเฉพาะไฟล์ที่ต้องการ
https://askubuntu.com/questions/168795/ ... ar-archive
เช่น ตัวอย่างไฟล์ zip ตามแนบ
คำสั่ง เช่น
ก็จะได้เฉพาะไฟล์ที่ต้องการ แต่ Path ที่อยู่ของไฟล์จะแตกตามเดิม จะได้รู้ว่าไฟล์อยู่ที่ไหนtar -xf Test.tar.gz Test/123/456/ฝบง./hostneverdie.pdf
tar -xf Test.tar.gz Test/123/456/77.txt
เนื่องจาก Disk ของ Datacenter เป็น ชนิด MBR จึงได้ขนาดสูงสุดแค่ 2 TB ทำให้เกิด Error ดังกล่าวlibparted messages (ERROR)
partition length of เลขขนาดที่ต้องการขยาย sectors exceeds the msdos-partition-table-imposed maximum of เลขขนาดที่ Disk รับได้
nameserver 127.0.0.53
# Use Google's public DNS servers.
nameserver 8.8.4.4
nameserver 8.8.8.8
nameserver 127.0.0.53
search Home
3. Stop apace ก่อน Run Code ไม่อย่างนั้นจะ Errorroot@intranet1804:~# certbot-auto certonly --standalone -d intranettest.sci.com -d www.intranettest.sci.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for intranettest.sci.com
http-01 challenge for www.intranettest.sci.com
Waiting for verification...
Challenge failed for domain intranettest.sci.com
Challenge failed for domain www.intranettest.sci.com
http-01 challenge for intranettest.sci.com
http-01 challenge for www.intranettest.sci.com
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: intranettest.sci.com
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for intranettest.sci.com
Domain: www.intranettest.sci.com
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for
www.intranettest.sci.com
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for intranettest.com
http-01 challenge for www.intranettest.com
Cleaning up challenges
Problem binding to port 80: Could not bind to IPv4 or IPv6.
IMPORTANT NOTES:
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
cert.pem
chain.pem
fullchain.pem
privkey.pem
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
Disk /dev/loop0: 88.5 MiB, 92778496 bytes, 181208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 43516ABD-068C-45F5-BC44-9BBBBAD0D4D2
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 104855551 104851456 50G Linux filesystem
Disk /dev/sdb: 150 GiB, 161061273600 bytes, 314572800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
The old ext4 signature will be removed by a write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xbd682c0d.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): #Enter
First sector (2048-314572799, default 2048): #Enter
Last sector, +sectors or +size{K,M,G,T,P} (2048-314572799, default 314572799):
Created a new partition 1 of type 'Linux' and of size 150 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
5 ดู Diskmke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 39321344 4k blocks and 9830400 inodes
Filesystem UUID: bf8171ec-a497-4ad8-80a0-aef19903721f
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
6. ดู uuid เพื่อเอาไปใส่ใน fstabDisk /dev/loop0: 88.5 MiB, 92778496 bytes, 181208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 43516ABD-068C-45F5-BC44-9BBBBAD0D4D2
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 104855551 104851456 50G Linux filesystem
Disk /dev/sdb: 150 GiB, 161061273600 bytes, 314572800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd682c0d
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 314572799 314570752 150G 83 Linux
8. สร้าง Folder ที่จะ mount ไป ในUUID=bf8171ec-a497-4ad8-80a0-aef19903721f /www ext4 defaults 0 0
https://oxyme.wordpress.com/2018/08/29/add-install-a-new-hdd-on-ubuntu-18-04-lts-server-edition/Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 395M 1.1M 394M 1% /run
/dev/sda2 49G 5.8G 41G 13% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/loop0 89M 89M 0 100% /snap/core/7270
/dev/sdb1 147G 61M 140G 1% /www
tmpfs 395M 0 395M 0% /run/user/1000