Skip to content
Snippets Groups Projects
Commit 622d61c1 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

merged

parents cb8bccff 809b4f86
Branches
No related tags found
No related merge requests found
...@@ -8,9 +8,19 @@ fi ...@@ -8,9 +8,19 @@ fi
# User specific aliases and functions # User specific aliases and functions
# remove annoying global aliases # remove annoying global aliases
unalias l. ll vi noalias() {
unalias ls x=`type $1 2>&1 | grep " is aliased to "` && unalias $1
}
# unalias l. ll ls vi
noalias l.
noalias ll
noalias ls
noalias vi
noalias egrep
noalias fgrep
noalias grep
alias ..="tcsh -l" alias ..="tcsh -l"
alias sux="sudo tcsh -l" alias sux="sudo tcsh -l"
set -P
...@@ -7,7 +7,11 @@ set path=($HOME/bin $path) ...@@ -7,7 +7,11 @@ set path=($HOME/bin $path)
alias sux sudo tcsh -l alias sux sudo tcsh -l
alias S SLS -P alias S SLS -P
alias tsv ~/bin/csv --TAB alias tsv ~/bin/csv --UTF8 --TAB
setenv EDITOR `which vi`
setenv LC_ALL en_US.UTF-8
setenv LESSCHARSET utf-8
if (-x ~/.login.local) then if (-x ~/.login.local) then
source ~/.login.local source ~/.login.local
......
# turn Red Hat's annoying missfeature off # turn Red Hat's annoying missfeature off
hardstatus off hardstatus off
utf8 on
#!/bin/sh
sysctl -a net.ipv6.conf 2>/dev/null | awk '/disable_ipv6/ { print $1"=1"}' | xargs sysctl
#!/bin/sh
sysctl -a net.ipv6.conf 2>/dev/null | awk '/disable_ipv6/ { print $1"=0"}' | xargs sysctl
#!/bin/sh
sysctl -a net.ipv6.conf 2>/dev/null | awk '/disable_ipv6/'
#!/usr/bin/perl
=head1 NAME
show_fingerprints.pl
=head1 DESCRIPTION
display fingerprints of all public keys and keys in authorized_keys
=cut
use strict;
my ($version, $has_E)= get_ssh_version();
my $hash_algorithm= 'MD5';
my @files= <*.pub>;
# print "files: ", join (' ', @files), "\n";
push (@files, <authorized_keys*>);
printf ("%-20s %5s %-51s %-6s %s\n", qw(file size fingerprint type notes));
foreach my $file (@files)
{
my @cmd= qw(ssh-keygen -l);
push (@cmd, '-E', $hash_algorithm) if ($has_E);
push (@cmd, '-f', $file);
my $res= `@cmd`;
my @lines= split ("\n", $res);
foreach my $line (@lines)
{
my ($size, $fp, $notes)= split (' ', $line, 3);
my $type= 'unknown';
if ($notes =~ m#(.+)\s+\((.+)\)#) { ($notes, $type)= ($1, $2) }
$fp= join(':', $hash_algorithm, $fp) unless ($has_E);
printf ("%-20s %5d %-51s %-6s %s\n", $file, $size, $fp, $type, $notes);
}
}
sub get_ssh_version
{
my @cmd= qw(ssh-keygen --version); # apparently, there is way to display the version directly
my $res= `@cmd 2>&1`;
my $version= 'unknown';
my $has_E= 0;
foreach my $l (split ("\n", $res))
{
# print "[$l]\n";
if ($l =~ ' -L Print the contents of a certificate.') { $has_E= 0; }
elsif ($l eq ' ssh-keygen -l [-v] [-E fingerprint_hash] [-f input_keyfile]') { $has_E= 1; }
}
($version, $has_E);
}
=head1 TODO
optionally display fingerprints using other hashing algorithms
=cut
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment