Software Archive
Read-only legacy content
17060 Discussions

Issues accessing mic0 with non-root user

Sigurhjs
Beginner
1,453 Views

I am having some issues getting access to mic0 through non-root users. Accessing the card as root works fine.

The issue is that I keep getting prompted for password and no matter what password I generate (either an empty passphrase or an actual password) I get prompted for a password each time I try to ssh or scp but it never authenticates me and lets me log in. I can however ssh with root using an empty passphrase without any issues.

I've tried doing everything, both manually and through micctrl. The user gets created (the username is sigurhjs for future reference when I post some of the data) and the home folder as well. However .ssh folder doesn't get copied. So I've manually copied the .ssh folder as root to the home area of the user (/home/sigurhjs/) and changed the owner to sigurhjs.

If I cat the /etc/passwd, /etc/shadow and /etc/group I have the following data for sigurhjs

passwd:
sigurhjs:x:10127:10129:,,,:/home/sigurhjs:/bin/bash

shadow:
sigurhjs:*:14914::::::

group:
sigurhjs:x:10127:

 

The group I added manually as group did not contain anything with the user sigurhjs. I can however ssh with root into mic0 and the do su - sigurhjs without any issues (no password gets prompted).

I am running Centos 6.6 (kernel version 2.6.32-504.8.1.el6.x86_64) and mpss 3.4.2

I've spent a good number of days trying to do this in all possible ways, including reading all topics I could find on the issue here. Is there something obvious I am missing or doing wrong?

 

0 Kudos
11 Replies
JJK
New Contributor III
1,453 Views

Please post a connection log (anonymized, if necessary) when logging in using

slogin -v mic0

For my mic0 (on Centos 6.6 + mpss 3.4.2) I get

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /home/janjust/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to mic0 [172.31.1.1] port 22.
debug1: Connection established.
debug1: identity file /home/janjust/.ssh/identity type -1
debug1: identity file /home/janjust/.ssh/identity-cert type -1
debug1: identity file /home/janjust/.ssh/id_rsa type 1
debug1: identity file /home/janjust/.ssh/id_rsa-cert type -1
debug1: identity file /home/janjust/.ssh/id_dsa type -1
debug1: identity file /home/janjust/.ssh/id_dsa-cert type -1
debug1: identity file /home/janjust/.ssh/id_ecdsa type -1
debug1: identity file /home/janjust/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9
debug1: match: OpenSSH_5.9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr 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 'mic0' is known and matches the RSA host key.
debug1: Found key in /home/janjust/.ssh/known_hosts:17
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: /home/janjust/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 149
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com

 

0 Kudos
Sigurhjs
Beginner
1,453 Views

Below is the requested data with attempts to enter password until it refuses.

 

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /home/sigurhjs/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to mic0 [172.31.1.1] port 22.
debug1: Connection established.
debug1: identity file /home/sigurhjs/.ssh/identity type -1
debug1: identity file /home/sigurhjs/.ssh/identity-cert type -1
debug1: identity file /home/sigurhjs/.ssh/id_rsa type 1
debug1: identity file /home/sigurhjs/.ssh/id_rsa-cert type -1
debug1: identity file /home/sigurhjs/.ssh/id_dsa type -1
debug1: identity file /home/sigurhjs/.ssh/id_dsa-cert type -1
debug1: identity file /home/sigurhjs/.ssh/id_ecdsa type -1
debug1: identity file /home/sigurhjs/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9
debug1: match: OpenSSH_5.9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr 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 'mic0' is known and matches the RSA host key.
debug1: Found key in /home/sigurhjs/.ssh/known_hosts:7
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: /home/sigurhjs/.ssh/identity
debug1: Offering public key: /home/sigurhjs/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/sigurhjs/.ssh/id_dsa
debug1: Trying private key: /home/sigurhjs/.ssh/id_ecdsa
debug1: Next authentication method: keyboard-interactive
Password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
sigurhjs@mic0's password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
sigurhjs@mic0's password: 
Received disconnect from 172.31.1.1: 2: Too many authentication failures for sigurhjs

 

