LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-08-2008, 07:35 AM   #1
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 393

Rep: Reputation: 81
root vs 'normal' user


Just installed slackware-12.1 and so far so good, but ...

As user 'root' everything is just great. I created .bash_profile and .bashrc to my preference and using xfce - well, suffice to say no probs at all.

As a normal user, however, I have issues.
a) using the same .bash_profile and .bashrc as 'root', they are not honoured on login.
b) however, if I make .profile a link to .bash_profile, it is working (ie my personal settings are honoured again)
c) using xfce, the 'terminal' is not working - it does not react to any keypress and the terminal window remains black. the cursor is coloured, but it doesn't move when I type (ie I am not running 'black' on 'black'). Also, the PROMPT_COMMAND does not alter the 'name' of the terminal window (under 'root' it works just fine)
d) if I bring up 'konsol' rather than 'terminal' - again it works properly.

I see that the screensaver has issues when I log in as normal user, because it says that I started off as {username}:shadow and now I am {username}:users.

Any help to resolve this matter would be greatly appreciated!!
 
Old 05-08-2008, 10:18 AM   #2
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,154

Rep: Reputation: 187Reputation: 187
Quote:
Originally Posted by perbh View Post
Just installed slackware-12.1 and so far so good, but ...

As user 'root' everything is just great. I created .bash_profile and .bashrc to my preference and using xfce - well, suffice to say no probs at all.

As a normal user, however, I have issues.
a) using the same .bash_profile and .bashrc as 'root', they are not honoured on login.
The files in /root are not allowed to be accessed by users, you will have to either copy them to the /home/$USER directory and change the ownership to the user or make new ones...

fixing this may (or may not) resolve the other issues...
 
Old 05-08-2008, 11:17 AM   #3
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 393

Original Poster
Rep: Reputation: 81
Done that!
Logged in as root, cd to /home/$USER, copied down .bash_profile and .bashrc and then changed ownership to $USER:users

I do a lot of my work as root but like to log in as $USER, open a couple of terminals and then 'su -' to root ... (obviously_after_ having done a 'xhost +')
 
Old 05-08-2008, 12:37 PM   #4
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 393

Original Poster
Rep: Reputation: 81
C'mon guys - 87 views and none of you use xfce and non-root user??
That's almost unbelievable!
 
Old 05-08-2008, 12:42 PM   #5
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,154

Rep: Reputation: 187Reputation: 187
nope, i mostly use fvwm with my own customized .fvwm2rc
 
Old 05-08-2008, 08:12 PM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by perbh View Post
c) using xfce, the 'terminal' is not working - it does not react to any keypress and the terminal window remains black. the cursor is coloured, but it doesn't move when I type (ie I am not running 'black' on 'black').
I've seen this before. It's a bit of an obscure one, but the good news is that it's nice and easy to fix once you know what's going on.


Issue the following command as root and it should fix it for you:
usermod -s /bin/bash your_login_name

It appears that the xfce/gnome terminal program doesn't like it when the login shell for the user is left to default (i.e. the field is blank in /etc/passwd). Explicitly setting it with the -s option of useradd/usermod fixed it for me.


regards, and happy Slacking!

Last edited by GazL; 06-12-2011 at 05:21 AM.
 
Old 05-08-2008, 11:05 PM   #7
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by GazL
It appears that the xfce/gnome terminal program doesn't like it when the login shell for the user is left to default (i.e. the field is blank in /etc/passwd). Explicitly setting it with the -s option of useradd/usermod fixed it for me.
Sounds like a possible solution, but out of curiosity, why don't you just setup a login shell when you set up your user account? I guess I'm just used to using `adduser` instead of `useradd` (less memorization and straightforward user setup with basically all options available), which sets a default shell (/bin/bash).
 
Old 05-09-2008, 12:09 AM   #8
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
This account we likely set up using the KDE user manager or similar.. IIRC it doesn't default to a /bin/bash shell and will leave it blank.
 
Old 05-09-2008, 06:47 AM   #9
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by T3slider View Post
Sounds like a possible solution, but out of curiosity, why don't you just setup a login shell when you set up your user account?
Curiosity killed the cat you know!

Anyway, now I know xfce-terminal is so fussy I do, but prior to that I used to create users with useradd and let anything I didn't care about default.

According to passwd(5) it's perfectly valid to have a blank entry for the user shell. You could argue that it may not necessarily be a good idea as it introduces some uncertainty as to which shell is being used, but that's besides the point. I don't think it's unreasonable to expect the xfce-terminal to either cope with this situation, using /bin/sh as a default, or at the very least throwing out an alert dialog along the lines of "Error: No shell set for user". The fact it just sits there looking stupid and leaving the user to wonder what the hell is going on is either a bug, or poor program design/implementation.


Quote:
Originally Posted by T3slider View Post
I guess I'm just used to using `adduser` instead of `useradd` (less memorization and straightforward user setup with basically all options available), which sets a default shell (/bin/bash).
I'd actually forgotten adduser existed, but even though I've now been reminded , I still wouldn't choose to use it. At the end of the day, I guess its just personal preference.

'adduser' is a script wrapped around the real user maintenance commands. It has no manpage, which immediately puts it in my bad-books. "Thou shalt accompany thy program with a manpage" is the 11th commandment as far as I'm concerned.

So, with no manpage, in order to find out more about the command one is likely to issue something along the lines of:
adduser --help

... and the stupid script thinks you want to create a user called "--help"!


Personally, I try to avoid using wrappers for admin tasks where the underlying commands are perfectly usable. Especially so for poorly written or badly documented wrappers.

I don't know whether it's just because I've been using unix and linux for so long, but
useradd -m -s /bin/bash -g users -G plugdev,cdrom,audio,video gary

... really doesn't seem that hard to me, and is a lot faster to type than working through the adduser prompts. It also has the advantage of being usable from within scripts, and can be recalled/edited multiple times from your command history if you're creating multiple users all at once).


At the end of the day though, if adduser works well enough for you, and its failings don't offend your sensibilities the way they do mine (yep, I'm one of those annoying, overly anal, perfectionist types) then its entirely your choice.


Anyway... you did ask.

Last edited by GazL; 06-12-2011 at 04:51 AM.
 
Old 05-09-2008, 05:46 PM   #10
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
GazL, good points (although if you want to know what adduser is doing you could just issue `less /usr/sbin/adduser` and look at the script). I usually just set up one or two users, so bulk adding (and adding through scripts etc.) has never been an issue for me.

perbh, did this work?
 
Old 05-20-2008, 11:03 AM   #11
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 393

Original Poster
Rep: Reputation: 81
sorry guys - I've been 'out of commission' for a couple of weeks.
and yes and thank you all for the help - I just edited /etc/passwd (vi) and that did the trick!!
Thanks again!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't su into root as normal user darin3200 Linux - General 13 03-18-2010 11:03 AM
Normal & Root User sobia Linux - Security 7 10-03-2005 02:18 AM
Root? normal user? what does it all mean? Zieroth Linux - Newbie 5 07-16-2004 04:06 PM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-07-2004 11:11 PM
Root and normal user Smooth Linux - Newbie 4 05-27-2003 10:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration