Alpine: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Geist (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „ $'''apk update''' $'''apk upgrade''' $'''apk add openssh --no-cache''' $'''apk add openrc --no-cache''' $'''rc-status --list''' $'''touch /run/openrc/s…“) |
Geist (Diskussion | Beiträge) (→openrc) |
||
(11 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
− | $'''apk update''' | + | ===== apk command ===== |
− | $'''apk upgrade''' | + | [https://wiki.alpinelinux.org/wiki/Package_management Package management] |
− | $'''apk | + | $''' apk update''' |
− | + | $''' apk upgrade''' | |
+ | $''' apk search [PACKAGE]''' | ||
− | $''' | + | ===== add user|group===== |
+ | [https://wiki.alpinelinux.org/wiki/Setting_up_a_new_user Setting up a new user] | ||
+ | $''' addgroup -S mygroup ''' | ||
+ | $''' adduser -S myuser -G mygroup ''' | ||
+ | ''docker all future commands should run as the myuser user'' | ||
+ | $''' USER myuser ''' | ||
+ | [https://stackoverflow.com/questions/49955097/how-do-i-add-a-user-when-im-using-alpine-as-a-base-image How do I add a user when I'm using Alpine as a base image?] | ||
− | $'''touch /run/openrc/softlevel''' | + | The flags for adduser are: |
+ | Usage: adduser [OPTIONS] USER [GROUP] | ||
+ | Create new user, or add USER to GROUP | ||
+ | -h DIR Home directory | ||
+ | -g GECOS GECOS field | ||
+ | -s SHELL Login shell | ||
+ | -G GRP Group | ||
+ | -S Create a system user | ||
+ | -D Don't assign a password | ||
+ | -H Don't create home directory | ||
+ | -u UID User id | ||
+ | -k SKEL Skeleton directory (/etc/skel) | ||
+ | |||
+ | ===== openrc ===== | ||
+ | [https://www.cyberciti.biz/faq/how-to-enable-and-start-services-on-alpine-linux/ How to enable and start services on Alpine Linux] | ||
+ | ''rc-update is part of openrc'' | ||
+ | $''' apk add openrc ''' | ||
+ | $''' rc-status --list''' | ||
+ | $''' touch /run/openrc/softlevel''' | ||
+ | |||
+ | ===== openssh ===== | ||
+ | [https://wiki.alpinelinux.org/wiki/Setting_up_a_SSH_server Setting up a SSH server] | ||
+ | $''' apk add openssh --no-cache''' | ||
+ | $''' apk add openrc --no-cache''' | ||
+ | ''Enable the sshd service at boot time: '' | ||
+ | $''' rc-update add sshd ''' | ||
+ | ''Start the SSHD service on Alpine Linux immediately using the service command: '' | ||
+ | $''' service sshd start ''' |
Aktuelle Version vom 31. März 2022, 13:21 Uhr
Inhaltsverzeichnis
apk command
$ apk update $ apk upgrade $ apk search [PACKAGE]
add user|group
$ addgroup -S mygroup $ adduser -S myuser -G mygroup docker all future commands should run as the myuser user $ USER myuser
How do I add a user when I'm using Alpine as a base image?
The flags for adduser are: Usage: adduser [OPTIONS] USER [GROUP] Create new user, or add USER to GROUP -h DIR Home directory -g GECOS GECOS field -s SHELL Login shell -G GRP Group -S Create a system user -D Don't assign a password -H Don't create home directory -u UID User id -k SKEL Skeleton directory (/etc/skel)
openrc
How to enable and start services on Alpine Linux rc-update is part of openrc $ apk add openrc $ rc-status --list $ touch /run/openrc/softlevel
openssh
Setting up a SSH server $ apk add openssh --no-cache $ apk add openrc --no-cache Enable the sshd service at boot time: $ rc-update add sshd Start the SSHD service on Alpine Linux immediately using the service command: $ service sshd start