One day I'm going to meet the person who decided the port option in ssh is -p and in scp it's -P.

They will not enjoy this meeting...

@malwarejake Yeah, yesterday I found out that neither work with telnet. (probably for the 1000th time)

@malwarejake

How about not using a switch at all. Take 1.2.3.4:1337 as an address:port combo the way $Dog intended.

@malwarejake legacy of rcp, unfortunately. -p was already taken, and had to be preserved for command line compatibility- symlink rcp to scp, and get strongly authenticated secure connections β€œfor free”.

There’s usually a reason, no matter how annoying it may be.

~/.ssh/config is your friend!

@RoganDawes @malwarejake Thank you for this bit of historical context. I wasn't aware of it, and I appreciate when people provide it.

@RoganDawes

Interesting! How does that interact with the history of ssh use of -p ? Could it have been possible for ssh to choose to stay in sync with scp -P instead?

@malwarejake

@tychotithonus @malwarejake I wanted to accuse rsh of using that for something else already, but I have no evidence of that! So it’s plausible that Tatu Ylonen goofed right at the beginning!

@tychotithonus @RoganDawes @malwarejake Try that argument again with cp(1). πŸ˜‰

Edit: I may have misinterpreted a bit here. πŸ˜€

I would, however, make the point that I'm somewhat sure (but have not yet pinned down specific dates) that ssh was created prior to scp, and probably crafted without any intention of adding a counterpart to rcp, and therefore the conflict with rcp's -p would somewhat reasonably never cross a person's mind.

@RoganDawes @malwarejake I came in to point out that scp's -p is obviously a legacy of cp's -p, but you're absolutely right that rcp is an intermediary step in that.

@RoganDawes @malwarejake And also +1 to ~/.ssh/config; I have a passionate, probably excessive hatred for providing any command-line options for ssh/scp beyond the absolute minimum (ideally just the short hostname define in ~/.ssh/config). -p, -i, a username, ugh. I can't be bothered.

And yes, that also means I never have to do -P for scp. πŸ˜€

@jima @malwarejake I was today years old when I learned that a common pattern was to create a symlink from <hostname> to rsh and/or rlogin. So just by typing the name of your destination host, it would automatically rsh there and execute the rest of the arguments.

I wonder if that works with ssh? πŸ€” Especially with .ssh/config entries to properly configure the target. It does feel like more work than just maintaining the config file, and only saves you 4 characters of typing each time! πŸ˜‚

@RoganDawes @malwarejake I...was also today years old. 🀯

I'm not at a "real" computer ATM, but I'm not seeing an angle to do this with SSH config...but if you symlinked the hostname to a wrapper script, which then called `ssh $0 $*` I think you might achieve the same goal? Maybe? πŸ€”

Thanks for today's learning! I sincerely doubt 10,000 people would ever find out about that today (or care!).

@RoganDawes @malwarejake Actually duh why not just do `alias hostname='ssh hostname'` for each hostname? πŸ€¦πŸ½β€β™‚οΈ

Fewer files, little more process memory, I imagine. Might scale worse, to extremes, but...