I use openssh
every day, be it the ssh
command for connecting to remote hosts, or the scp
command for uploading/downloading files.
Once a day, or more, I forget that scp
uses the non-obvious -P
flag for specifying the port, not the -p
flag that ssh
uses.
Enough is enough. I shall not file a bug report against the Debian openssh-client page, because no doubt compatibility with both upstream, and other distributions, is important. But damnit I've had enough.
apt-get source openssh-client
shows the appropriate code:
fflag = tflag = 0;
while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q12346S:o:F:")) != -1)
switch (ch) {
..
..
case 'P':
addargs(&remote_remote_args, "-p");
addargs(&remote_remote_args, "%s", optarg);
addargs(&args, "-p");
addargs(&args, "%s", optarg);
break;
..
..
case 'p':
pflag = 1;
break;
..
..
..
Swapping those two flags around, and updating the format string appropriately, was sufficient to do the necessary.
In other news I've done some hardware development, using both Arduino boards and the WeMos D1-mini. I'm still at the stage where I'm flashing lights, and doing similarly trivial things:
- Absolute Arduino Basic Tutorial
- Recognizing the board.
- Getting the development environment setup.
- Running your first project.
- Absolute WeMos D1 Mini (ESP8266) Basic Tutorial
- Recognizing the board.
- Getting the development environment setup.
- Installing the libraries/headers/examples
- Writing your first WiFi project.
I have more complex projects planned for the future, but these are on-hold until the appropriate parts are delivered:
- MP3 playback.
- Bluetooth-speakers.
- Washing machine alarm.
- LCD clock, with time set by NTP, and relay control.
Even with a few LEDs though I've had fun, for example writing a trivial binary display.
Tags: openssh, scp, ssh 4 comments
As an alternative that doesn't require rebuilding openssh-client, you could put the following script into your
$PATH
asscp
, ahead of/usr/bin
: