mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	fix: actually add the given root SSH key to the container (#1502)
This commit is contained in:
		@@ -827,6 +827,7 @@ build_container() {
 | 
				
			|||||||
  export PASSWORD="$PW"
 | 
					  export PASSWORD="$PW"
 | 
				
			||||||
  export VERBOSE="$VERB"
 | 
					  export VERBOSE="$VERB"
 | 
				
			||||||
  export SSH_ROOT="${SSH}"
 | 
					  export SSH_ROOT="${SSH}"
 | 
				
			||||||
 | 
					  export SSH_AUTHORIZED_KEY
 | 
				
			||||||
  export CTID="$CT_ID"
 | 
					  export CTID="$CT_ID"
 | 
				
			||||||
  export CTTYPE="$CT_TYPE"
 | 
					  export CTTYPE="$CT_TYPE"
 | 
				
			||||||
  export PCT_OSTYPE="$var_os"
 | 
					  export PCT_OSTYPE="$var_os"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -255,4 +255,11 @@ EOF
 | 
				
			|||||||
  fi
 | 
					  fi
 | 
				
			||||||
  echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
 | 
					  echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
 | 
				
			||||||
  chmod +x /usr/bin/update
 | 
					  chmod +x /usr/bin/update
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then
 | 
				
			||||||
 | 
					    mkdir -p /root/.ssh
 | 
				
			||||||
 | 
					    echo "${SSH_AUTHORIZED_KEY}" > /root/.ssh/authorized_keys
 | 
				
			||||||
 | 
					    chmod 700 /root/.ssh
 | 
				
			||||||
 | 
					    chmod 600 /root/.ssh/authorized_keys
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user