LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Add another user account to the ssh keys? (https://www.linuxquestions.org/questions/linux-newbie-8/add-another-user-account-to-the-ssh-keys-4175472796/)

hrohibil 08-09-2013 01:17 PM

Add another user account to the ssh keys?
 
Hi

Please advice.

I have made a succesfull login via putty and as a root account to my nas.

Now i want my own user account which i use to login to the nas web GUI, to login.

Can i somehow add my account name into the keys public??

I have tried from putty by just changing the auto-login name from root to my user account which is an administrator account, but i just get refused says "server refused our key", i use the same private key file path, i have only changed name from root to my user name account???
Br Hamid

itlb 08-09-2013 05:13 PM

Add another user account to the ssh keys?
 
hi,
So you have ssh set up to the root account of your NAS using keys and now you want to set up the same for a user account? to do this you will need to add your client users public key to the users ~/.ssh/authorized_keys file on the NAS, I gather you have already created the key from your original post?

hrohibil 08-10-2013 03:03 AM

Yes i have allready made a keypair for my my root account which is located in /.ssh/authorized_keys file. How can i add another user to that authorized_keys file???

I can only login to the ssh with the root login credienttials... Even though i have a administrator account on my nas, it keeps saying keys refused when trying to login with that account...

Br Hamid

olau 08-10-2013 04:28 AM

ehem, did you setup "your own user account" - as you name it - on your NAS box? It looks like you did not! So do it.
Then as itlb suggested add the public key to ~/.ssh/authorized_keys
Look carefully, this is NOT /.ssh/authorized_keys
it shall be /home/<your own user account>/.ssh/authorized_keys (on the NAS).

This should bring you through....

hrohibil 08-10-2013 05:19 AM

Hi

Thanks for a reply.

Okay, i think you are on to something here. As it is now I can only login to the NAS as a root user with ssh.

When i am logged in, i am the root/directory.
So you are saying that i log in as root user as normal, then go into the user account folder from home and inside the .ssh/authorized_keys file i edit and paste the same public key as i use for the root user i got from putty??

But if i log in as root, how can i then get to /home/<your own user account>/.ssh/authorized_keys ???

Really looking forward to your reply

Br Hamid

hrohibil 08-10-2013 02:20 PM

Hi

PLEASE HELP ME!!!!!

As i was excided to come home and try out to add a nas account user instead of a root user to my nas, i get error message....

See attached file.

http://bilverdy.dk/HELP/puttyerror.png

Server Refused the key??

I mean yesterday it worked fine?? And since i only had that root acount to login with, how can i enter the nas and how can this happend when it worked fine???

I logged in to the nas from the Web GUI just check up on the firewall and system traffic logs to see if there was any unsual activity, everything was fine. I can only remember that after my las succesfull login yesterday night, i then rebooted both nas and later the router for some other reason.

Please advice....

hrohibil 08-11-2013 02:15 PM

Quote:

Originally Posted by olau (Post 5006703)
ehem, did you setup "your own user account" - as you name it - on your NAS box? It looks like you did not! So do it.
Then as itlb suggested add the public key to ~/.ssh/authorized_keys
Look carefully, this is NOT /.ssh/authorized_keys
it shall be /home/<your own user account>/.ssh/authorized_keys (on the NAS).

This should bring you through....

Okay, i got in with telnet and reastablished ssh connection by removing "AllowAllUsers myUseraccountname" i tried to allow the ssh to allow my user account.
So now i am inside ssh as a root, and i canīt find any /home/user/ folder? Is it because i am logged in as a root? If so how do then create an account from the root?
When i cd .. back to the very root folder, so behind my /root folder i am now just in / and from here there is a folder called /usr nothing usefull there.. Please advice

olau 08-12-2013 02:41 AM

of course you need to create that user on your NAS also. You shall go for some linux basics or at least basics for your NAS... before continuing.

hrohibil 08-12-2013 04:09 AM

I allready have the user created from the nas it self. So when i login from the web gui there is no problem. Also i checked that the users home service are enabled and they were by default.
I just cant seem to access the nas with ssh other than root??

hrohibil 08-12-2013 09:26 AM

I finnaly got a username account setup without root.

What permissions should the folder /var and /services have-??

I have chown them to my username account.

Br Hamid


All times are GMT -5. The time now is 03:17 AM.