From 7fb08b4791214b648175d19ce14fa297b4ea2e16 Mon Sep 17 00:00:00 2001 From: Clément Bénier Date: Wed, 22 Aug 2018 14:06:34 +0200 Subject: test target: launch user sshd for opening term MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fixtures for user ssh server (authorized_keys, ssh, sshd_config, ssh_host_rsa_key, ssh.pub) - exec following cmd $ /usr/bin/sshd - D -f sshd_config -h ssh_host_rsa_key -o AuthorizedKeysFile=authorized_keys -p port - uncomment former terminal tests for open/close Change-Id: If1765c4860ef3a95f7a92f1f9652427828b98083 Signed-off-by: Clément Bénier --- test/fixtures/ssh/authorized_keys | 1 + test/fixtures/ssh/ssh | 27 +++++++++ test/fixtures/ssh/ssh.pub | 1 + test/fixtures/ssh/ssh_host_rsa_key | 27 +++++++++ test/fixtures/ssh/sshd_config | 116 +++++++++++++++++++++++++++++++++++++ 5 files changed, 172 insertions(+) create mode 100644 test/fixtures/ssh/authorized_keys create mode 100644 test/fixtures/ssh/ssh create mode 100644 test/fixtures/ssh/ssh.pub create mode 100644 test/fixtures/ssh/ssh_host_rsa_key create mode 100644 test/fixtures/ssh/sshd_config (limited to 'test/fixtures') diff --git a/test/fixtures/ssh/authorized_keys b/test/fixtures/ssh/authorized_keys new file mode 100644 index 0000000..42d67cb --- /dev/null +++ b/test/fixtures/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5YA/PN5m6gOtjP98h75EcW3AYyRlcEYoJa2gRhv3iFE+An7LK42VhEJ7OeKV1vvEAKZWTbr67RAkdl6gl3sNmL6oNwYelUgLJ1OrvCbKdA9+aj6J3+ydBFtn/etyBYR+DTlsgZstO7jTZiXJBKy+ungZ0f6DbKUOqnU4OeiQhqz7wnm+jjiXeBlSeH/gy0eoadSkO2jiwP4X+0izSpTAxsfhkLU85rWMJWiCD7ZS8TauXNYhXQBt9yi9I2n7VYxsJU+yVuSum7SYMRbJuvWWpj8vMb07pS/XXg2RHcAMu3vBQtl5uisJ94vuL8xcIu+PQNAYawOYa1ijzRSec7fC5 test@clementMachine diff --git a/test/fixtures/ssh/ssh b/test/fixtures/ssh/ssh new file mode 100644 index 0000000..49d97dc --- /dev/null +++ b/test/fixtures/ssh/ssh @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAuWAPzzeZuoDrYz/fIe+RHFtwGMkZXBGKCWtoEYb94hRPgJ+y +yuNlYRCeznildb7xACmVk26+u0QJHZeoJd7DZi+qDcGHpVICydTq7wmynQPfmo+i +d/snQRbZ/3rcgWEfg05bIGbLTu402YlyQSsvrp4GdH+g2ylDqp1ODnokIas+8J5v +o44l3gZUnh/4MtHqGnUpDto4sD+F/tIs0qUwMbH4ZC1POa1jCVogg+2UvE2rlzWI +V0AbfcovSNp+1WMbCVPslbkrpu0mDEWybr1lqY/LzG9O6Uv114NkR3ADLt7wULZe +borCfeL7i/MXCLvj0DQGGsDmGtYo80UnnO3wuQIDAQABAoIBABatMqHlqk+PT7wv +ZwtOtBCk+tx9VTXXC2zFj9B9E/ehBmy0nHmHQbKTBuo5BfyWZALiE2MarAhadUcC +c1ZWns6UTBgssXw+wQqRmj+tjwT4IVVV9sj4lz+2HOrMy8aj6+fzIOCg0oQQTbTC +xJBGSSnyONXteu70aEupvI+2z06y34JdOjypeg6QuabfggglBXrNL6vZJ6V40kyP +yYOdXb44oSajbb2RzP9zl7wnOi1RgBpU2xxJLWCA5KXyuQvQQUeR4ApZNQLOcR5N +Q1oELr8NQbS6AkNdx24ErPe1I/NswQgWJjzr+A+MXqeLb4ttYC1225vYah3Co4yG +zgdLSyUCgYEA8i/mmQw0Gff/yNFnStcX1El8XdZA5CETqvfn9axjERLOPtRkmGSX +gL62flc6JjHVK1o84sSkMWKQ+sS8uZm12xDYK46tORuRyiq7/2vwW/rRSgUr6l6w +cp8JyOr/Kw1v20I6gYJv0V3pidkdaAj8KTYrrj/50s3e3EVHlZzv3AsCgYEAw/Kr +HCzFeaXhf3RshaVUK3jRX9029qijYojobMAsz7f12bVyCcrJOotAQTRuADKq6Iiv +B3CwGzppnANiztPbEc1m6i5Qt8HBOY/oOr7dPCjqnOvVrJmtl7o+b+OjVwLJ2cut +D19wAnq+ZSbnuO8tv221qySizTxmq0Hjj1CD3MsCgYEAx1PbU+2yWAlAMVT/0Z30 +U9ljjYvQfrImkNlWxWFra9rxes6uOKrZ8rGEW7mI93SeQP8VC4LSrH62Wl5gAdXb +0gAsGrVkJpNlS2IetttsyRdG98gH2+6xBLWWhRG8j/+QJ4J7yqnDRCsqEjVquXxj +pbua+eBXykN8gAhZIW84Dv8CgYEAh/S4BLSLz/vomiaNpa0w2XjazUkP+dTIiHW1 +zr8IWJerXYMnvOOW+6fizVszd6+wJeewidkGV94PqNAwnpEgTxnVbmb0Wot1JhtT +Zm9H0ZYSMw7vEvMOH1h6OegYTScCJrvLN/9gGFhSAp0b6pUJiOj2Q+kHjJ98HRd6 +bNXQqEECgYAtIo4t0RzfIYhNgQZ1sXxegvswfmUIghDEPmWMRxrkd7YzZrxgU/No +M3AqdFGZlfUh4os48w9HCX93zobNar0Z3RYKNuKNtVKvIppOx6PVPl3FSNpwMIbh +PXX7PftJOpqAWFDo0DqwL3rBg2eV177dwjetCSSXLTtMoRK1d02DUw== +-----END RSA PRIVATE KEY----- diff --git a/test/fixtures/ssh/ssh.pub b/test/fixtures/ssh/ssh.pub new file mode 100644 index 0000000..42d67cb --- /dev/null +++ b/test/fixtures/ssh/ssh.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5YA/PN5m6gOtjP98h75EcW3AYyRlcEYoJa2gRhv3iFE+An7LK42VhEJ7OeKV1vvEAKZWTbr67RAkdl6gl3sNmL6oNwYelUgLJ1OrvCbKdA9+aj6J3+ydBFtn/etyBYR+DTlsgZstO7jTZiXJBKy+ungZ0f6DbKUOqnU4OeiQhqz7wnm+jjiXeBlSeH/gy0eoadSkO2jiwP4X+0izSpTAxsfhkLU85rWMJWiCD7ZS8TauXNYhXQBt9yi9I2n7VYxsJU+yVuSum7SYMRbJuvWWpj8vMb07pS/XXg2RHcAMu3vBQtl5uisJ94vuL8xcIu+PQNAYawOYa1ijzRSec7fC5 test@clementMachine diff --git a/test/fixtures/ssh/ssh_host_rsa_key b/test/fixtures/ssh/ssh_host_rsa_key new file mode 100644 index 0000000..df41d73 --- /dev/null +++ b/test/fixtures/ssh/ssh_host_rsa_key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEAqDQ8m/TfF7ritC3DLzqhxXwhpvqGugmxMjuWpmgX1BHTp8OL +AXo5Wv0CMWx2gN7no0h7hAVDPcLFXUWmEU9SphsNLHB/EcE1LgZKhwno523dSXFI +W5abpW2gSbmq/zYQjBw2lxss4jM4hnkJaY+iP6D7CNo/hAvSn/LU7KwAvoIiymId +1/VzT8J8F+UvkWRFOBlO2wVHUvcKxw69M8nM/UmFmQL3AFc84Aw2XkXyBDqVQ38F +6pQE+ScOBTPEYqjaLRMqDUtm+DzhFNgE9iojY7cVZlNMFcrfWiXpwZWnYdDXP4nq +x1aFzEr87SUvLXS1kT7Sa95VlnXRiHWUFwl9PwIDAQABAoIBACOteNGnvg5dgKqx +Lj59VET8UHMHnr4lQiWiiBDh8XP1GAz0qC53C2VmVym+lOA+56k1vaVCLIIUJyLi +nBf92E0NXdz4O6u7bJlHklVUX8d/AToLwkpTBs6vExmwPToG8LmXXmjsxbdxH+M+ +FyYB5mtSrQyyplhO3a05p7pPvZSq08Aj1ch4D9GtnKWkY2VoeR8GeJsXwcBA7FHx +7MotipeBcWB3F6r2UmtuG0a45rSM8fVf7Rh8KAFBNxFuRfqbQohJleA3fDi+rFfL +fmWg0OQL8H/JV8UPqBQXuIP6RxNl/V2VuNyZ4OtP0nlmXYwSmGNvmBg45M0/6Lh7 +FGn1NOkCgYEA1Tmz9Yd8qHGhZU+NexoXCaQNtqhopBa8aKpUiLZXdv5G9EGnbjQW +5JTJTSYR3ZRPiVDJ7u0qJHSYWmXvTyNomeq6V4bJ8HV8NgLSpQ+dATWp4iez8j53 +vzzIMF60aAlAze62zrOu/U3hxMVYePZQ08EDxq5S9HJ/0VjF74kf5CUCgYEAyfJw +k3PjeH97VuuuoKLEBjMhNAXkKwQMScX72CaN2oQxh9Jne95tlfk6IcvlYXG/bag8 +Rcb4rwIYR/zLsnbAkhuibYk5gPd+Qjz9B1YJmOj1RI+Gz4eq/D69T2O/zZi9saB4 +05Xu/vEOFTKrAvcIGjPTCpCu9WeSOUS9PFZ8zJMCgYB8yQJKhPotUiLUOZRhIMmu +uLXV2gUzUqL81gIW6C+T0ggQVoP3+MAVEgYlAkyeUnehswgare1l3F51OQauV9iV +i0t2gcmY0gjZSxmfw91soc1EL1wePvSxlI7L0ADgidnFKxkNKxcT4wpnr96xG+X9 +pw3grpCZwpCPIdbk8mkZiQKBgAmONC9181R3S8HAIyIssXPNpYuNn889QMuY16LR +qDKnwKQ5m3Xr/2lyQoLo3/Ctbi5lIHz4vjmhsr5tQsIuBkyjjBr8vEDS9SFzO1HG +i2u10i0tUWaud7O50EFaae/zgz5NZoo0dPuRMmZkYF0ijTqYKys7z1uDTBLzorSh +LwSLAoGADYmpZzOAnUUFJmE9ldtIU1xmBSi/smKNjb4OdTh6wCUTYkCowLnzFCbH +yRyfe2m7r7GPDXWWk2cJXINW9gSlT6G2OLfcUxKuMDiIVfAGC1TIMDn+Xtd3ElHb +zTNgmqoE3ki2bYwByNgogipRO/Eyrkimpv439p9Y0psgvRVrc78= +-----END RSA PRIVATE KEY----- diff --git a/test/fixtures/ssh/sshd_config b/test/fixtures/ssh/sshd_config new file mode 100644 index 0000000..cb8bff9 --- /dev/null +++ b/test/fixtures/ssh/sshd_config @@ -0,0 +1,116 @@ +# $OpenBSD: sshd_config,v 1.102 2018/02/16 02:32:40 djm Exp $ + +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/bin + +# 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 override the +# default value. + +#Port 22222 +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey /tmp/sshtest/ssh_host_rsa_key +#HostKey /tmp/sshtest/ssh_host_ecdsa_key +#HostKey /tmp/sshtest/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +StrictModes no +#MaxAuthTries 6 +#MaxSessions 10 + +PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +#AuthorizedKeysFile /tmp/sshtest/authorized_keys + +#AuthorizedPrincipalsFile none + +#AuthorizedKeysCommand none +#AuthorizedKeysCommandUser nobody + +# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts +HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +IgnoreUserKnownHosts yes +# Don't read the user's ~/.rhosts and ~/.shosts files +IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +PasswordAuthentication yes +PermitEmptyPasswords yes + +# Change to no to disable s/key passwords +ChallengeResponseAuthentication no +# Kerberos options +#KerberosAuthentication no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes +#KerberosGetAFSToken no + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + +# 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'. +UsePAM yes + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#X11Forwarding no +#X11DisplayOffset 10 +#X11UseLocalhost yes +#PermitTTY yes +PrintMotd no # pam does that +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +PermitUserEnvironment yes +#Compression delayed +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp /usr/lib/ssh/sftp-server + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# X11Forwarding no +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server -- cgit 1.2.3-korg