Quote Originally Posted by kl522 View Post
Just because there is a script /usr/sbin/sshstart created, it does not make /etc/init.d/ssh less guilty of a bug. /etc/init.d/ssh is meant to be invoked, manually or from boot, for the fact that it is located in /etc/init.d, however less friendly it is.

If you look at the script /etc/init.d/ssh, somewhere line 26,
Code:
if [ -n "$2" ]; then
      SSHD_OPTS="$SSHD_OPTS $2"
fi
Now we know '$1' is 'start', 'stop' or 'restart'. It will be everybody's guess what is '$2' supposed to be. But whatever it is, according to this script, it is supposed to accept some kind of SSHD_OPTS but the problem is that it is only accepting single argument, $2, that's why there is an error when invoked as '/etc/init.d/ssh start -p 22' while '/etc/init.d/ssh start "-p 22"' will not have error.
I changed the command that the shortcut runs to:

Code:
/usr/sbin/sshstart "-p 512"
I then ran it, but it's still using port 22:

Code:
knoppix@Microknoppix:~$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      4926/sshd       
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      3050/cupsd      
knoppix@Microknoppix:~$
Is there anyway to change the port?
-Charlie