// // Created by 张俭 on 2021/4/26. // #include<stdio.h> #include<unistd.h> #include<string.h>
intmain(int argc, char *argv[]) { int i = 0; pid_t mypid = getpid(); if (argc == 1) return1; printf("argc = %d and arguments are:\n", argc); for (i; i < argc; i++) { printf("%d = %s\n", i, argv[i]); } fflush(stdout); sleep(30); printf("Replacing first argument with x:es... Now open another terminal and run: ps p %d\n", (int)mypid); memset(argv[1], 'x', strlen(argv[1])); getc(stdin); return0; }
编译并运行
1 2 3 4 5 6 7
gcc password_hide.c [root@c77dc365cd1a sh]# ./a.out abcd argc = 2 and arguments are: 0 = ./a.out 1 = abcd Replacing first argument with x:es... Now open another terminal and run: ps p 55
# Point to the internal API server hostname APISERVER=https://kubernetes.default.svc # Path to ServiceAccount token SERVICEACCOUNT=/var/run/secrets/kubernetes.io/serviceaccount # Read this Pod's namespace NAMESPACE=$(cat${SERVICEACCOUNT}/namespace) # Read the ServiceAccount bearer token TOKEN=$(cat${SERVICEACCOUNT}/token) # Reference the internal certificate authority (CA) CACERT=${SERVICEACCOUNT}/ca.crt # Explore the API with TOKEN curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -X GET ${APISERVER}/api curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -X GET ${APISERVER}/api/v1/namespaces/default/pods
Alternatively, if you are the root user, you can run:
export KUBECONFIG=/etc/kubernetes/admin.conf
You should now deploy a pod network to the cluster. Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at: https://kubernetes.io/docs/concepts/cluster-administration/addons/
You can now join any number of the control-plane node running the following command on each as root:
Please note that the certificate-key gives access to cluster sensitive data, keep it secret! As a safeguard, uploaded-certs will be deleted in two hours; If necessary, you can use "kubeadm init phase upload-certs --upload-certs" to reload certs afterward.
Then you can join any number of worker nodes by running the following on each as root:
privatestaticStringconv2Str(int value, int length) { if (length > 5) { thrownewIllegalArgumentException("length should be less than 5"); } Stringstr= String.valueOf(value); return AUX_ARRAY[length - str.length()] + str; }