summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh/openssh
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-02-28 16:37:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-02 17:25:27 +0000
commit1964da1b483d58955abafa6119c4035f9444d86b (patch)
treeb1a38b008d5f8da8c3e923ffa54458baf4ae3324 /meta/recipes-connectivity/openssh/openssh
parent8f36e1ef1afd10594391596391564e8904a840f2 (diff)
downloadpoky-1964da1b483d58955abafa6119c4035f9444d86b.tar.gz
openssh: upgrade to 6.5p1
(From OE-Core rev: ea86d4ccc56f7933f988f0b24f09c5b6888d51ed) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh')
-rw-r--r--meta/recipes-connectivity/openssh/openssh/init108
-rw-r--r--meta/recipes-connectivity/openssh/openssh/nostrip.patch20
-rw-r--r--meta/recipes-connectivity/openssh/openssh/openssh-CVE-2011-4327.patch29
-rw-r--r--meta/recipes-connectivity/openssh/openssh/ssh_config46
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshd10
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshd.socket10
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshd@.service10
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshd_config119
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service10
-rw-r--r--meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd1
10 files changed, 363 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/init b/meta/recipes-connectivity/openssh/openssh/init
new file mode 100644
index 0000000000..e7f3971324
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/init
@@ -0,0 +1,108 @@
1#! /bin/sh
2set -e
3
4# source function library
5. /etc/init.d/functions
6
7# /etc/init.d/ssh: start and stop the OpenBSD "secure shell" daemon
8
9test -x /usr/sbin/sshd || exit 0
10( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0
11
12# /etc/default/ssh may set SYSCONFDIR and SSHD_OPTS
13if test -f /etc/default/ssh; then
14 . /etc/default/ssh
15fi
16
17[ -z "$SYSCONFDIR" ] && SYSCONFDIR=/etc/ssh
18mkdir -p $SYSCONFDIR
19
20HOST_KEY_RSA=$SYSCONFDIR/ssh_host_rsa_key
21HOST_KEY_DSA=$SYSCONFDIR/ssh_host_dsa_key
22HOST_KEY_ECDSA=$SYSCONFDIR/ssh_host_ecdsa_key
23
24check_for_no_start() {
25 # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
26 if [ -e $SYSCONFDIR/sshd_not_to_be_run ]; then
27 echo "OpenBSD Secure Shell server not in use ($SYSCONFDIR/sshd_not_to_be_run)"
28 exit 0
29 fi
30}
31
32check_privsep_dir() {
33 # Create the PrivSep empty dir if necessary
34 if [ ! -d /var/run/sshd ]; then
35 mkdir /var/run/sshd
36 chmod 0755 /var/run/sshd
37 fi
38}
39
40check_config() {
41 /usr/sbin/sshd -t || exit 1
42}
43
44check_keys() {
45 # create keys if necessary
46 if [ ! -f $HOST_KEY_RSA ]; then
47 echo " generating ssh RSA key..."
48 ssh-keygen -q -f $HOST_KEY_RSA -N '' -t rsa
49 fi
50 if [ ! -f $HOST_KEY_ECDSA ]; then
51 echo " generating ssh ECDSA key..."
52 ssh-keygen -q -f $HOST_KEY_ECDSA -N '' -t ecdsa
53 fi
54 if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
55 echo " generating ssh DSA key..."
56 ssh-keygen -q -f $HOST_KEY_DSA -N '' -t dsa
57 fi
58}
59
60export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
61
62case "$1" in
63 start)
64 check_for_no_start
65 echo "Starting OpenBSD Secure Shell server: sshd"
66 check_keys
67 check_privsep_dir
68 start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS
69 echo "done."
70 ;;
71 stop)
72 echo -n "Stopping OpenBSD Secure Shell server: sshd"
73 start-stop-daemon -K -x /usr/sbin/sshd
74 echo "."
75 ;;
76
77 reload|force-reload)
78 check_for_no_start
79 check_keys
80 check_config
81 echo -n "Reloading OpenBSD Secure Shell server's configuration"
82 start-stop-daemon -K -s 1 -x /usr/sbin/sshd
83 echo "."
84 ;;
85
86 restart)
87 check_keys
88 check_config
89 echo -n "Restarting OpenBSD Secure Shell server: sshd"
90 start-stop-daemon -K --oknodo -x /usr/sbin/sshd
91 check_for_no_start
92 check_privsep_dir
93 sleep 2
94 start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS
95 echo "."
96 ;;
97
98 status)
99 status /usr/sbin/sshd
100 exit $?
101 ;;
102
103 *)
104 echo "Usage: /etc/init.d/ssh {start|stop|status|reload|force-reload|restart}"
105 exit 1
106esac
107
108exit 0
diff --git a/meta/recipes-connectivity/openssh/openssh/nostrip.patch b/meta/recipes-connectivity/openssh/openssh/nostrip.patch
new file mode 100644
index 0000000000..33111f5494
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/nostrip.patch
@@ -0,0 +1,20 @@
1Disable stripping binaries during make install.
2
3Upstream-Status: Inappropriate [configuration]
4
5Build system specific.
6
7Signed-off-by: Scott Garman <scott.a.garman@intel.com>
8
9diff -ur openssh-5.6p1.orig/Makefile.in openssh-5.6p1/Makefile.in
10--- openssh-5.6p1.orig/Makefile.in 2010-05-11 23:51:39.000000000 -0700
11+++ openssh-5.6p1/Makefile.in 2010-08-30 16:49:54.000000000 -0700
12@@ -29,7 +29,7 @@
13 RAND_HELPER=$(libexecdir)/ssh-rand-helper
14 PRIVSEP_PATH=@PRIVSEP_PATH@
15 SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@
16-STRIP_OPT=@STRIP_OPT@
17+STRIP_OPT=
18
19 PATHS= -DSSHDIR=\"$(sysconfdir)\" \
20 -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \
diff --git a/meta/recipes-connectivity/openssh/openssh/openssh-CVE-2011-4327.patch b/meta/recipes-connectivity/openssh/openssh/openssh-CVE-2011-4327.patch
new file mode 100644
index 0000000000..30c11cf432
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/openssh-CVE-2011-4327.patch
@@ -0,0 +1,29 @@
1openssh-CVE-2011-4327
2
3A security flaw was found in the way ssh-keysign,
4a ssh helper program for host based authentication,
5attempted to retrieve enough entropy information on configurations that
6lacked a built-in entropy pool in OpenSSL (a ssh-rand-helper program would
7be executed to retrieve the entropy from the system environment).
8A local attacker could use this flaw to obtain unauthorized access to host keys
9via ptrace(2) process trace attached to the 'ssh-rand-helper' program.
10
11https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-4327
12http://www.openssh.com/txt/portable-keysign-rand-helper.adv
13
14Upstream-Status: Pending
15
16Signed-off-by: Li Wang <li.wang@windriver.com>
17--- a/ssh-keysign.c
18+++ b/ssh-keysign.c
19@@ -170,6 +170,10 @@
20 key_fd[i++] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
21 key_fd[i++] = open(_PATH_HOST_ECDSA_KEY_FILE, O_RDONLY);
22 key_fd[i++] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
23+ if (fcntl(key_fd[0], F_SETFD, FD_CLOEXEC) != 0 ||
24+ fcntl(key_fd[1], F_SETFD, FD_CLOEXEC) != 0 ||
25+ fcntl(key_fd[2], F_SETFD, FD_CLOEXEC) != 0)
26+ fatal("fcntl failed");
27
28 original_real_uid = getuid(); /* XXX readconf.c needs this */
29 if ((pw = getpwuid(original_real_uid)) == NULL)
diff --git a/meta/recipes-connectivity/openssh/openssh/ssh_config b/meta/recipes-connectivity/openssh/openssh/ssh_config
new file mode 100644
index 0000000000..4a4a649ba8
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/ssh_config
@@ -0,0 +1,46 @@
1# $OpenBSD: ssh_config,v 1.25 2009/02/17 01:28:32 djm Exp $
2
3# This is the ssh client system-wide configuration file. See
4# ssh_config(5) for more information. This file provides defaults for
5# users, and the values can be changed in per-user configuration files
6# or on the command line.
7
8# Configuration data is parsed as follows:
9# 1. command line options
10# 2. user-specific file
11# 3. system-wide file
12# Any configuration value is only changed the first time it is set.
13# Thus, host-specific definitions should be at the beginning of the
14# configuration file, and defaults at the end.
15
16# Site-wide defaults for some commonly used options. For a comprehensive
17# list of available options, their meanings and defaults, please see the
18# ssh_config(5) man page.
19
20Host *
21 ForwardAgent yes
22 ForwardX11 yes
23# RhostsRSAAuthentication no
24# RSAAuthentication yes
25# PasswordAuthentication yes
26# HostbasedAuthentication no
27# GSSAPIAuthentication no
28# GSSAPIDelegateCredentials no
29# BatchMode no
30# CheckHostIP yes
31# AddressFamily any
32# ConnectTimeout 0
33# StrictHostKeyChecking ask
34# IdentityFile ~/.ssh/identity
35# IdentityFile ~/.ssh/id_rsa
36# IdentityFile ~/.ssh/id_dsa
37# Port 22
38# Protocol 2,1
39# Cipher 3des
40# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
41# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
42# EscapeChar ~
43# Tunnel no
44# TunnelDevice any:any
45# PermitLocalCommand no
46# VisualHostKey no
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd b/meta/recipes-connectivity/openssh/openssh/sshd
new file mode 100644
index 0000000000..4882e58b48
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd
@@ -0,0 +1,10 @@
1#%PAM-1.0
2
3auth include common-auth
4account required pam_nologin.so
5account include common-account
6password include common-password
7session optional pam_keyinit.so force revoke
8session include common-session
9session required pam_loginuid.so
10
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd.socket b/meta/recipes-connectivity/openssh/openssh/sshd.socket
new file mode 100644
index 0000000000..12c39b26b5
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd.socket
@@ -0,0 +1,10 @@
1[Unit]
2Conflicts=sshd.service
3
4[Socket]
5ExecStartPre=@BASE_BINDIR@/mkdir -p /var/run/sshd
6ListenStream=22
7Accept=yes
8
9[Install]
10WantedBy=sockets.target
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd@.service b/meta/recipes-connectivity/openssh/openssh/sshd@.service
new file mode 100644
index 0000000000..4eda6592f5
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd@.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=OpenSSH Per-Connection Daemon
3Wants=sshdgenkeys.service
4After=sshdgenkeys.service
5
6[Service]
7ExecStart=-@SBINDIR@/sshd -i
8ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
9StandardInput=socket
10StandardError=syslog
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd_config b/meta/recipes-connectivity/openssh/openssh/sshd_config
new file mode 100644
index 0000000000..4f9b626fbd
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd_config
@@ -0,0 +1,119 @@
1# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
2
3# This is the sshd server system-wide configuration file. See
4# sshd_config(5) for more information.
5
6# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
7
8# The strategy used for options in the default sshd_config shipped with
9# OpenSSH is to specify options with their default value where
10# possible, but leave them commented. Uncommented options change a
11# default value.
12
13#Port 22
14#AddressFamily any
15#ListenAddress 0.0.0.0
16#ListenAddress ::
17
18# Disable legacy (protocol version 1) support in the server for new
19# installations. In future the default will change to require explicit
20# activation of protocol 1
21Protocol 2
22
23# HostKey for protocol version 1
24#HostKey /etc/ssh/ssh_host_key
25# HostKeys for protocol version 2
26#HostKey /etc/ssh/ssh_host_rsa_key
27#HostKey /etc/ssh/ssh_host_dsa_key
28
29# Lifetime and size of ephemeral version 1 server key
30#KeyRegenerationInterval 1h
31#ServerKeyBits 1024
32
33# Logging
34# obsoletes QuietMode and FascistLogging
35#SyslogFacility AUTH
36#LogLevel INFO
37
38# Authentication:
39
40#LoginGraceTime 2m
41#PermitRootLogin yes
42#StrictModes yes
43#MaxAuthTries 6
44#MaxSessions 10
45
46#RSAAuthentication yes
47#PubkeyAuthentication yes
48#AuthorizedKeysFile .ssh/authorized_keys
49
50# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
51#RhostsRSAAuthentication no
52# similar for protocol version 2
53#HostbasedAuthentication no
54# Change to yes if you don't trust ~/.ssh/known_hosts for
55# RhostsRSAAuthentication and HostbasedAuthentication
56#IgnoreUserKnownHosts no
57# Don't read the user's ~/.rhosts and ~/.shosts files
58#IgnoreRhosts yes
59
60# To disable tunneled clear text passwords, change to no here!
61#PasswordAuthentication yes
62#PermitEmptyPasswords no
63
64# Change to no to disable s/key passwords
65#ChallengeResponseAuthentication yes
66
67# Kerberos options
68#KerberosAuthentication no
69#KerberosOrLocalPasswd yes
70#KerberosTicketCleanup yes
71#KerberosGetAFSToken no
72
73# GSSAPI options
74#GSSAPIAuthentication no
75#GSSAPICleanupCredentials yes
76
77# Set this to 'yes' to enable PAM authentication, account processing,
78# and session processing. If this is enabled, PAM authentication will
79# be allowed through the ChallengeResponseAuthentication and
80# PasswordAuthentication. Depending on your PAM configuration,
81# PAM authentication via ChallengeResponseAuthentication may bypass
82# the setting of "PermitRootLogin without-password".
83# If you just want the PAM account and session checks to run without
84# PAM authentication, then enable this but set PasswordAuthentication
85# and ChallengeResponseAuthentication to 'no'.
86#UsePAM no
87
88#AllowAgentForwarding yes
89#AllowTcpForwarding yes
90#GatewayPorts no
91#X11Forwarding no
92#X11DisplayOffset 10
93#X11UseLocalhost yes
94#PrintMotd yes
95#PrintLastLog yes
96#TCPKeepAlive yes
97#UseLogin no
98UsePrivilegeSeparation yes
99#PermitUserEnvironment no
100Compression no
101ClientAliveInterval 15
102ClientAliveCountMax 4
103#UseDNS yes
104#PidFile /var/run/sshd.pid
105#MaxStartups 10
106#PermitTunnel no
107#ChrootDirectory none
108
109# no default banner path
110#Banner none
111
112# override default of no subsystems
113Subsystem sftp /usr/libexec/sftp-server
114
115# Example of overriding settings on a per-user basis
116#Match User anoncvs
117# X11Forwarding no
118# AllowTcpForwarding no
119# ForceCommand cvs server
diff --git a/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service b/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
new file mode 100644
index 0000000000..c21d70baf0
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=OpenSSH Key Generation
3ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
4ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
5ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
6
7[Service]
8ExecStart=@BINDIR@/ssh-keygen -A
9Type=oneshot
10RemainAfterExit=yes
diff --git a/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd b/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd
new file mode 100644
index 0000000000..122320a719
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd
@@ -0,0 +1 @@
d root root 0755 /var/run/sshd none