no_proxy
NO_PROXY
내 회사 프록시가 이를 인식하지 못하기 때문에 내 /etc/environment/ 변수에 매우 긴 호스트 이름 및 IP 목록(1013자 이상)이 있습니다. 내 로컬 언바운드 DNS가 제대로 작동합니다. 일부 호스트 이름과 IP만 유효합니다.
처럼 보인다pam_env이 패키지는 할당 var=value
(예 no_proxy="blah"
: )을 각각 1024바이트로 제한합니다.
- 소스( )는 어떻게 구하나요
apt-get source libpam-modules
?deb-src
어떤 /etc/apt/sources.list 항목이 필요합니까? - pam_env.c는 어떤 경로에 있으며 편집할 수 있나요? 도움 이 되었나요
updatedb && locate pam_env.c
? - Ubuntu 14.04 및 Ubuntu 16.04에 빌드하고 통합하는 방법은 무엇입니까?
답변1
더 큰 제한을 적용하여 PAM을 다시 빌드하세요.
sudo 권한이 있는 일반 사용자로 스크립트를 실행합니다.
BZR(= Bazaar)을 사용하는 Ubuntu 스크립트(실제로 테스트되지 않음!)
다음을 사용하여 vi build_pam_via_ubuntu_and_bzr.sh
파일을 만듭니다 .chmod +x build_pam_via_ubuntu_and_bzr.sh
./build_pam_via_ubuntu_and_bzr.sh
#!/usr/bin/env bash
# Stop when folder exists (please delete manually):
[ -e /opt/bzr/pam/ ] && exit 0
# Update sources:
sudo apt-get update || exit 1
# Install source control:
sudo apt-get install bzr bzr-builddeb -y || exit 1
# Create folder:
sudo mkdir -p /opt/bzr/pam/ || exit 1
# Change owner and group:
sudo chown -R $(id -u):$(id -g) /opt/bzr/pam/ || exit 1
# Enter folder:
cd /opt/bzr/pam/ || exit 1
# Clone PAM repo
bzr branch lp:ubuntu/vivid/pam || exit 1
# Join folder:
cd /opt/bzr/pam/ubuntu/ || exit 1
# Main point: Change BUF_SIZE limit:
sed -i "s/#define BUF_SIZE 1024/#define BUF_SIZE 8192/" modules/pam_env/pam_env.c || exit 1
# Add new version number to debian/changelog:
dch -n "Change environment variable limit from 1024 to 8192." || exit 1
# `bzr builddeb -- -uc -us` will fail with `unmet build dependencies`, install them:
sudo apt-get install libcrack2-dev debhelper quilt flex bison libfl-dev libdb-dev libselinux1-dev po-debconf dh-autoreconf autopoint libaudit-dev pkg-config xsltproc libxml2-utils docbook-xml docbook-xsl w3m -y || exit 1
# Another error lead me to remove fop (maybe not necessary):
###sudo apt-get remove fop || exit 1
# Build packages without signing them (takes ~ 20 minutes):
bzr builddeb -- -uc -us || exit 1
# Install local packages and dependencies with apt-get (possible since Ubuntu 16.04)
# Otherwise (Ubuntu 14.04) use dpkg
sudo apt-get install /opt/bzr/pam/*.deb || sudo dpkg --force-all -i /opt/bzr/pam/*.deb || exit 1
# Now you can have env variables with ~ 8192 chars:
sudo bash -c "echo 'BLUBB123=\"'$(tr -dc 'a-z0-9' < /dev/urandom | head -c8000)'\"' >> /etc/environment" || exit 1
Ubuntu 14.04.5용 Git 스크립트(테스트됨)
다음을 사용하여 vi build_pam_via_trusty_and_git.sh
파일을 만듭니다 .chmod +x build_pam_via_trusty_and_git.sh
./build_pam_via_trusty_and_git.sh
#!/usr/bin/env bash
# Stop when folder exists (please delete manually):
[ -e /opt/git/pam/ ] && exit 0
# Update sources:
sudo apt-get update || exit 1
# Install source control:
sudo apt-get install git git-buildpackage -y || exit 1
# Create folder:
sudo mkdir -p /opt/git/pam/ || exit 1
# Change owner and group:
sudo chown -R $(id -u):$(id -g) /opt/git/pam/ || exit 1
# Enter folder:
cd /opt/git/pam/ || exit 1
# Clone PAM repo
git clone -b ubuntu/trusty-security https://git.launchpad.net/~usd-import-team/ubuntu/+source/pam || exit 1
# Join folder:
cd /opt/git/pam/pam/ || exit 1
# Main point: Change BUF_SIZE limit:
sed -i "s/#define BUF_SIZE 1024/#define BUF_SIZE 8192/" modules/pam_env/pam_env.c || exit 1
# Add new version number to debian/changelog (coming from 1.1.8-1ubuntu2.2):
dch -n "Change environment variable limit from 1024 to 8192." || exit 1
# Add changed files to Git index:
git add /opt/git/pam/pam/modules/pam_env/pam_env.c || exit 1
git add /opt/git/pam/pam/debian/changelog || exit 1
# Commit Git index:
git commit -m "Change environment variable limit from 1024 to 8192." || exit 1
sudo apt-get install libcrack2-dev debhelper quilt flex bison libfl-dev libdb-dev libselinux1-dev po-debconf dh-autoreconf autopoint libaudit-dev pkg-config xsltproc libxml2-utils docbook-xml docbook-xsl w3m -y || exit 1
# Another error lead me to remove fop (maybe not necessary):
###sudo apt-get remove fop || exit 1
# Build packages without signing them (takes ~ 20 minutes):
gbp buildpackage --git-debian-branch="ubuntu/trusty-security" --git-ignore-new --git-upstream-tree="ubuntu/trusty-security" -uc -us || exit 1
# Install local packages:
sudo dpkg --force-all -i /opt/git/pam/*.deb || exit 1
# Now you can have env variables with ~ 8192 chars:
sudo bash -c "echo 'BLUBB123=\"'$(tr -dc 'a-z0-9' < /dev/urandom | head -c8000)'\"' >> /etc/environment" || exit 1
Ubuntu 16.04.4용 Git 스크립트(테스트됨)
다음을 사용하여 vi build_pam_via_xenial_and_git.sh
파일을 만듭니다 .chmod +x build_pam_via_xenial_and_git.sh
./build_pam_via_xenial_and_git.sh
#!/usr/bin/env bash
# Stop when folder exists (please delete manually):
[ -e /opt/git/pam/ ] && exit 0
# Update sources:
sudo apt-get update || exit 1
# Install source control:
sudo apt-get install git git-buildpackage -y || exit 1
# Create folder:
sudo mkdir -p /opt/git/pam/ || exit 1
# Change owner and group:
sudo chown -R $(id -u):$(id -g) /opt/git/pam/ || exit 1
# Enter folder:
cd /opt/git/pam/ || exit 1
# Clone PAM repo
git clone -b ubuntu/xenial https://git.launchpad.net/~usd-import-team/ubuntu/+source/pam || exit 1
# Join folder:
cd /opt/git/pam/pam/ || exit 1
# Main point: Change BUF_SIZE limit:
sed -i "s/#define BUF_SIZE 1024/#define BUF_SIZE 8192/" modules/pam_env/pam_env.c || exit 1
# Add new version number to debian/changelog (coming from 1.1.8-3.2ubuntu2.1):
dch --distribution unstable --package "pam" --newversion "1.1.8-3.2ubuntu2.2" "Change environment variable limit from 1024 to 8192." || exit 1
# dch -n "Change environment variable limit from 1024 to 8192." || exit 1
# Add changed files to Git index:
git add /opt/git/pam/pam/modules/pam_env/pam_env.c || exit 1
git add /opt/git/pam/pam/debian/changelog || exit 1
# Commit Git index:
git commit -m "Change environment variable limit from 1024 to 8192." || exit 1
sudo apt-get install libcrack2-dev debhelper quilt flex bison libfl-dev libdb-dev libselinux1-dev po-debconf dh-autoreconf autopoint libaudit-dev pkg-config xsltproc libxml2-utils docbook-xml docbook-xsl w3m -y || exit 1
# Another error lead me to remove fop (maybe not necessary):
###sudo apt-get remove fop || exit 1
# Build packages without signing them (takes ~ 20 minutes):
gbp buildpackage --git-debian-branch="ubuntu/xenial" --git-ignore-new --git-upstream-tree="ubuntu/xenial" -uc -us || exit 1
# Install local packages and dependencies with apt-get (possible since Ubuntu 16.04):
sudo apt-get install /opt/git/pam/*.deb -y || exit 1
# Now you can have env variables with ~ 8192 chars:
sudo bash -c "echo 'BLUBB123=\"'$(tr -dc 'a-z0-9' < /dev/urandom | head -c8000)'\"' >> /etc/environment" || exit 1
시험
컴퓨터를 다시 시작하세요(필요하지 않을 수도 있음).
sudo reboot
설치된 버전 번호를 확인하세요.
sudo apt install apt-show-versions
sudo apt-show-versions libpam-modules
다음과 같은 것을 반환합니다
libpam-modules:amd64 1.1.8-3.2ubuntu2.1 newer than version in archive
libpam-modules:i386 not installed
어느 것이 맞습니까?
8000자를 포함하는 환경 변수 BLUBB123을 다시 연결하고 표시합니다.
echo $BLUBB123
관련된: