Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DroboApp HOWTO: openssh 5.8p1
02-24-2011, 12:10 PM (This post was last modified: 02-24-2011 12:25 PM by ricardo.)
Post: #11
RE: DroboApp HOWTO: openssh 5.8p1
(02-24-2011 10:25 AM)leetlamer Wrote:  I installed the new version but I still can't seem to start it...

Code:
# /mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh start  
uid=1(sshd) gid=1(sshd) groups=1(sshd)
# /mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status
openssh is enabled and stopped

I try and start it but it stays stopped.

But is it actually running? I.e., can you please check the output of "ps w"?



Ugh. I found another two bugs on service.sh. I forgot to declare the location of the PID file, thus causing the "stopped" part.

Also, the ownership of the log file was not properly defined, so sshd was not able to write to the log file.

Fixed file at the same download location as before (http://commondatastorage.googleapis.com/...http://commondatastorage.googleapis.com/drobofs/openssh-5
Find all posts by this user
Quote this message in a reply
02-24-2011, 12:17 PM
Post: #12
RE: DroboApp HOWTO: openssh 5.8p1
Code:
# ps w
  PID USER       VSZ STAT COMMAND
    1 root      3032 S    init      
    2 root         0 SW<  [kthreadd]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW<  [watchdog/0]
    5 root         0 SW<  [events/0]
    6 root         0 SW<  [khelper]
   28 root         0 SW<  [kblockd/0]
   43 root         0 SW   [pdflush]
   44 root         0 SW   [pdflush]
   45 root         0 SW<  [kswapd0]
   46 root         0 SW<  [aio/0]
   47 root         0 SW   [crypto]
   48 root         0 SW   [crypto_ret]
  180 root         0 SW<  [dri_dnas_thread]
  183 root         0 SW<  [mtdblockd]
  184 root         0 SW<  [nftld]
  195 root         0 SWN  [jffs2_gcd_mtd1]
  203 root         0 SWN  [jffs2_gcd_mtd2]
  238 root      3032 S    udhcpc -s /etc/udhcpc.sh -b
  242 root      2004 S    /bin/ntpclient -l -h pool.ntp.org
  245 root      1584 S    /sbin/netplugd -P
  254 root      3036 S    /bin/sh /usr/bin/nasdLogRotate
  256 root     11600 S    /usr/bin/nasd
  257 root      3036 S    -/bin/sh
  272 root         0 SW<  [dri_shared_res_]
  273 root         0 SW<  [dri_scsi_resp_2]
  274 root         0 SW<  [dri_scsi_req_3]
  276 root         0 SW<  [scsi_eh_0]
  296 root         0 SW<  [kjournald]
  325 root      5420 S    /sbin/nmbd -s /mnt/DroboFS/System/samba/conf/smb.conf
  327 root     10004 S    /sbin/smbd -s /mnt/DroboFS/System/samba/conf/smb.conf
  328 root     10004 S    /sbin/smbd -s /mnt/DroboFS/System/samba/conf/smb.conf
  340 avahi     2688 S    avahi-daemon: running [Drobo-FS.local]                                  
  342 root      2580 S    /sbin/cnid_metad
  344 root      5872 S    /sbin/afpd -F /mnt/DroboFS/System/netatalk/conf/afpd.conf -P /mnt/DroboFS/System/netatalk/security/afpd.pi
  393 root     11196 S    /mnt/DroboFS/Shares/DroboApps/apache/httpd -f /mnt/DroboFS/Shares/DroboApps/apache/conf/httpd.conf
  481 root     11328 S    /mnt/DroboFS/Shares/DroboApps/apache/httpd -f /mnt/DroboFS/Shares/DroboApps/apache/conf/httpd.conf
  504 root     11328 S    /mnt/DroboFS/Shares/DroboApps/apache/httpd -f /mnt/DroboFS/Shares/DroboApps/apache/conf/httpd.conf
  797 root     41564 S    /mnt/DroboFS/Shares/DroboApps/transmission/transmission-daemon -g /mnt/DroboFS/Shares/DroboApps/transmissi
10632 root      2020 S    /sbin/dropbear -E -P /mnt/DroboFS/Shares/DroboApps/dropbear/dropbear.pid -r /mnt/DroboFS/Shares/DroboApps/
11425 root      2500 S    /sbin/dropbear -E -P /mnt/DroboFS/Shares/DroboApps/dropbear/dropbear.pid -r /mnt/DroboFS/Shares/DroboApps/
11427 root      2900 S    sleep 30
11428 root      3036 S    -sh
11429 root      3036 R    ps w

Not running :/
Find all posts by this user
Quote this message in a reply
02-24-2011, 04:55 PM
Post: #13
RE: DroboApp HOWTO: openssh 5.8p1
Thanks for your patience. I have fixed a couple more things in service.sh, and a new version is online at the same address.

Could you please give this one a try? I finally upgraded my FS to firmware 1.1.1 and found myself in a situation where openssh would also not start. I think that the fixes I added now should make it work, since I managed to get myself back in. Smile
Find all posts by this user
Quote this message in a reply
02-24-2011, 06:24 PM
Post: #14
RE: DroboApp HOWTO: openssh 5.8p1
I've been following along and experiencing the same problems. Your most recent update appears to fixed my previous issues and I am now able to login. Thanks!
Find all posts by this user
Quote this message in a reply
02-24-2011, 07:06 PM
Post: #15
RE: DroboApp HOWTO: openssh 5.8p1
Haha, still won't start for me. I appreciate your help!

Code:
# /mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status
openssh is enabled and stopped
# /mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh start
# /mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status
openssh is enabled and stopped
# /mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh restart
no sshd found; none killed
/mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status
# /mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status
openssh is enabled and stopped

Code:
# ps w
  PID USER       VSZ STAT COMMAND
    1 root      3032 S    init      
    2 root         0 SW<  [kthreadd]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW<  [watchdog/0]
    5 root         0 SW<  [events/0]
    6 root         0 SW<  [khelper]
   28 root         0 SW<  [kblockd/0]
   43 root         0 SW   [pdflush]
   44 root         0 SW   [pdflush]
   45 root         0 SW<  [kswapd0]
   46 root         0 SW<  [aio/0]
   47 root         0 SW   [crypto]
   48 root         0 SW   [crypto_ret]
  180 root         0 SW<  [dri_dnas_thread]
  183 root         0 SW<  [mtdblockd]
  184 root         0 SW<  [nftld]
  195 root         0 SWN  [jffs2_gcd_mtd1]
  203 root         0 SWN  [jffs2_gcd_mtd2]
  239 root      3032 S    udhcpc -s /etc/udhcpc.sh -b
  243 root      2004 S    /bin/ntpclient -l -h pool.ntp.org
  246 root      1584 S    /sbin/netplugd -P
  255 root      3036 S    /bin/sh /usr/bin/nasdLogRotate
  257 root     10128 S    /usr/bin/nasd
  258 root      3036 S    -/bin/sh
  273 root         0 SW<  [dri_shared_res_]
  274 root         0 SW<  [dri_scsi_resp_2]
  275 root         0 SW<  [dri_scsi_req_3]
  277 root         0 SW<  [scsi_eh_0]
  297 root         0 SW<  [kjournald]
  326 root      5420 S    /sbin/nmbd -s /mnt/DroboFS/System/samba/conf/smb.conf
  328 root     10004 S    /sbin/smbd -s /mnt/DroboFS/System/samba/conf/smb.conf
  329 root     10004 S    /sbin/smbd -s /mnt/DroboFS/System/samba/conf/smb.conf
  341 avahi     2688 S    avahi-daemon: running [Drobo-FS.local]                                  
  343 root      2580 S    /sbin/cnid_metad
  345 root      5872 S    /sbin/afpd -F /mnt/DroboFS/System/netatalk/conf/afpd.conf -P /mnt/DroboFS/System/netatalk/security/afpd.pi
  367 root     29764 S    /mnt/DroboFS/Shares/DroboApps/transmission/transmission-daemon -g /mnt/DroboFS/Shares/DroboApps/transmissi
  461 root     11196 S    /mnt/DroboFS/Shares/DroboApps/apache/httpd -f /mnt/DroboFS/Shares/DroboApps/apache/conf/httpd.conf
  484 root     11328 S    /mnt/DroboFS/Shares/DroboApps/apache/httpd -f /mnt/DroboFS/Shares/DroboApps/apache/conf/httpd.conf
  495 root     10196 S    /sbin/smbd -s /mnt/DroboFS/System/samba/conf/smb.conf
  504 root     11328 S    /mnt/DroboFS/Shares/DroboApps/apache/httpd -f /mnt/DroboFS/Shares/DroboApps/apache/conf/httpd.conf
  814 root      2020 S    /sbin/dropbear -E -P /mnt/DroboFS/Shares/DroboApps/dropbear/dropbear.pid -r /mnt/DroboFS/Shares/DroboApps/
  822 root      2500 S    /sbin/dropbear -E -P /mnt/DroboFS/Shares/DroboApps/dropbear/dropbear.pid -r /mnt/DroboFS/Shares/DroboApps/
  823 root      3036 S    -sh
  887 root      2900 S    sleep 30
  902 root      3036 R    ps w
Find all posts by this user
Quote this message in a reply
02-25-2011, 02:59 AM
Post: #16
RE: DroboApp HOWTO: openssh 5.8p1
(02-24-2011 07:06 PM)leetlamer Wrote:  Haha, still won't start for me. I appreciate your help!

I'm stumped. Short of telling you to remove openssh completely, restarting from scratch, and not forgetting to set a different port on etc/sshd_config, I have no idea what could be wrong with your setup.

Can you please post /var/log/nasd.log and sshd.log (in the openssh folder)? Be careful to remove any personal info from nasd.log (the serial number of your Drobo is there, if I remember correctly).
Find all posts by this user
Quote this message in a reply
02-25-2011, 09:36 AM
Post: #17
RE: DroboApp HOWTO: openssh 5.8p1
(02-25-2011 02:59 AM)ricardo Wrote:  
(02-24-2011 07:06 PM)leetlamer Wrote:  Haha, still won't start for me. I appreciate your help!

I'm stumped. Short of telling you to remove openssh completely, restarting from scratch, and not forgetting to set a different port on etc/sshd_config, I have no idea what could be wrong with your setup.

Can you please post /var/log/nasd.log and sshd.log (in the openssh folder)? Be careful to remove any personal info from nasd.log (the serial number of your Drobo is there, if I remember correctly).

I was having the same problem and sshd.log showed that /var/empty had missing privilege... I checked and the directory didn't exist so I created it and started the service.
Find all posts by this user
Quote this message in a reply
02-25-2011, 10:05 AM
Post: #18
RE: DroboApp HOWTO: openssh 5.8p1
(02-25-2011 09:36 AM)Ramorous Wrote:  I was having the same problem and sshd.log showed that /var/empty had missing privilege... I checked and the directory didn't exist so I created it and started the service.

Thanks Ramorous! I have updated service.sh to check for the existence and privileges of /var/empty.

This is what it looks like now:
Code:
#!/bin/sh
#
# openSSH service

. /etc/service.subr

prog_dir=`dirname \`realpath $0\``

name="openssh"                          # service name
version="5.8p1"                         # program version

pidfile=/var/run/sshd.pid               # location of the pid file
logfile=${prog_dir}/sshd.log            # location of log file
rsakey=${prog_dir}/etc/ssh_host_rsa_key # location of rsa key
dsakey=${prog_dir}/etc/ssh_host_dsa_key # location of dsa key
ecdsakey=${prog_dir}/etc/ssh_host_ecdsa_key # location of ecdsa key
sshd_user=sshd
sshd_group=sshd

start()
{
  # make sure /dev/null is non-root writeable
  chmod a+rw /dev/null

  # make sure /var/empty is properly setup for privilege separation
  mkdir -f /var/empty
  chmod 755 /var/empty

  # make sure that we have the sshd user for privilege separation
  id ${sshd_user} > /dev/null 2>&1
  if [ 0 -ne $? ]; then
    adduser -S -D -H -h "/var/empty" -s "/bin/false" ${sshd_user}
  fi

  # make sure sshd owns the log file
  chown ${sshd_user}.${sshd_group} ${logfile}

  # make sure that the RSA key exists
  if [ ! -f $rsakey ]; then
    ${prog_dir}/bin/ssh-keygen -t rsa -f ${rsakey} -N ""
  fi

  # make sure that the DSA key exists
  if [ ! -f $dsakey ]; then
    ${prog_dir}/bin/ssh-keygen -t dsa -f ${dsakey} -N ""
  fi

  # make sure the ECDSA key exists
  if [ ! -f $ecdsakey ]; then
    ${prog_dir}/bin/ssh-keygen -t ecdsa -f ${ecdsakey} -N ""
  fi

  # add sshd to the path
  if ! which sshd; then
    export PATH=$PATH:${prog_dir}/sbin
  fi

  # add ssh/scp/sftp to the path
  if ! which slogin; then
    export PATH=$PATH:${prog_dir}/bin
  fi

  ${prog_dir}/sbin/sshd -e > ${logfile} 2>&1
}


case "$1" in
  start)
    start_service
    ;;
  stop)
    #stop_service
    /sbin/start-stop-daemon -K -n sshd
    ;;
  restart)
    #stop_service
    /sbin/start-stop-daemon -K -n sshd
    sleep 3
    start_service
    ;;
  status)
    status
    ;;
  *)
    echo "Usage: $0 [start|stop|restart|status]"
    exit 1
    ;;
