I would like to disable the PrintLastLog
option for only one run of the ssh
command.
I tried to pass it using the -o
option:
ssh -q -o PrintLastLog=no localhost
but I get:
command-line: line 0: Bad configuration option: printlastlog
I also don't see the PrintLastLog
option in the SSH_CONFIG(5)
man
file. Are there options that are special and cannot be passed as command line flags?
The reason for the question is that I need to ssh to several servers from a script, and I don't want the MOTD/login message clogging up the log output from the script.
You don't see it there, because it's an option for the sshd daemon, not the client. You can't change server options from the client side.
However, if what you want is to do ssh in a script without doing output, you can simply redirect the output to /dev/null. Example:
When you use SSH to just issue a command, the only output you will get is from that command - you won't get the MOTD or the banner. And since you're redirecting that output to /dev/null, you're getting nothing.