-

Originally Posted by
kl522
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Cores / 64gb / Raid / 2x 1Tb
$374.99

Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD
$275.00

Dell PowerEdge R730 Server 2x Xeon E5-2630 V4 64GB DDR4 2TB HDD Rackmount
$489.99

Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Cores | 32gb | HBA330 | 2x 1...
$324.99

Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Core | HBA330 | No RAM or HDD
$149.99

Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2690 v3 | 64gb Ram | 2x 1600W
$524.99

Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2680 v3 | 32gb Ram | 2x 1600W
$409.99

Dell Poweredge R730xd 12LFF 2*2660v4 4*1Gbe h730 2x 750W Server CTO
$248.00

Dell PowerEdge R530 2x E5-2630v4 H330 iDRAC8 Port Card Riser No PSU/RAM/HDD
$99.99

Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 32GB RAM No HDD
$378.93