Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-27-2010, 05:07 PM   #1
LQ Newbie
Registered: Apr 2010
Posts: 6

Rep: Reputation: 0
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.

Last edited by felixtheratruns; 04-29-2010 at 08:17 AM. Reason: obfuscated hostname
Old 04-28-2010, 09:52 AM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,797

Rep: Reputation: 602Reputation: 602Reputation: 602Reputation: 602Reputation: 602Reputation: 602
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?
Old 04-28-2010, 09:54 AM   #3
Registered: Aug 2002
Posts: 14,751

Rep: Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476
Could be a typo but are you using a small p i.e.
ssh servername -p 1934
Old 04-28-2010, 11:54 AM   #4
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
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
Old 04-29-2010, 08:33 AM   #5
LQ Newbie
Registered: Apr 2010
Posts: 6

Original Poster
Rep: Reputation: 0
/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.

Last edited by felixtheratruns; 04-29-2010 at 08:38 AM.
Old 04-29-2010, 08:57 AM   #6
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.
Old 04-29-2010, 12:01 PM   #7
LQ Newbie
Registered: Apr 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Gosh I feel stupid now. Somehow I thought I had checked that -p but was mistaken. Thank you jschiwal.

Last edited by felixtheratruns; 04-29-2010 at 12:02 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH/Putty Linux Newbee Linux - Networking 1 08-06-2008 01:58 PM
ssh not working from Putty, but works fine from Live CD (Suse of Fedora) jspeed43 Linux - Networking 6 04-29-2008 09:30 AM
[putty&ssh] Who is really good & expert in ssh https tunnelling and firewalling ? Xeratul Linux - General 12 12-03-2006 03:22 AM
SSH and Putty... Linux~Powered Linux - Security 4 06-15-2006 02:50 PM
Problem with remote terminal (ssh and PuTTY) guardian653 *BSD 11 02-09-2005 06:16 AM

All times are GMT -5. The time now is 06:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration