Posts: 2
stakhanov
Joined: 07 Oct 2010
#1
Hello all,
I'm new to antix and I like the look of it. My problem is that I'm unable to log in as root. This applies if I log out and attempt to log back in or if I shutdown and attempt a root log in from boot.
I'm not able to use"sudo" as, apparently, antix doesn't permit user to perform such actions so for"apt-get" I need to be root.
My test box is an old Dell GX260 with a P4 and 2G DDR, it's run just about everything before.
Any help would be gratefully received.
Posts: 903
plvera
Joined: 11 Oct 2008
#2
Hello Stakhanov and welcome to Antix:

Antix does not support logging in as root. Just log in as a regular user, open a terminal and type:

su

and then your root password (which you set up during install)

then you can perform root functions, such as apt-get.

Post if you have any other problems and enjoy Antix.

Pedro
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#3
Welcome to antiX.

As Pedro says, plus if you use a gui app as root, use sux rather than su.
If you really want to be able to login as root (not advisable, but it is your box), copy the .xinitrc file in your home/username folder (it is hidden) to /root folder.
Posts: 2
stakhanov
Joined: 07 Oct 2010
#4
Thank you gentlemen,
I discovered the antix way just a few minutes ago but I appreciate your replies. Apt-get couldn't find the package I wanted (giver) anyway but at least I can use it for other applications.
Posts: 903
plvera
Joined: 11 Oct 2008
#5
Did you try apt-get update first? Also, might want to try synaptic under control center.
Posts: 89
Stuart O'mahony
Joined: 07 Mar 2010
#6
As an addendum to this, should you wish to, it is still possible to use sudo in Anti-x; just do the following:

Code: Select all

su
apt-get install sudo
geany /etc/sudoers 2> /dev/null &
In the geany editor, copy the line that reads 'root ALL=(ALL) ALL', and paste it to the next line, replacing 'root' with your username, i.e. mine reads 'stuart ALL=(ALL) ALL'. Save and close down geany, and 'exit' at the commandline.

Now you can run sudo. You can also add your username to the 'wheel' group, but I forget how this is done now.
Posts: 45
Colonel Panic
Joined: 14 Mar 2010
#7
Stuart O'mahony wrote:As an addendum to this, should you wish to, it is still possible to use sudo in Anti-x; just do the following:

Code: Select all

su
apt-get install sudo
geany /etc/sudoers 2> /dev/null &
In the geany editor, copy the line that reads 'root ALL=(ALL) ALL', and paste it to the next line, replacing 'root' with your username, i.e. mine reads 'stuart ALL=(ALL) ALL'. Save and close down geany, and 'exit' at the commandline.

Now you can run sudo. You can also add your username to the 'wheel' group, but I forget how this is done now.
Just seen this and want to say that this is excellent advice, so thank you! When I used sudo before, I had a lot of trouble with the command failing and then getting the message '(Colonel Panic's username) is not in the sudoers file, incident will be reported'; until I did what it suggested.

"In the geany editor, copy the line that reads 'root ALL=(ALL) ALL', and paste it to the next line, replacing 'root' with your username, i.e. mine reads 'stuart ALL=(ALL) ALL'. Save and close down geany, and 'exit' at the commandline."

So far I haven't needed to add my username to the 'wheel' group, but I'll bear it in mind in case I do.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#8
Ouch.
You've followed advice from 2010.
When you"followed advice" and attempted to install sudo, did you happen to notice that now, in 2017, it is already pre-installed?

Although no one replied back then to point out that Stuart's"fix" is misguided... it is misguided.

Point #1
The `visudo` command exists to handle edits to the sudoers file.
Using a text editor to directly edit the file invites the possibility introducing space/formatting characters, rendering it (and your entire system)"broken".

Point #2
Running with a rule like"scoobie ALL=(ALL) ALL" creates a really insecure (exploitable) and destined-to-fail scenario.
Further, after workaround-ing the step of using sudo, scoobie will often not achieve the indended/expected result.
Files created/output by commands performed by scoobie... will be"owned by" scoobie (not by root) and... OUCH!
A command exec'ed by scoobie... may be unable to read from (or write to) root-only -permissioned directories, and... ???
Various processes, expecting to find root-owned files, will refuse to acknowledge files"owned by" scoobie, and... FAIL!

