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...
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...
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!
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?
@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 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...