2025年6月23日 星期一

Anaconda 使用Proxy 安裝 Python 套件

終端機下執行 conda 指令
conda config –set proxy_servers.http http://proxy.loc:3128
conda config –set proxy_servers.https http://proxt.loc:3128

或編輯設定檔 ~/.condarc 加入以下內容
proxy_servers:
  http: http://proxy.loc:3128
  https: http://proxy.loc:3128

檢視 conda 設定,終端機下執行
conda config –show
conda info --all

使用範例
conda config –add channels conda-forge
conda install gcc=12
conda install gxx=12

conda install gcc=12  -c conda-forge
conda install gxx=12  -c conda-forge

Windows 10/11 powershell 下新增VPN

 Add-VpnConnection -Name "VPN-NAME" -ServerAddress "vpn-server" -PassThru -TunnelType "Automatic" 

-TunnelType
指定用於VPN連接的 Tunnel類型。此參數的可接受值為:
PPTP  L2TP  SSTP  IKEv2  Automatic

Bash 產生密碼範例

 password=$(tr -dc 'A-Za-z0-9!?%=' < /dev/urandom | head -c 20);

Openssh server 設定特定群組限用 sftp

編輯 /etc/ssh/sshd_config 

# override default of no subsystems
#Subsystem      sftp    /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp

 Match group domain?users
#Match group *,!sudo
    #ChrootDirectory /home/%u@loc
    ChrootDirectory /home
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp

pip 安裝 github 項目

pip install git+https://github.com/popgenmethods/smcpp.git --user

git clone https://github.com/popgenmethods/smcpp.git
cd smcpp
python3 setup.py install --user

2025年6月5日 星期四

Debian 12 sssd realm 無法加入網域

錯誤訊息
Wrote out krb5.conf snippet to /var/cache/realmd/adcli-krb5-090dt5/krb5.d/adcli-krb5-conf-uzvObj
 * Authenticated as user: Administrator@test.loc
 * Using GSS-SPNEGO for SASL bind
 ! Couldn't authenticate to active directory: SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure.  Minor code may provide more information (Server not found in Kerberos database)
adcli: couldn't connect to ssde.sinica domain: Couldn't authenticate to active directory: SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure.  Minor code may provide more information (Server not found in Kerberos database)
Insufficient permissions to join the domain

安裝 krb5相關軟體
apt install krb5-user

2025年5月28日 星期三

LEAF Bering-uClibc 7.4.0 安裝 accelppp

編輯 /etc/modules 載入相關模組,reboot
# Modules needed for PPP connection                                     
slhc                                                                   
ppp_generic                                                             
ppp_async                                                               
# The three following modules are not always needed                     
zlib_inflate                                                           
zlib_deflate                                                           
ppp_deflate                                                                                                                                   

# Modules needed for PPP/PPPOE connection
slhc                                                   
pppoe                                                                                                         

# Modules needed for PPTP connection                   
pptp                                                                            

# Modules needed for L2TP connection                                   
slhc                                                                   
pppol2tp                                                               
ppp_mppe                                                                                                                                       

# Modules needed for PPPOA connection                                 
# An ATM adapter module must be loaded for this to work                 
# (e.g. unicorn_pci_atm or unicorn_usb_atm)                             
slhc                                                                   
ppp_generic                                                             
pppoatm                                          

安裝 accelppp  accelppp  pppscrpt  libpcre  libsnmp 

編輯 /etc/accel-ppp.conf
chap-secrets
[chap-secrets]
chap-secrets=/etc/ppp/chap-secrets 

編輯 /etc/ppp/chap-secrets 
帳號密碼設定檔 共四欄
# 第一欄為連線帳號,
# 第二欄要設定成/etc/accel-ppp.conf 中的name
# 第三欄為密碼
# 第四欄為連線IP

設定 shorewall
編輯 /etc/shorewall/rules加入
ACCEPT  net     fw      tcp     1723
ACCEPT  net     fw      udp     1701
Ping(ACCEPT)  vpn         fw

編輯 /etc/shorewall/zones  加入
vpn     ipv4

編輯 /etc/shorewall/interfaces 加入
vpn             ppp+

編輯 /etc/shorewall/policy 加入
vpn     loc    ACCEPT

編輯/etc/shorewall/masq
eth0               192.168.2.0/24

參考文件
https://docs.accel-ppp.org/configuration/configuration.html

相關 module
nf_nat_pptp