ssh illegal option while trying to connect to remote server

ir flag

trying to ssh from my macbook pro, to a remote server,

ssh ayan@ServerIPAddress

gives the following error

ssh: illegal option -- ?
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command [argument ...]]

I am unable to to locate the source of this error. I deleted the whole ~/.ssh/* directory and infact any argument after ssh is throwing error. If I tried ssh i.e. without any arguments starting with - then it asks for password, but after it doesnot connect and keeps asking for the password repetatively.

pt flag
Are you **sure** that contains the login password? Normally, the help output from ssh starts with `[-46AaCfGgKkMNnqsTtVvXxYy]`, which is the list of single-letter options supported by the `ssh` command. Otherwise, that command line looks fine, unless you have an alias for the `ssh` command. Does the command `alias ssh` yield any output?
Ayan Mitra avatar
ir flag
@larsks Wow, yeah you are right, it is not my password. Except that my login password also starts with 46 and I carelessly overlooked it. Now about the problem, can you post as a separate answer ? I want to look into your suggestion more in depth. thanks
pt flag
I don't think that "do you have an alias for the `ssh` command?" really counts as an answer. It would be great if you could update your question with answers to my previous comment. If `alias ssh` doesn't show anything, then maybe also throw in the output of `type -a ssh`.
Ayan Mitra avatar
ir flag
`type -a ssh` -> `ssh is /usr/bin/ssh` and `alias ssh` returns empty
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.