Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: bkm 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
-
Please read the book http://tinycorelinux.net/book.html
and wiki and study the portions on persistence and backups.
-
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
-
See https://github.com/tinycorelinux/Core-scripts/blob/master/etc/init.d/tc-config (https://github.com/tinycorelinux/Core-scripts/blob/master/etc/init.d/tc-config)
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. ;)
-
Oops, I forgot to mention. :-[
Replace this
echo "$USER":tcuser | /usr/sbin/chpasswd -m
with this
sudo passwd -d "$USER:
to delete the password.