Projects
Mega:24.09
openssh
_service:tar_scm:sshd-keygen
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:sshd-keygen of Package openssh
#!/bin/bash # Create the host keys for the OpenSSH server. KEYTYPE=$1 case $KEYTYPE in "dsa") ;& # disabled in FIPS "ed25519") FIPS=/proc/sys/crypto/fips_enabled if [[ -r "$FIPS" && $(cat $FIPS) == "1" ]]; then exit 0 fi ;; "rsa") ;; # always ok "ecdsa") ;; *) # wrong argument exit 12 ;; esac KEY=/etc/ssh/ssh_host_${KEYTYPE}_key KEYGEN=/usr/bin/ssh-keygen if [[ ! -x $KEYGEN ]]; then exit 13 fi # remove old keys rm -f $KEY{,.pub} # create new keys if ! $KEYGEN -q -t $KEYTYPE -f $KEY -C '' -N '' >&/dev/null; then exit 1 fi # sanitize permissions /usr/bin/chgrp ssh_keys $KEY /usr/bin/chmod 400 $KEY /usr/bin/chmod 400 $KEY.pub if [[ -x /usr/sbin/restorecon ]]; then /usr/sbin/restorecon $KEY{,.pub} fi exit 0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2