WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How do I get a new user to be included in the sudoers?  (Read 4341 times)

Offline bkm

  • Jr. Member
  • **
  • Posts: 72
How do I get a new user to be included in the sudoers?
« on: April 05, 2017, 12:06:59 PM »
I finally have the TCL system that I wanted and now I want to run it headless. This means accessing it through a SSH client. Im my case its dropbear and it works just fine.

I created myself as a new user with:

sudo adduser bkm

and I gave it a password. All worked well, or so I thought.
I went to a remote pc on the network and used putty as SSH client. I was able to login to the TCL box using my new user and password, but when I wanted to do things that required "sudo" it wouldn't let me do it. So, I need a way to add my new user to the sudoers list and make it persistent.

I have added users to the sudoers list in a full debian install, but not sure how to do it here and still keep it persistent.

Any ideas?

BKM

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How do I get a new user to be included in the sudoers?
« Reply #1 on: April 05, 2017, 12:17:35 PM »
Please read the book http://tinycorelinux.net/book.html
and wiki and study the portions on persistence and backups.

Offline bkm

  • Jr. Member
  • **
  • Posts: 72
Re: How do I get a new user to be included in the sudoers?
« Reply #2 on: April 05, 2017, 12:43:41 PM »
Yup, did that. (Long time ago) It wasn't the basics of persistence that I was worried about.

It turns out there were more steps in the Debian Jessie version of adding users to sudoers that involved directories that I didn't think should be persistent. However, it turns out the TinyCore implementation is sooo much simpler. I wasn't sure it would be as simple as adding etc/sudoers to the filetool.lst but it turns out that is all that was needed.

I guess I was looking for more complications than there were to find.

BKM

Offline polikuo

  • Hero Member
  • *****
  • Posts: 724
Re: How do I get a new user to be included in the sudoers?
« Reply #3 on: April 05, 2017, 12:49:24 PM »
See https://github.com/tinycorelinux/Core-scripts/blob/master/etc/init.d/tc-config
Quote
addUser(){
   echo "${GREEN}Adding user ${YELLOW}$USER ${NORMAL}"
   /bin/adduser -s /bin/sh -G staff -D "$USER"
   echo "$USER":tcuser | /usr/sbin/chpasswd -m
   echo -e "$USER\tALL=NOPASSWD: ALL" >> /etc/sudoers
}
This should help.  ;)

Offline polikuo

  • Hero Member
  • *****
  • Posts: 724
Re: How do I get a new user to be included in the sudoers?
« Reply #4 on: April 05, 2017, 02:08:08 PM »
Oops, I forgot to mention.  :-[
Replace this
Code: [Select]
echo "$USER":tcuser | /usr/sbin/chpasswd -m
with this
Code: [Select]
sudo passwd -d "$USER:
to delete the password.