ssh permission denied

I am trying to connect to my web host via ssh. I can do this on Windows using Putty without issue. However, if I run this on Linux, I receive a “permission denied” when I am prompted for my login and password. It’s obviously making some type of connection, otherwise it wouldn’t be prompting me for authentication.

I initially thought this was a firewall issue. I opened up port 22 and I even tried disabling the firewall altogether. However, I still received this error.

Online I have seen all kinds of resolutions, but not sure where to start first.

I have openSuse 11.3 64-bit.

Any other information I will be happy to provide.

Thanks.

On Mon, 15 Aug 2011 20:36:02 +0530, imterpsfan2
<imterpsfan2@no-mx.forums.opensuse.org> wrote:

>
> I am trying to connect to my web host via ssh. I can do this on Windows
> using Putty without issue. However, if I run this on Linux, I receive a
> “permission denied” when I am prompted for my login and password. It’s
> obviously making some type of connection, otherwise it wouldn’t be
> prompting me for authentication.
>
> I initially thought this was a firewall issue. I opened up port 22 and
> I even tried disabling the firewall altogether. However, I still
> received this error.
>
> Online I have seen all kinds of resolutions, but not sure where to
> start first.
>
> I have openSuse 11.3 64-bit.
>
> Any other information I will be happy to provide.
>

are you sure you are asked for name and password when trying to login? if
you don’t specify a username for your SSH session, it will try to connect
using your user name of the present openSUSE session; and most likely that
isn’t the same user name you have at your webhost.

to login via SSH using a different user name, you have to type

“SSH <webhost username>@<webhost address>”

then it will ask you for the password that that username uses. otherwise
it’ll try to connect as your user name on your linux machine, which is
likely wrong.


phani.

On Mon, 15 Aug 2011 20:42:06 +0530, phanisvara <listmail@phanisvara.com>
wrote:

> On Mon, 15 Aug 2011 20:36:02 +0530, imterpsfan2
> <imterpsfan2@no-mx.forums.opensuse.org> wrote:
>
>>
>> I am trying to connect to my web host via ssh. I can do this on Windows
>> using Putty without issue. However, if I run this on Linux, I receive a
>> “permission denied” when I am prompted for my login and password. It’s
>> obviously making some type of connection, otherwise it wouldn’t be
>> prompting me for authentication.
>>
>> I initially thought this was a firewall issue. I opened up port 22 and
>> I even tried disabling the firewall altogether. However, I still
>> received this error.
>>
>> Online I have seen all kinds of resolutions, but not sure where to
>> start first.
>>
>> I have openSuse 11.3 64-bit.
>>
>> Any other information I will be happy to provide.
>>
>
> are you sure you are asked for name and password when trying to login?
> if you don’t specify a username for your SSH session, it will try to
> connect using your user name of the present openSUSE session; and most
> likely that isn’t the same user name you have at your webhost.
>
> to login via SSH using a different user name, you have to type
>
> “SSH <webhost username>@<webhost address>”
>
> then it will ask you for the password that that username uses.
> otherwise it’ll try to connect as your user name on your linux machine,
> which is likely wrong.
>

sorry, that’s “ssh <webhost username>@<webhost address>” without capitals,
of course.


phani.

The way I was using ssh was this way:

ssh <domain name>

like

ssh somebody.somecompany.com

Then it prompts me for user name: I type the <username>.

Then it prompts me for password: I type <password>.

On Windows, it authenticates me and sends me to the command prompt of the target server. On Linux, I get the message “permission denied.”

I’ll try this method to see if it works…SSH <webhost username>@<webhost address>"

On Mon, 15 Aug 2011 21:56:02 +0530, imterpsfan2
<imterpsfan2@no-mx.forums.opensuse.org> wrote:

> ssh somebody.somecompany.com
> Then it prompts me for user name: I type the <username>.

strange, on openSUSE, when i type just “ssh whatever.com”, it never asks
me for a user name, but tries to log in with the name i have in the
openSUSE session. don’t remember how that used to work on windows.


phani.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> strange, on openSUSE, when i type just “ssh whatever.com”, it never
> asks me for a user name, but tries to log in with the name i have in
> the openSUSE session. don’t remember how that used to work on windows.

It doesn’t work on windows; putty always prompts you.

Good luck.


Want to yell at me in person?
Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOSVQ/AAoJEF+XTK08PnB5ZUwQALWEr9J3MzSepeJh+9e7g9ap
TSxW2PbGGqny/CkcRTCNWVuPCZh4LMKvrs+ZzLfXJndAdIFQVwRZyeii4lWD+H6z
+Th86oDSAxKCCTZLy5yfI7Q6qS/n5lqg6CUxa7ueqwbi7yYOJjcUvcb6bhDtgNUV
YmRbEUc0D7FbFCPHt3czOcq5t9g8gKlrzvbBSkDB8sblqMYRhQqiu3nM4vW+67LA
X5DHXqZoi+5V735ynW10PGF1iz9mdrNBro82jyx3g51+YasqVkrnrHz5UxxOlKSJ
WT0mz1033FPoMVSqSngri8E8ob9T3quWnDaPt18rQDrMbF1NiyYX2Vmz9nW1bLVL
Gyqk23Cw/2wRfbcq88FPrv/ehR2tZq3KbPoxPxEEQXfabrSDktUWu1K6Cyn3EzQP
0Y9C8zQTqUIMzA1eWprLIIQC6HplfQ8VruixrhTY/8m8ReG3+3Jrb1I3aqZf1KxR
wNkbI7iW32Bmj4wnp9ZUQ1NbMainx4Q2yot9dwCXaOErRUoIgracHDtH1OqbVseH
aHgqPN9qzaeCPyvd0fMgQvOSM92ZthwspT7+kBlPOCkv3wMHjzQl5Xfwx9QQlqF2
37hy1g487Yf28LIiQ6PFCSvvDIM8/iTV40/rv9kukOYge4cWQCC8sTCQ2QppUHD2
R5ZHJuL+v2/BlCxCmm+d
=DIaU
-----END PGP SIGNATURE-----


ssh -l `REMOTE_USER_NAME` `REMOTE_HOST_OR_REMOTE_IP`  -p `REMOTE_SSH_PORT]`

is the syntax I use most of the time.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yeah, and that works, but I personally find it easier (and easier for
others to read) to do the format with the ‘@’ in the middle:

ssh ab@mybox0.tld

Good luck.

On 08/15/2011 03:16 PM, Knurpht wrote:
>
> Code: --------------------
>
> ssh -l REMOTE_USER_NAME REMOTE_HOST_OR_REMOTE_IP -p
> REMOTE_SSH_PORT]
>
> --------------------
>
> is the syntax I use most of the time.
>
>


Want to yell at me in person?
Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOSZCFAAoJEF+XTK08PnB5/lMQAMThNEvbIdQtjpIF9lEOFf/X
DeNAZcmiyHkIYb51j+fyUdjPgYZ11+aajygGjD9ffLZf2qkVtEADaGeSJL55DmDa
Wl0KOKICbyF7/iFWswgkSJERj51zwKgcbrKigsiWfl96fEIgYcCaD0hADeG3Xzq9
Jzo4lF9WriOMheHAJ+dkrlKEttPoiEfGPaZAu8R4lUBHCAQ9aRyoavsOHeoTkzo+
vCY6EGtRWwxDt9847bexxi9g+Ggz5XkPwLcca9D+fdxY4hO4xnCXxi9Ey8RuPmJh
xnW8oaotr0hfJ8X8uxsGBmVCqXtLKv9SGpLe8TPZx0Mma3ylRWWYABW1p8pBXquO
7j9zGj/IpVEMEvf6acNEqxURUV9E60STZAVdvZyN+i5SkZp4a4msKbEt80TIxLtl
0SfQjpza/zCEDVTCDBIX1LCJk8rCsECvZliVMh3wkvnQqschqX9vlfxZvlWMT7XH
1FBm14Kzlyxz8/xP1CVhulOKIgHPc+1PSP6ZjAPh+xNI0HEs44B7G1JeMwVX47ps
BBcK7DDI9KYlGBLj7jjYNtO1OssdEmWw22/ykXxA0s52MQNHUTW3+N7CG9/OOZ8F
gYvvT3RoMba+2vYJvkBtQ/GEywU4wdgLaVcG4RWQzuLRjpBp+1Ves4NNHUHm8bim
xX+S3yrEgbL6RW4rUwgS
=S8UZ
-----END PGP SIGNATURE-----