Hopefully a skim through the manpages will help you to understand the importance of using sudo
man sudo
man sudoers
Posts: 45
Colonel Panic
Joined: 14 Mar 2010
#9
Thank you. Yes it is already installed, but *most distros I've tried (not antiX) don't have visudo so it's mcedit, vi, vim etc. or nothing (which also isn't an option because sudo won't let me execute the command).

I'll take your suggestion and read the sudo and sudoers manfiles, but I'm a bit pushed for time right now so it won't be immediately. Anyway, if you think it's a bad idea to edit the sudoers file in the way Stuart suggests I'll refrain from doing so in the future.

- CP

* Yes I know"stick with antiX in future" is an option, and it's one I'm willing to consider.
Posts: 850
fatmac
Joined: 26 Jul 2012
#10
Main reason why changing to the 'root' operator is not 'easy' is because you can do a lot of damage to your installation if you don't know what you are doing.

The purpose of sudo, is to only give some 'root' options/commands to a user.
Posts: 45
Colonel Panic
Joined: 14 Mar 2010
#11
fatmac wrote:Main reason why changing to the 'root' operator is not 'easy' is because you can do a lot of damage to your installation if you don't know what you are doing.

The purpose of sudo, is to only give some 'root' options/commands to a user.
Sure, I understand that and I think it's a definite plus point when compared to Windows (or at least those versions I'm most familiar with) where a user can do untold damage to their system by running without restrictions and allowing viruses, trojans etc. to take hold.

The problem is that there's also the other extreme, where you end up not being able to do even simple operations within your system, like moving files from one folder to another, as an ordinary user because the system won't let you; and that's the position I've found myself in more than once recently (and why I even know that a file called sudoers, and an application called visudo, exist). Not with AntiX, I hasten to add, but I've had quite a long absence from AntiX and only reinstalled it very recently.

Wouldn't it be nice if there was a middle way, where you could operate your system safely, including making any necessary changes, but also easily and without having to edit any configuration files?
Posts: 850
fatmac
Joined: 26 Jul 2012
#12
Moving files, or rather not being able to, sounds like a permissions problem on the directories, maybe you just need to add yourself to the group that they belong to.
Posts: 45
Colonel Panic
Joined: 14 Mar 2010
#13
fatmac wrote:Moving files, or rather not being able to, sounds like a permissions problem on the directories, maybe you just need to add yourself to the group that they belong to.
Thanks for replying. That sounds about right, but it's not the only situation in which logging in as root is required; I've also needed (and often) to change the date and time after I logged in.


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://www.cyberciti.biz/faq/howto-set-date-time-from-linux-command-prompt/"
linktext was:"https://www.cyberciti.biz/faq/howto-set ... nd-prompt/"
====================================


What I think probably would fix it permanently would be a"root terminal" which I've seen in some distros, which requires you to enter a root password as soon as you open it up; is it possible to set up one of those in AntiX?
Posts: 45
Colonel Panic
Joined: 14 Mar 2010
#14
Here's a post which explains how to add your username to the sudo group, which seems to me to be at least a partial solution and makes it unnecessary to enter the password every time sudo is used;

Just add the user to the sudo group:

sudo adduser <username> sudo

The change will take effect the next time the user logs in.

This works because /etc/sudoers is pre-configured to grant permissions to all members of this group (You should not have to make any changes to this):

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL



========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://askubuntu.com/questions/7477/how-can-i-add-a-new-user-as-sudoer-using-the-command-line"
linktext was:"http://askubuntu.com/questions/7477/how ... mmand-line"
====================================
Posts: 98
ile
Joined: 29 Jan 2016
#15
hello stakhanov and hello everone
hi Colonel Panic"root terminal" we found is in the Menu : >Applications >System Tools > Root Terminal.
in antix this will ask for the sudo group User password, not root password, to open a superuser priveleged console.