ssh -q doesn't suppress all warning messages

leanne njleanne at hotmail.com
Mon Jan 7 15:58:33 EST 2008


Hi all,
 
One question, the ssh man page says the -q option suppress all warnings and diagnostics. however, the following condition still has the warning message appeared on the console:
 
#man ssh
..............
      -q   Quiet mode.  Causes all warning and diagnostic messages to be           suppressed.
..............
 
 
# ssh -q -i ~/.ssh/id_dsa_3 sshpa3 "uname -a"Warning: Identity file //.ssh/id_dsa_3 not accessible: No such file or directory.
 
I checked the source code that if we use "-q" option, we just set the log level to QUIET, and the above warning message is printed from the -i option:
ssh.c
line 387
  case 'i':   if (stat(optarg, &st) < 0) {    fprintf(stderr, "Warning: Identity file %s "        "not accessible: %s.\n", optarg,        strerror(errno));    break;   }   if (options.num_identity_files >=       SSH_MAX_IDENTITY_FILES)    fatal("Too many identity files specified "        "(max %d)", SSH_MAX_IDENTITY_FILES);   options.identity_files[options.num_identity_files++] =       xstrdup(optarg);   break;
 
So if we can't suppress all warning messages using "-q", should we revise the man page?
_________________________________________________________________
MSN圣诞礼物火热登场,免费发放中,快来领取吧!
http://im.live.cn/emoticons/?ID=18


More information about the openssh-unix-dev mailing list