X7ROOT File Manager
Current Path:
/usr/libexec/ipsec
usr
/
libexec
/
ipsec
/
📁
..
📄
_import_crl
(154.26 KB)
📄
_keycensor
(1.38 KB)
📄
_plutorun
(2.98 KB)
📄
_secretcensor
(1.86 KB)
📄
_stackmanager
(14 KB)
📄
_unbound-hook
(1.97 KB)
📄
_updown
(4.23 KB)
📄
_updown.klips
(18.3 KB)
📄
_updown.netkey
(23.31 KB)
📄
addconn
(210.56 KB)
📄
algparse
(345.43 KB)
📄
auto
(5.74 KB)
📄
barf
(11.82 KB)
📄
cavp
(346.02 KB)
📄
enumcheck
(85.1 KB)
📄
eroute
(93.81 KB)
📄
klipsdebug
(69.61 KB)
📄
look
(4.2 KB)
📄
newhostkey
(3.23 KB)
📄
pf_key
(69.18 KB)
📄
pluto
(1.37 MB)
📄
readwriteconf
(182.2 KB)
📄
rsasigkey
(159.04 KB)
📄
setup
(5.58 KB)
📄
show
(3.46 KB)
📄
showhostkey
(159.3 KB)
📄
spi
(346.27 KB)
📄
spigrp
(85.76 KB)
📄
tncfg
(130.14 KB)
📄
verify
(12.04 KB)
📄
whack
(137.93 KB)
Editing: newhostkey
#! /bin/sh # # generate new key for this host # # Copyright (C) 2001, 2002 Henry Spencer. # Copyright (C) 2014 Paul Wouters <pwouters@redhat.com> # Copyright (C) 2014, 2016 Tuomo Soini <tis@foobar.fi> # Copyright (C) 2016, Andrew Cagney <cagney@gnu.org> # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # me="ipsec newhostkey" usage="Usage: $me [--output filename] [--seeddev device] [--bits n] \\ [--quiet] [--hostname host] [--nssdir /etc/ipsec.d] [--password password] " bits= verbose= host= seeddev="--seeddev /dev/random" output= nssdir="/etc/ipsec.d" password= for dummy; do case "$1" in --bits) bits="${2}" shift ;; --quiet) verbose= ;; --hostname) host="--hostname ${2}" shift ;; --output) output="${2}" shift ;; --verbose) verbose="--verbose" ;; --version) echo "${me} $IPSEC_VERSION" exit 0 ;; --random) echo "${me} warning: --random is obsoleted, using --seeddev" >&2 seeddev="--seeddev ${2}" shift ;; --seeddev) seeddev="--seeddev ${2}" shift ;; --configdir) echo "${me} warning: --configdir is obsoleted, use --nssdir" >&2 nssdir="${2}" shift ;; --nssdir) nssdir="${2}" shift ;; --password) password="--password ${2}" shift ;; --help) echo "$usage" exit 0 ;; --) shift break ;; -*) echo "${me}: unknown option \`$1'" >&2 exit 2 ;; *) break ;; esac shift done if [ -n "${output}" -a -d "${output}" ]; then echo "ERROR: output file should be a secrets file, not a directory" exit 255 fi if [ -n "${output}" -a -s "${output}" ]; then printf "%s: WARNING: file \"%s\" exists, appending to it\n" "${0}" "${output}" >&2 fi if [ ! -d ${nssdir} ]; then echo "No such directory: ${nssdir}" exit 255 fi certutil -L -d "sql:${nssdir}" >/dev/null 2>/dev/null RETVAL=$? if [ ${RETVAL} -eq 255 ]; then echo "NSS database in ${nssdir} not initialized." echo " Please run 'ipsec initnss --nssdir ${nssdir}'" exit 255 fi key=$(ipsec rsasigkey ${verbose} ${seeddev} --nssdir ${nssdir} ${password} ${host} ${bits}) RETVAL=$? if [ ${RETVAL} -ne 0 ]; then exit ${RETVAL} fi out() ( echo ': RSA {' printf "%s\n" "${key}" echo ' }' echo '# do not change the indenting of that "}"' ) # Write out the #ckaid= and #pubkey= lines # echo "${key}" | sed -n 's/.*#\([a-z]*)=/\1/p' if [ -n "${output}" ]; then umask 077 TEMPFILE=$(mktemp ${output}.XXXXXXX) RETVAL=$? if [ ${RETVAL} -gt 0 ]; then echo "${me}: error creating temporary file, aborting" >&2 exit ${RETVAL} fi if [ -f ${output} ]; then cat ${output} >> ${TEMPFILE} fi out >> ${TEMPFILE} mv ${TEMPFILE} ${output} fi
Upload File
Create Folder