On Mon, 15 Aug 2011 21:33:09 +0000, ab wrote:

> Yeah, and that works, but I personally find it easier (and easier for
> others to read) to do the format with the ‘@’ in the middle:
>
> ssh ab@mybox0.tld

I find it easier to put the user info in the ~/.ssh/config file - then I
can assign a name to it so I can just do:

ssh configname

And it connects with the user (and options) I want to default to for that
name. :slight_smile:

But back to the OP’s question…

imterpsfan2: If you enter:

nslookup hostname.of.your.host

or

ping hostname.of.your.host

Do you get the expected IP address? What I’m wondering is if you’re
somehow connecting to a different host inadvertently.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I was able to connect using the username@webaddress syntax. The mistake I made was trying to use the ssh command the same way I had used Putty on Windows.

Thanks for your replies.

For start don`t use ssh on port 22 many crakheads are wondering the internet with their scanners for victims, try another port something like 9922; to adjust this, install the package yast-sshd via YaST be sure change port and to use only sshv2, be sure to open the port in the firewall(via advanced tab from firewall configuration, TCP port) and on the router if you own one(a.k.a port forwarding)
Second you did not mentioned if you try to login as normal user or root (root logins are disabled as a security measure as far as i know)…

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> (root logins are disabled as a security measure as far as i know)…

No, they’re not. They should be, but SUSE does not do this currently by
default.

Good luck.


Want to yell at me in person?
Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOSn9FAAoJEF+XTK08PnB5ZzQQAL0ssGvUGETS657Gkxjqndeu
sdlP7VF1TCIGv3SdBO2UrHZcmIFK+5sLkw8eGhvUwxN8DG12biYwVYxhZkAycDKW
EaO3rvuevUsLo65xNRceXJtH4vj+bItigZ3uhrY1N7NunegCdzJ/KLhTFQUFxKnu
+UEqMb0KD48i4jm4npFgpplX5hVFd+UK9BDVDnZ4tO0Ovo5aXlQ2MMXnR46UVFEe
dn0D0ygM4BG88V8DpORiIDjrsykI0/FOJDRRSPTqY7ltshNzDJjmrc4A6q4rKa1p
qTQGQaUCxc7xEzpG88Ah/OeAz9CIFVf0uNZIwSZTJPS3TiCxsjw7DXsr29OaBfXW
LNcb+wgYPgaTF1kG5iMPCtHXTangX/ik8Jg47l4woubqYH2Z5R5vo+mUCpMHwtz1
aBhxZzTJYyvpmEiag03X+yTcIFL0KPXqWFXJOuSuMU9FxH3qtkUvpzB10Rp12Ngw
dN5DdWGy5FuuurHnASOoYbDe6/2k7VzUz9iJadnuOOGsFVhVFLZqXAaJSkvxN6Wf
gO2v2EBIqYAeNQ579CkxL/x90pgJDVzfdCbXJ+4FRdJa7/SexyuBlk5Iwjn2uLOn
qOSfiD3P1uQmgd7ZICBIDsovCGXvm2QdaMVIUg8OSaE9/IqYOVKzxLUrZmkQVF/M
QyQOpokkaP+Ak5omciis
=qmim
-----END PGP SIGNATURE-----

Where I work we were getting constant hack attempts from bots all over the world, but when ssh was moved off port 22 they disappeared completely. So definitely change the port.

Portsentry or fail2ban are good tools against such attacks.

@ab: i did not know that, i used ssh under 11.0; ive always belived that suse devels will adjust this under next versions and make it a default setting.