-   Linux - Server (
-   -   putty ssh works but ssh from terminal does not (

felixtheratruns 04-27-2010 05:07 PM

putty ssh works but ssh from terminal does not
So when I try to connect to my ubuntu server with ssh like this

X@dell-desktop:~$ ssh servername -P 1934
X@servername's password:
Permission denied, please try again.

but when I use putty (yes with the same port number and the same settings)
it works fine. This didn't start happening until my friend did a reinstall on the server, he didn't have a clue as to why it would do this. Any ideas? Thanks.

AlucardZero 04-28-2010 09:52 AM

You missed obfuscating your hostname on the second line.

Does the hostname resolve to the same IP on both dell-desktop and wherever you're running Putty from? What does /var/log/auth.log say on the Ubuntu server?

michaelk 04-28-2010 09:54 AM

Could be a typo but are you using a small p i.e.
ssh servername -p 1934

CoderMan 04-28-2010 11:54 AM

Also, are you using the same username both times? From the linux terminal, if you use ssh it uses the username of the user logged in. Specify the username specifically with the command ssh

felixtheratruns 04-29-2010 08:33 AM

/var/log/auth.log doesn't show my ssh attempts to log in. I also am running putty and ssh from the same machine. I tried logging in with ssh while tailing the log in putty (I was doing this while logging in from the same machine).

I am using a capital P to specify the port in ssh.

I checked the possible problem with the user name, my user name on my laptop is the same as on the server, and even when I specify the username in ssh it just tells me my password is wrong.

jschiwal 04-29-2010 08:57 AM

You should use `-p 1934' to specify the port:

usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
          [-D [bind_address:]port] [-e escape_char] [-F configfile]
          [-i identity_file] [-L [bind_address:]port:host:hostport]
          [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
          [-R [bind_address:]port:host:hostport] [-S ctl_path]
          [-w local_tun[:remote_tun]] [user@]hostname [command]

Unless your version of ssh is different. (I don't know if debian's port uses different options)

Other things to check is the permissions of your home directory, the .ssh directory and your private key.

Try "ssh -vv -p 1934 username@host" to provide more debug feedback on the particular reason for the denial.

The permissions will be checked if the server uses the StrictMode option. If the server can't resolve your hostname, then the UseDNS option can cause a login failure.

felixtheratruns 04-29-2010 12:01 PM

Gosh I feel stupid now. Somehow I thought I had checked that -p but was mistaken. Thank you jschiwal.

All times are GMT -5. The time now is 07:41 PM.