In verbose mode, the client prints messages as it proceeds, providing clues to the problem. New SSH users (and quite a few experienced ones) frequently forget or neglect to use verbose mode when problems arise. Don't hesitate! Many questions we've seen in the Usenet SSH newsgroup, comp.security.ssh [Section 12.3, "Other SSH Resources"], could have been answered immediately by running ssh -v and examining the output. Suppose you just installed your public key on server.example.com and are trying to authenticate with it. Strangely, you are prompted for your login password instead of your public-key passphrase:# SSH1, SSH2, OpenSSH $ ssh -v server.example.com
$ ssh server.example.com
[email protected]'s password:
Don't just sit there scratching your head in wonder. Let
verbose mode come to the rescue:
$ ssh -v server.example.com SSH Version 1.2.27 [sparc-sun-solaris2.5.1], protocol version 1.5. client: Connecting to server.example.com [128.9.176.249] port 22. client: Connection established. client: Trying RSA authentication with key 'barrett@client' client: Remote: Bad file modes for /users/barrett/.ssh Uh oh!
client: Server refused our key.
client: Doing password authentication.
[email protected]'s password:
These messages (which are abbreviated for this example) confirm that
the SSH connection is succeeding, but public-key authentication is
failing. The reason is "bad file modes": the remote SSH
directory, /home/barrett/.ssh, has incorrect
permissions. A quick trip to the server and a well-placed
chmod command later, the problem is solved:
Verbose mode also works for scp :# On the server $ chmod 700 ~/.ssh
Verbose mode is your friend. Use it liberally. Now we're ready to learn those dozens of options.$ scp -v myfile server.example.com: Executing: host belvedere, user (unspecified), command scp -v -t . SSH Version 1.2.27 [sparc-sun-solaris2.5.1], protocol version 1.5. ...
7.2. Precedence | 7.4. Client Configuration in Depth |
Copyright © 2002 O'Reilly & Associates. All rights reserved.