aka:ssh:基本的なファイル達
$ pwd
/Users/aka
$ cd .ssh
$ ls
id_rsa id_rsa.pub known_hosts
$ cat known_hosts
[...]
github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
[...]
$ cat id_rsa
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,1422F508712A0D51D36A1GA4F3435F3C
bY4quXaqAAADLj/2f5nwrQdjXq1UiytBjY4vKjxjhjW8/dgZQU84TdOxt1lAwOtD
Ah8ueXztLYbNAe8ZpHFaGfHk8/r/IcM92xx37eKjhOWi7+7IQkufZ6xmRPxVzhzt
H3Kav19Rv8nOOZs/3Y64/6OO8RtqjJU+F/2EwRG/OjPQ2MJByOOzzpxzdurlDaUU
raYrp0W/KS5rr/UrCoUpLi671wdz+az7LOOOGpScSkg6jmrZWlyHOO8kFBs5/uuQ
goFFT1jTKHCx809dsB26NmwKnwNDxOYlbNw1+IWfMEXLrUyOj18F/Q/t6SvA5Cxe
eMaoqROa73VKcCT2ZduKDk61D/f8g4cghP6OOOeP+RXGnAKOO5os1YjhGJdFKVRJ
WU2OzKAAjb5i+oLVRpruv0I9lAOOXOfMCr9q+DOTlhXoEV5BU7dly+1zoyEsEOk2
ZOj/WOnGcZzq0OO8+XbFATl3O7CrIMpekxLAZ/Mw6FUnPv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u4qJnIsxmeH+ClXKhUqvpw6njlKfiLxSqJ
-----END RSA PRIVATE KEY-----
$ cat id_rsa.pub
ssh-rsa AAAAB3NZOj/WOnGcZzq0OO8+XbFATl3O7CrIMpekxLAZ/Mw6FUnPvT1Xf0EF0hvBObDuINR8IPe0PvmNhdMhkeoXoTwS13o0oWemzNDtvl3z343EotqEH3yFoqUQuDmBVY8FsQ1zdX9ifORDYLCmllYDULhnhhs3xZ/gfudvv4QvYzNVdIZaK3+GEUgKeXBVQ0GwvmBpk866KXTKuaa6XHBlc0idzhwozM5OGyqDtmJgXiLNs/UxYhnXGKjmi/88sTm0i+f3iWnqq+Ra/edYhuW2jNJr56dHu/JXwAgbJgOnY2t6gvtVlHLEsLVDSOFEMJAp/2mWlpkiIEgz3jh8C9xOiaHyYtrn7BhPm8TRVu9jHsSRmanp aka@example.com
$ cd /etc
$ ls ssh*
ssh_config ssh_host_key ssh_host_rsa_key.pub
ssh_host_dsa_key ssh_host_key.pub ssh_host_rsa_key.pub~orig
ssh_host_dsa_key.pub ssh_host_key.pub~orig ssh_host_rsa_key~orig
ssh_host_dsa_key.pub~orig ssh_host_key~orig sshd_config
ssh_host_dsa_key~orig ssh_host_rsa_key
$ cat ssh_config
# $OpenBSD: ssh_config,v 1.26 2010/01/11 01:39:46 dtucker Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.
Host *
SendEnv LANG LC_*
# ForwardAgent no
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# Port 22
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
$ cat sshd_config
# $OpenBSD: sshd_config,v 1.81 2009/10/08 14:03:41 markus Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# The default requires explicit activation of protocol 1
#Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
# Logging
# obsoletes QuietMode and FascistLogging
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords both PasswordAuthentication and
# ChallengeResponseAuthentication must be set to "no".
#PasswordAuthentication no
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# Also, PAM will deny null passwords by default. If you need to allow
# null passwords, add the " nullok" option to the end of the
# securityserver.so line in /etc/pam.d/sshd.
#UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
# pass locale information
AcceptEnv LANG LC_*
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
$ cat ssh_host_key
cat: ssh_host_key: Permission denied
$ sudo cat ssh_host_key
SSH PRIVATE KEY FILE FORMAT 1.1
[...]
$ cat ssh_host_key.pub
2048 35 45943458785772059735385252575515079532123881236299619865578580553584971194341565137097878120558814482253464270333830733973267002199565511210924986584391303475823135069048657972695424196510218573566658108706597898631996456606227913421784112807099338746721754461766499709227497155175129153302621735576556287903890768902538317122288018791550120977041497076715521102107888018774601100535709317240695921457430897582737972344798308368399679974160566851389372846428459359962975461458527304550713375404963435606794678536319470528789721509386590221755088441598447061209364825367640951564516041811439823176099554314190016180743
$