esac

@leetlamer: maybe this time we finally get this working? Try again from http://commondatastorage.googleapis.com/...http://commondatastorage.googleapis.com/drobofs/openssh

Cheers,
Ricardo
Find all posts by this user
Quote this message in a reply
02-25-2011, 08:40 PM (This post was last modified: 02-25-2011 08:41 PM by leetlamer.)
Post: #19
RE: DroboApp HOWTO: openssh 5.8p1
Strange. Now I'm getting file not found. Its acting strange.

Code:
# cd ~
# ls
Shares    System    home      swapfile
# mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status
-sh: mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh: not found

Strange, that never happened to me before. The file totally exists, and I noticed that when I cd to the root directory, and I run the command it works. But shouldn't it not matter, since you specify an absolute path, so it would work no matter where the current directory is? Well, it seems to behave differently than before, but I'm a unix noob.

Also I get a pretty strange error:

Code:
# mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status
openssh is enabled and stopped
# mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh start
mkdir: invalid option -- f
BusyBox v1.14.2 (2009-07-29 17:47:47 PDT) multi-call binary

Usage: mkdir [OPTION] DIRECTORY...

Create DIRECTORY

Options:
    -m    Set permission mode (as in chmod), not rwxrwxrwx - umask
    -p    No error if existing, make parent directories as needed

chmod: /var/empty: No such file or directory

Also, I tried manually creating /var/empty since it didn't exist, and I tried to chmod a+rwx but I got no such file or directory.
Find all posts by this user
Quote this message in a reply
02-26-2011, 03:23 AM
Post: #20
RE: DroboApp HOWTO: openssh 5.8p1
(02-25-2011 08:40 PM)leetlamer Wrote:  # mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status

You missed the "/" before "mnt". In other words, you should have typed "/mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status" instead of "mnt/DroboFS/Shares/DroboApps/openssh-5.8p1/service.sh status". If you do not type the "/" at the beginning, the command line think you are talking about a path starting where you are right now, instead of an absolute path.

(02-25-2011 08:40 PM)leetlamer Wrote:  Also I get a pretty strange error:

Yeah... about that. My bad, busybox has a different syntax than traditional linux. It should have been a -p instead.

(02-25-2011 08:40 PM)leetlamer Wrote:  Also, I tried manually creating /var/empty since it didn't exist, and I tried to chmod a+rwx but I got no such file or directory.

Maybe the lacking of a starting "/"?

Anyway, as usual new version at the same url.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: