Bug 2785

Summary: Add -P ssh option as alias for -p to set the port
Product: Portable OpenSSH Reporter: Dan MacDonald <allcoms>
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED WONTFIX    
Severity: enhancement CC: djm, dtucker
Priority: P5    
Version: 7.6p1   
Hardware: Other   
OS: All   

Description Dan MacDonald 2017-09-27 23:20:52 AEST
Arguably the second most popular SSH util after ssh itself is scp. Confusingly (especially for newcomers) ssh uses -p to set the port to use whilst scp uses -P.

I've been using Linux for 21 years now but I still make the mistake of getting the case of these options wrong. As far as I can see, -P isn't currently being used as an option by ssh so I would like to see it added as an alias / alternative to using -p so as to match with scp.

PS I've made a lot of feature requests in my time but this one took me the longest to actually get around to. I'm sure its been secretly annoying thousands of other sysadmins for decades too! :)

Thanks ssh team!
Comment 1 Darren Tucker 2017-09-28 07:10:36 AEST
It is actually used in ssh although it's for a deprecated option:

$ grep -C1 "'P'" ssh.c
			break;
		case 'P':	/* deprecated */
			options.use_privileged_port = 0;


-oport=N works on both, though.
Comment 2 Damien Miller 2021-04-23 14:58:10 AEST
closing resolved bugs as of 8.6p1 release