Operating System - HP-UX
1821640 Members
3202 Online
109633 Solutions
New Discussion юеВ

"Permission Denied" when using SSH

 
SOLVED
Go to solution
Brett Simpson
Frequent Advisor

"Permission Denied" when using SSH

I can login via telnet, but get permission denied when using SSH. I know telnet has security issues, but we've just taken over administration of some servers and that's the only way we can login. I want to fix the ssh issue so that I can turn off the telnet daemon.
20 REPLIES 20
vishnu.khandare
Respected Contributor
Solution

Re: "Permission Denied" when using SSH

Hi Brett,
Please check the files /etc/opt/ssh/sshd_config throughly...
there might be line of deny user improperley spelled pls check it.

Hope this solve ur issue...


Regards
Vishnu Khandare
You should deserve before U desire!!!!
merieux
Frequent Advisor

Re: "Permission Denied" when using SSH

Hi ,

Could you give us more information about your issue ?

Do you have an issue when you try to acces to a remote system ? Is it frm a particular user ?


Can you post the result of ssh -v user@system

Regards ,
Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

ssh -v root@camcrd01
OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17, OpenSSL 0.9.7m 23 Feb 2007
HP-UX Secure Shell-A.04.70.022, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Connecting to camcrd01 [204.89.119.58] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/3
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_5.1p1+sftpfilecontrol-v1.2-hpn13v5
debug1: match: OpenSSH_5.1p1+sftpfilecontrol-v1.2-hpn13v5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
The authenticity of host 'camcrd01 (204.89.119.58)' can't be established.
RSA key fingerprint is cd:a5:cd:89:24:e1:eb:fc:4a:a7:7d:0d:9a:3d:9e:6f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'camcrd01 xxx.xxx.xxx.xxx (RSA) to the list of known hosts.
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
root@camcrd01's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
Tim Nelson
Honored Contributor

Re: "Permission Denied" when using SSH

>>>debug1: Next authentication method: password
root@camcrd01's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.


Looks like things are working, assuming you have the correct password..

Do you have a "DenyUsers" directive in sshd_config on this server ?

merieux
Frequent Advisor

Re: "Permission Denied" when using SSH

Can you post the sshd_config of your server ?

What about onother user instead of root ?
Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

The Deny user option is commented out. I just created a test user on the server and can ssh and login just fine. It appears to only be the root user.
Steven E. Protter
Exalted Contributor

Re: "Permission Denied" when using SSH

Shalom,

Connect to the server via telnet.

Check the ownership and permissions of the files in the user home directory.

Look for reasons why the permission is being denied, like some other user owning the files.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

SEP,
I've checked the files. This is only happening for the root user. There is an entry for "console" in securetty, but I thought that was for telnet connections.(?) The funny thing is that I can log in as root from telnet - even with that entry in securetty.
rmueller58
Valued Contributor

Re: "Permission Denied" when using SSH

Brett,

your sshd_config has a root allow or deny, if it is root getting denied and not other users..

Best practice is to su to root when you need to use root, and default setup for OpenSSH is to disable root login..

rmueller58
Valued Contributor

Re: "Permission Denied" when using SSH

PermitRootLogin yes
Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

Here's the entry from sshd_config:

PermitRootLogin yes
rmueller58
Valued Contributor

Re: "Permission Denied" when using SSH

can you SU to root?

Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

I can su to root without a problem.
rmueller58
Valued Contributor

Re: "Permission Denied" when using SSH

can you log in as root from another system?

If so, you may want to visit the
/.ssh/known_hosts and remove the entry for the problem workstation..

/.ssh/known_hosts is where the key exchange is stored for root

Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

rex_m,
It's not allowing it from any workstation or other server.
Tim Nelson
Honored Contributor

Re: "Permission Denied" when using SSH

Brett.

You stated that the DenyRootUser is commented out..

when was the last time that sshd was restarted ?

/sbin/init.d/secsh stop
/sbin/init.d/secsh start

One last item..
any relative messages in /var/adm/syslog/syslog ?
(always for get to check the easy stuff)
Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

Tim,
The server was recently rebooted, so sshd was restarted at that time. Here's what shows up in syslog.log when I try to ssh as root.

error: PAM: Authentication failed for root
mvpel
Trusted Contributor

Re: "Permission Denied" when using SSH

Newer versions of T1471AA Secure Shell have an "EnforceSecureTTY" option. Check to see if that's enabled in your sshd_config file.
Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

Thanks all of you for your help. I had several servers where this was happening. the "permitRootlogin" param works for some but not for others. Weird, but true. I'm going to do some more digging on my own. Thanks again!
Brett Simpson
Frequent Advisor

Re: "Permission Denied" when using SSH

I need to look into sshd_config more thoroughly. I get different responses on different servers. thanks all!