Skip to main content

OpenSSH Public Key Authorization on Linux

To find out whether a user exists or not in a Linux machine:
*    grep username /etc/passwd
or
*    id username

To give a new user access to Linux machine:
1. Login as root user
2. Run this:
    $ /usr/sbin/adduser new_user
3. Set a new password:
    $ passwd new_user
    (and put the password when prompted)

To give them root access:
4. Edit the /etc/sudoers file
    $ vi /etc/sudoers
    User_Alias YOUR_GROUP = new_user
    YOUR_GROUP ALL=(ALL) NOPASSWD: ALL

To test whether the new_user has been granted root access, run these two commands:
    $ su new_user (user should be 'new_user' now)
    $ sudo su (user should be 'root' now)
If the conditions above met, then new_user has root access.

If the new_user want to use public/private key gen authorization:
5. Change your user to be the new_user
    $ su new_user
6. Create ~/.ssh/authorized_keys file if it doesn't exist yet
    $ mkdir ~/.ssh
    $ chmod 700 ~/.ssh
7. Insert the public key on the authorized_keys file
    $ vi ~/.ssh/authorized_keys
    (insert the public key entry)

Comments

Popular posts from this blog

Amigurumi: Single Pea and Deadly Cute Ninja

I think I was bitten by the craft bugs. Here's my next creation: the single pea (because making 3 of them in solid green is just too much for my eyes) and the deadly but cute ninja. Chris called them Peany and Ninji. Peany, Dora, Ninji, and Mushy posing together It's hard to see from this photo, but Ninji actually has a sling (in a slightly different color) around his body, and a mini ninja star. And talk about proportion... the vegetables are larger than the cat and the person. Makes you wonder, isn't it?

Worried

I know intellectually that worry solves nothing. But I am worried. About the things that are out of my hands. And I am sad, because it involves people, and I can't do anything about it. I am starting to believe that helplessness is the root of all worries. Hhhh...

An Overbooked Weekend

The weekend of Mother's Day 2009 was definitely one (fun and) overbooked weekend. Planning for this weekend was started a couple months back, when we thought there were only the Youth Retreat to go to. We were part of the Youth Group for a long time, and even though we are past university age, we still would like to support their program. The place for the retreat was 3 hours away No problem, it was only from Friday afternoon to Sunday afternoon. Plenty of time to sleep off the tiredness, and be fresh for Monday morning works. So we signed up without second thoughts. Pemberton - our destination for Spring Fellowship 2009 Then my mom came and decided to stay until just after Mother's Day. Which meant that her flight was leaving on early hours of the Monday after. Which meant that we needed to get her to the airport around Sunday midnight. Okay, going to the Retreat would mean leaving my mom without us for the whole weekend. But then my mom encouraged us to go. Yuli wasn