0 Kudos
Sunny_G_Intel
Employee
1,453 Views

Hi,

First of all, I would like to verify if you have already gone through the steps given in  Intel® Xeon Phi™ System Admin guide, Section 3.2 User Configuration. If you want to create a new user "testuser"  and allow passwordless ssh access to Intel® Xeon Phi™ cards, list of steps can be given as follows

[root@host] useradd -m testuser   //Adding a new user 'testuser'  with home directory
[root@host] passwd testuser          //changing passwd   
//You can skip the above steps if user already exists on the host system
[root@host] su testuser           //switch to testuser
 
[testuser@host] ssh-keygen       //create keys with blank password

Generating public/private rsa key pair.
Enter file in which to save the key (/home/testuser/.ssh/id_rsa): 
Created directory '/home/testuser/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/testuser/.ssh/id_rsa.
Your public key has been saved in /home/testuser/.ssh/id_rsa.pub.

[testuser@host]  su                       //switch to root

//Restart MPSS service after adding the testuser
[root@host] service mpss stop                                 
[root@host] micctrl --useradd=testuser
[root@host] micctrl --sshkeys=testuser mic0 mic1
[root@host]  service mpss start

[root@host]  su testuser                  //switch to testuser

[testuser@host]  ssh mic0               //test passwordless ssh access

Thanks

0 Kudos
Sigurhjs
Beginner
1,453 Views

Yeah I've done that multiple times. The user I am setting up has pretty much nothing as it is (except icc and such). So I'll delete the .ssh folder and remove him from mic0 before adding him again.

 

sigurhjs@lincoln:~$ sudo micctrl --deluser=sigurhjs
sigurhjs@lincoln:~$ rm -r .ssh
sigurhjs@lincoln:~$ ssh-keygen


Generating public/private rsa key pair.
Enter file in which to save the key (/home/sigurhjs/.ssh/id_rsa): 
Created directory '/home/sigurhjs/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/sigurhjs/.ssh/id_rsa.
Your public key has been saved in /home/sigurhjs/.ssh/id_rsa.pub.


sigurhjs@lincoln:~$ sudo su
[root@lincoln sigurhjs]# service mpss stop
Shutting down Intel(R) MPSS:                               [  OK  ]
[root@lincoln sigurhjs]# micctrl --useradd=sigurhjs
[root@lincoln sigurhjs]# micctrl --sshkeys=sigurhjs mic0
[root@lincoln sigurhjs]# service mpss start
Starting Intel(R) MPSS:                                    [  OK  ]
mic0: online

sigurhjs@lincoln:~$ ssh mic0


The authenticity of host 'mic0 (172.31.1.1)' can't be established.
RSA key fingerprint is
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'mic0,172.31.1.1' (RSA) to the list of known hosts.
Password: 
Password: 
Password: 
sigurhjs@mic0's password: 
Permission denied, please try again.
sigurhjs@mic0's password: 
Received disconnect from 172.31.1.1: 2: Too many authentication failures for sigurhjs

 

As before, same result. I've included the slogin -v after doing the above.

 

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to mic0 [172.31.1.1] port 22.
debug1: Connection established.
debug1: identity file /home/sigurhjs/.ssh/identity type -1
debug1: identity file /home/sigurhjs/.ssh/identity-cert type -1
debug1: identity file /home/sigurhjs/.ssh/id_rsa type 1
debug1: identity file /home/sigurhjs/.ssh/id_rsa-cert type -1
debug1: identity file /home/sigurhjs/.ssh/id_dsa type -1
debug1: identity file /home/sigurhjs/.ssh/id_dsa-cert type -1
debug1: identity file /home/sigurhjs/.ssh/id_ecdsa type -1
debug1: identity file /home/sigurhjs/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9
debug1: match: OpenSSH_5.9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr 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 'mic0' is known and matches the RSA host key.
debug1: Found key in /home/sigurhjs/.ssh/known_hosts:1
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: /home/sigurhjs/.ssh/identity
debug1: Offering public key: /home/sigurhjs/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/sigurhjs/.ssh/id_dsa
debug1: Trying private key: /home/sigurhjs/.ssh/id_ecdsa
debug1: Next authentication method: keyboard-interactive
Password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
sigurhjs@mic0's password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
sigurhjs@mic0's password: 
Received disconnect from 172.31.1.1: 2: Too many authentication failures for sigurhjs

 

 

 

