Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My client has setup a new server and has generated a new key pair. Now, they sent me their public key which I have to setup to the same user and server they have been connecting to.
Unfortunately, I can't get to make things work. I have already appended their public key to /home/myuser/.ssh/authorized_keys, with permission 644.
The account myuser is not locked on myserver. Also, I have asked for verbose output, and from the below, I think the connection pushed through so I am assuming there's no network issue here whatsoever.
here's the output of ssh -v
Code:
theiruser@theirserver:/theirdirectory/theiruser> ssh -v myuser@myserver.com
OpenSSH_5.1p1, OpenSSL 0.9.8j-fips 07 Jan 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to myserver.com [10.227.58.223] port 22.
debug1: Connection established.
debug1: identity file /theirdirectory/theiruser/.ssh/id_rsa type 1
debug1: identity file /theirdirectory/theiruser/.ssh/id_dsa type 2
debug1: Remote protocol version 1.99, remote software version OpenSSH_5.2p1+sas
debug1: match: OpenSSH_5.2p1+sas pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1
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
debug1: Host 'myserver.com' is known and matches the RSA host key.
debug1: Found key in /theirdirectory/theiruser/.ssh/known_hosts:14
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: Offering public key: /theirdirectory/theiruser/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /theirdirectory/theiruser/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
myuser@myserver.com's password:
I couldn't find a reference to your sshd_config and the option
Quote:
RSAAuthentication yes
PubkeyAuthentication yes
So just let me ask whether you have changed this and restated the sshd.
Note:
- if you limit the access by AllowUsers option in sshd_config you need to add the required user to the list
Thanks all for the responses. It does look like a permission issue, though I am not sure what exactly to check. From the lines below, either the private key cannot be read or it does not match the public key (though my client would disagree on this).
Code:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /theirdirectory/theiruser/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /theirdirectory/theiruser/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
myuser@myserver.com's password:
The following are in my sshd_config. The thing is, logging in to other users in myserver using ssh is working, so if something's wrong with sshd_config, I don't know what to check. Also, I am not sure if anyone has ever logged in to 'myuser' user using ssh before.
Code:
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
UsePrivilegeSeparation yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PasswordAuthentication no
Just a quick question, does the output above mean that there is no network/port/firewall issue ongoing? I assumed that since technically, ssh on both servers are already able to communicate.
as pointed out by linosaurusroot, the server side logs are the best place to look to solve this quickly. Check for example /var/log/auth.log or /var/log/secure (varies with distro).
Thanks, I'll look at the log files. BTW, it's AIX 7.1 (if thread has to move, please do so).
For the moment, I'd like to confirm, since they were able to connect to my server and see the outputs of ssh, does this mean that there is no network/port/firewall issue ongoing? I assumed this since ssh on both servers are already able to communicate.
Thanks, I'll look at the log files. BTW, it's AIX 7.1 (if thread has to move, please do so).
From the log it seems to be using openssh (as do most linux distros), so it should be ok to keep the thread here.
Quote:
For the moment, I'd like to confirm, since they were able to connect to my server and see the outputs of ssh, does this mean that there is no network/port/firewall issue ongoing? I assumed this since ssh on both servers are already able to communicate.
The ssh client output shows that it has connected to an openssh server.
One more thing, the following lines confuse me since it says public key being offered. I was expecting the private key will be used for authentication, since we setup the public key in the server's authorized_keys file.
Code:
debug1: Offering public key: /theirdirectory/theiruser/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /theirdirectory/theiruser/.ssh/id_dsa
yeah that is slightly strange output. Looking at the previous line we see:
Code:
debug1: Next authentication method: publickey
debug1: Offering public key: /theirdirectory/theiruser/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /theirdirectory/theiruser/.ssh/id_dsa
I think this just means that the publickey offered by the server is being tried against the private rsa ans dsa private keys held by the client. It is consistent with what I see when using ssh with rsa authentication.
Sad part is, the AIX server doesn't have any of these files for some reason.
/var/log/secure
/var/log/auth.log
/var/log/secure
I've read this already and learned about StrictModes in SSH; though there's no way for me to get the approval to set this to No, which is not even advisable.
So, I compare the directories of myuser to anotheruser which is a user that other vendors can connect to.
ls -al /home/myuser/ | grep .ssh
ls -l /home/myuser/.ssh/authorized_keys
ls -al /home/anotheruser/ | grep .ssh
ls -l /home/anotheruser/.ssh/authorized_keys
..and the permissions are the same.
I'll paste any updates, but feel free to give me ideas.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.