Re: One-user system. Was "One user system."

2022-02-16 Thread mick crane

On 2022-02-11 19:10, Andrei POPESCU wrote:

On Jo, 10 feb 22, 11:11:01, rhkra...@gmail.com wrote:

On Wednesday, February 09, 2022 06:08:16 AM Andrei POPESCU wrote:
> I've switched to using sudo because it encourages me to use root only
> when strictly required.

That's a good idea, but I'll mention what I do -- I may have started 
before

sudo existed (or, at least, before I knew about it).

I use kde and keep several konsole (terminals) open, at on one, I open 
it as
root and set the background to be a different color than the non-root 
konsole

(a shade of yello).

(Once you pick a color for the background (or any of variety of other 
user
preferences), you can save those so, for example, every time I open a 
konsole

as root, it gets those preferences.


I did use to have a root window constantly open and "Ctrl-a r" is still
opening a 'sudo -i' window in tmux.

The trouble with that is that I would tend to use the root console for
non-root things. Besides, it's annoying to 'cd' in the non-root 
terminal

in some deep directory structure only to find out you need root
permissions to do what you actually needed to do when you got there.


I've su'ed first before diving into the file system if I thought I was 
going to edit something as root but now I think should

"echo $PWD" when there.
copy that, "su -" and "cd paste".

mick
--
Key ID4BFEBB31



Re: One-user system. Was "One user system."

2022-02-13 Thread David Wright
On Thu 10 Feb 2022 at 20:26:57 (+), Joe wrote:
> On Thu, 10 Feb 2022 11:11:01 -0500 rhkra...@gmail.com wrote:
> > On Wednesday, February 09, 2022 06:08:16 AM Andrei POPESCU wrote:
> > > I've switched to using sudo because it encourages me to use root
> > > only when strictly required.  
> > 
> > That's a good idea, but I'll mention what I do -- I may have started
> > before sudo existed (or, at least, before I knew about it).
> > 
> > I use kde and keep several konsole (terminals) open, at on one, I
> > open it as root and set the background to be a different color than
> > the non-root konsole (a shade of yello).  
> > 
> > (Once you pick a color for the background (or any of variety of other
> > user preferences), you can save those so, for example, every time I
> > open a konsole as root, it gets those preferences.
> > 
> 
> Just an additional note if you use mc: you can change the colours of the
> mc window and save the changes, but when you close mc the previous
> config file will overwrite the new one. What you have to do is to save
> the config, then rename it from outside mc with mc still running. Close
> mc, rename the new config file back to the original name, then it will
> be used next time you start mc. 
> 
> A bit of a faff, which is why I don't change things often. But my
> server is console-only, and I found mc to be an excellent file manager
> and simple text editor for it. I also have different background colours
> depending on whether it is opened with sudo or not.

Why not just set these five file permissions to readonly?
.config/mc/{ini,panels.ini} .cache/mc/Tree{,.tmp} .local/share/mc/history
The last might need to be owned by root (for normal users), or
chattr +i   if you run mc as root. (I don't.)

> Yes, it's a dangerous beast as root, but what are you doing on a server
> if not admin work (carefully)?

Cheers,
David.



Re: One-user system. Was "One user system."

2022-02-11 Thread Andrei POPESCU
On Jo, 10 feb 22, 11:11:01, rhkra...@gmail.com wrote:
> On Wednesday, February 09, 2022 06:08:16 AM Andrei POPESCU wrote:
> > I've switched to using sudo because it encourages me to use root only
> > when strictly required.
> 
> That's a good idea, but I'll mention what I do -- I may have started before 
> sudo existed (or, at least, before I knew about it).
> 
> I use kde and keep several konsole (terminals) open, at on one, I open it as 
> root and set the background to be a different color than the non-root konsole 
> (a shade of yello).  
> 
> (Once you pick a color for the background (or any of variety of other user 
> preferences), you can save those so, for example, every time I open a konsole 
> as root, it gets those preferences.
 
I did use to have a root window constantly open and "Ctrl-a r" is still 
opening a 'sudo -i' window in tmux.

The trouble with that is that I would tend to use the root console for 
non-root things. Besides, it's annoying to 'cd' in the non-root terminal 
in some deep directory structure only to find out you need root 
permissions to do what you actually needed to do when you got there.

With sudo I'm incentivized to use non-root as much as possible, even if 
only because I'm too lazy to switch terminals or type 4 letters and a 
space ;)

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature


Re: One-user system. Was "One user system."

2022-02-10 Thread Joe
On Thu, 10 Feb 2022 11:11:01 -0500
rhkra...@gmail.com wrote:

> On Wednesday, February 09, 2022 06:08:16 AM Andrei POPESCU wrote:
> > I've switched to using sudo because it encourages me to use root
> > only when strictly required.  
> 
> That's a good idea, but I'll mention what I do -- I may have started
> before sudo existed (or, at least, before I knew about it).
> 
> I use kde and keep several konsole (terminals) open, at on one, I
> open it as root and set the background to be a different color than
> the non-root konsole (a shade of yello).  
> 
> (Once you pick a color for the background (or any of variety of other
> user preferences), you can save those so, for example, every time I
> open a konsole as root, it gets those preferences.
> 

Just an additional note if you use mc: you can change the colours of the
mc window and save the changes, but when you close mc the previous
config file will overwrite the new one. What you have to do is to save
the config, then rename it from outside mc with mc still running. Close
mc, rename the new config file back to the original name, then it will
be used next time you start mc. 

A bit of a faff, which is why I don't change things often. But my
server is console-only, and I found mc to be an excellent file manager
and simple text editor for it. I also have different background colours
depending on whether it is opened with sudo or not.

Yes, it's a dangerous beast as root, but what are you doing on a server
if not admin work (carefully)?

-- 
Joe



Re: One-user system. Was "One user system."

2022-02-10 Thread rhkramer
On Wednesday, February 09, 2022 06:08:16 AM Andrei POPESCU wrote:
> I've switched to using sudo because it encourages me to use root only
> when strictly required.

That's a good idea, but I'll mention what I do -- I may have started before 
sudo existed (or, at least, before I knew about it).

I use kde and keep several konsole (terminals) open, at on one, I open it as 
root and set the background to be a different color than the non-root konsole 
(a shade of yello).  

(Once you pick a color for the background (or any of variety of other user 
preferences), you can save those so, for example, every time I open a konsole 
as root, it gets those preferences.



Re: One-user system. Was "One user system."

2022-02-09 Thread Andrei POPESCU
On Vi, 04 feb 22, 10:34:38, pe...@easthope.ca wrote:
> 
> root@joule:/root# df | grep sd
> /dev/sda27159288  6635136140768  98% /
> /dev/sda4  131124764 12951820 111512132  11% /home
> /dev/sdb13658244  2026200   1446196  59% /home/root/MY
> 
> Note that / is 98% full whereas /home is 11% full. The intention in 
> moving the root home directory from / to /home is just to have space 
> for my data. 

It's unclear what you mean by "data" here, but typically the things that 
are expected to reside in a (super)user's home directory are mostly 
small, i.e. dotfiles and the likes.

Everything else can just be stored elsewhere, no need to relocate the 
home directory itself.

> Yes, 98% needs attention.
> 
> Rather than link /root to /home/root probably better to edit 
> /etc/passwd to have root homed at /home/root. Can try that.
> 
> > You may hit snags. Some programs might refuse to run, or do
> > strange things because they're written to distinguish between
> > root and an ordinary user.
> 
> Used it since yesterday with no significant problem.

It wouldn't surprise me to find out some application is explicitly hard 
coding '/root' as the home directory for the root user, regardless of 
what is specified in /etc/passwd.

> > But hey, it could be quite exciting, like carrying a cocked
> > revolver tucked into your waistband. One casual typo, one
> > misplaced space, and you can blow away a whole disk.
> 
> I view this as an experiment.  If I destroy the system, I reinstall.  
> The debian installer is moderately easy to use.  =8~)
> 
> Also I have the spare machine ready to go as described in the smartd 
> thread.
> 
> Did you use DOS decades ago?  Have you clobbered a DOS system?

More than once :)

I've switched to using sudo because it encourages me to use root only 
when strictly required.

Many admin tools work fine without root permissions when used only to 
retrieve information (e.g. 'apt', 'systemctl') as opposed to do changes 
to the system. It might help to add your user to group 'adm' 
('journalctl') or add [/usr]/sbin to your $PATH ('zpool', 'zfs').

If something really needs root (e.g. 'dmesg') it's just a simple Ctrl-a 
and type 'sudo', especially if sudo is configured to allow 
that specific command without providing a password ;)

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature


Re: One-user system. Was "One user system."

2022-02-04 Thread peter
"One-user" is probably the correct grammar.

David,

From: David Wright 
Date: Wed, 2 Feb 2022 11:08:28 -0600
> And it's been designed with that in mind. Debian hasn't.

I wondered whether others had worked out a recipe for single-user.  In 
fact, yes, there's DebianDog.  References 7 and 8 here.
https://en.wikipedia.org/wiki/Light-weight_Linux_distribution

> I can't understand this. If you carry out your intention, then
> /home becomes just another top-level directory like /media.
> You don't need to put /root into it just to make a point. You
> can use it for just your data files, and not your dotfiles —
> particularly if /home is on a separate partition.

I don't understand either.  We're "at crossed purposes"?

root@joule:/root# df | grep sd
/dev/sda27159288  6635136140768  98% /
/dev/sda4  131124764 12951820 111512132  11% /home
/dev/sdb13658244  2026200   1446196  59% /home/root/MY

Note that / is 98% full whereas /home is 11% full. The intention in 
moving the root home directory from / to /home is just to have space 
for my data. 

Yes, 98% needs attention.

Rather than link /root to /home/root probably better to edit 
/etc/passwd to have root homed at /home/root. Can try that.

> You may hit snags. Some programs might refuse to run, or do
> strange things because they're written to distinguish between
> root and an ordinary user.

Used it since yesterday with no significant problem.

> But hey, it could be quite exciting, like carrying a cocked
> revolver tucked into your waistband. One casual typo, one
> misplaced space, and you can blow away a whole disk.

I view this as an experiment.  If I destroy the system, I reinstall.  
The debian installer is moderately easy to use.  =8~)

Also I have the spare machine ready to go as described in the smartd 
thread.

Did you use DOS decades ago?  Have you clobbered a DOS system?

If interested, try DebianDog or Puppy or my simpistic approach.

> Not really — except perhaps on Puppy where it's been seen as
> controversial, and hence discussed.

Discussion here.  https://wikka.puppylinux.com/spot
Note priviledge and and security aspects.

> ISTR earlier posts where you've run up against permission problems, ...

Not my motivation.  This computer isn't a mainframe system with 
multiple users. I'm just exploring simplifications.

Thanks for the feedback,... P.





-- 
mobile: +1 778 951 5147
  VoIP: +1 604 670 0140
   48.7693 N 123.3053 W