0 Kudos
Sunny_G_Intel
Employee
1,453 Views

Well that is strange. Before posting the above instructions, I went through the steps and created a passwordless ssh login. I did it on Centos 6.5 and MPSS 3.4.1. Let me check if I can find a machine with configuration similar to yours. Meanwhile, can you please try to create a completely new testuser by following the steps given above and see if you are still facing the same problem. I am just trying to eliminate any conflicts for that particular username in MIC configuration files. 

Also can you please verify if the user entry was also added to the following file  /var/mpss/mic0/etc/passwd

Thanks 

0 Kudos
JJK
New Contributor III
1,453 Views

On the host (not the mic) check the contents of the files /var/mpss/mic0/etc/passwd and /var/mpss/mic0/etc/shadow - they contain the userid and hash of the user's password.

Also, for passwordless SSH access, check the contents of the directory /var/mpss/mic0/home/sigurhjs/.ssh and the file /var/mpss/mic0/home/sigurhjs/.ssh/authorized_keys - is the correct key listed in that directory.

Especially check the ownership and permissions on the .../home, .../home/sigurhjs and .../home/sigurhjs/.ssh directories - ssh is picky about allowing passwordless access.

0 Kudos
Sigurhjs
Beginner
1,453 Views

Ok

First part is the passwd file

sigurhjs@lincoln:~$ grep sigurhjs /var/mpss/mic0/etc/passwd 
sigurhjs:x:10127:10129:,,,:/home/sigurhjs:/bin/bash

And just to include it, the shadow file

sigurhjs@lincoln:~$ sudo grep sigurhjs /var/mpss/mic0/etc/shadow
sigurhjs:*:14914::::::

But as stated in the first post, nothing in the group file (Have been adding it manually on some tests)

As before there is no .ssh folder in /home/sigurhjs/ It never really gets added. I've been manually adding the folder to the mic0 with root scping them over and then changing the owner. I am then just cating the key to authorized_keys to make that excist.

Owner of home is root while owner of /home/sigurhjs/ is sigurhjs.

 

I am having some issues with making a new user as it is, I am talking to the admin who is fixing it, so I can't do it a new user right now. As soon as the admin fixes the issue I'll do a new user and try adding it to the mic0.

 

 

0 Kudos
JJK
New Contributor III
1,453 Views

the shadow file shows the password is set to "*" : I am not surprised that you cannot log on with such a password; I would have expected something similar to "$6$a4.aGKWZ...."

I am surprised that the .ssh directory is not added - this directory should be listed in the file /var/mpss/mic0.filelist. The entry should have been added when the user was added to the system using 'micctrl --adduser' .

 

0 Kudos
Sigurhjs
Beginner
1,453 Views

Yeah I did wonder if the * was correct, given that root had a something that looked more like a key.

I've been doing this with the micctrl though. Are there any reasons why this is failing like it is (not copying and invalid shadow entry) and what options do I have to fix this?

0 Kudos
Sunny_G_Intel
Employee
1,453 Views

Hi SigurhjS

I would like to know if you are still experiencing issues with connecting to coprocessor with non-root user.

Thanks

0 Kudos
Sigurhjs
Beginner
1,453 Views

Sorry for a slow reply. Apparently I haven't gotten an e-mail notifying of a reply to the topic.

The issue itself is resolved by just using root to reset the password for the user. Why it didn't copy the file or anything though I don't know still.

0 Kudos
Reply