dnordgren / CSCE835

Workspace for Group 8 of CSCE 435/835 (Cluster & Grid Computing)
head.pi.cluster.unl.edu :)
0 stars 0 forks source link

Set up SSH keys for all users #5

Closed dnordgren closed 9 years ago

bhushit commented 9 years ago

After creating the user for me. I noticed that after logging into it, I could not even execute ls or pwd commands. There were a couple for problems here I think, I did the following things to get things working:

1- Make my user a sudoer. Did this by editing /etc/sudoers file. Added the following line,

bhushit ALL=(ALL)   ALL

After this I was able to execute commands using sudo (eg. sudo ls) but still not able to execute regular commands. So I added my user to pi group

2- Add myUser to pi group,

sudo usermod -a -G pi bhushit

3- Now generating the ssh-key,

ssh-keygen
#Choose default file location
#Choose default passphrase

4- Authorizing self (sounds dumb but used to ssh after nfs is mounting /home on workers)

cd ./.ssh/
cat id_rsa.pub > authorized_keys

5- Password-less ssh from myUser

#Copy public key of my_user to home of worker pi
sftp pi@work1
put ./.ssh/id_rsa.pub
exit

#Cat and remove the copied public key of _myUser_
ssh pi@work1
cat id_rsa.pub >> ./.ssh/authorized_keys
rm id_rsa.pub
exit

#Test
ssh pi@work1 

I think you guys will have to repeat the above steps or something better & similar.

I am not sure if we have to create users on the workers too.

bhushit commented 9 years ago

Update: I think the step two is not required. The mistake I was doings is that I was running the command as sudo su bhushit from user pi whereas I should be running sudo su - bhushit

bhushit commented 9 years ago

Update: We had a broken ssh after getting nfs up. This issue talks about it.