LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-14-2002, 08:31 AM   #1
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Rep: Reputation: 30
Adduser...


i was doing adduser... where i added a user by command line... so i went back to the console and logged in as the new user and ran startx... an error returned permission denied and then something about .xauthority not having been set properly... anyone know why that was? also when i looked into that user's directory i did not find a file called .xauthority...
 
Old 02-14-2002, 10:54 AM   #2
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
just copy the .xauthority file from your /root/ dir to the user's home, then you should be able to start x. also, it's a good idea to copy any necessary files for user additions to the /etc/skel directory so you don't run into this problem in the future.
 
Old 02-14-2002, 01:47 PM   #3
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 72
If this is on the LFS system... /usr/X11/bin is not in the new users path probably, but startx is... so you have to add that to their path, and also, /etc/skel. You might also want to copy the useradd script out of any modern distro as Slack's and RH's fit in pretty seemlessly with LFS.

Cheers,

Finegan
 
Old 02-14-2002, 10:38 PM   #4
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Original Poster
Rep: Reputation: 30
how would you add startx to a user's path? or any command for that matter...
 
Old 02-14-2002, 11:52 PM   #5
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
If you got a "permission denied" error, it probably has more to do with the .Xauthority issues (or permissions in general) than pathing. Trying to execute a command which lives in a directory not in your path usually results in a "command not found error" instead of "permission denied".

However, here's how the pathing deal goes:

When a user tries to execute a program at the command prompt, the shell looks for the filename in the directories entered in that user's PATH environment variable. If it doesn't find the file in any those directories, it barfs a "command not found" error. This is how DOS does things as well. Note that for security reasons, the directory you are currently in (".") is not searched unless you explicitly tell the shell to look there by prefixing "./" (no quotes) to the command you type.

To append a new directory to an individual user's path in bash, add the following statement to the .bash_profile file in the user's home directory: PATH= $PATH:new_directory_name

To add a path globally (for all users), put that same line in /etc/profile.

In either case, there needs to be an "export" line somewhere after the PATH line, and it must include the word PATH. It might look something like:
export PATH PS1 USER LOGNAME HOSTNAME

This link gives a little more info if you're interested.

By the way:
A) to find out which directories are in the PATH variable, do:
echo $PATH

B) For the changes to take effect, you'll have to kill and restart the shell (logging out and then back in does this), or source the file you edited with the (duh) source command. For example:
source ~/.bash_profile.

Last edited by DMR; 02-15-2002 at 12:10 AM.
 
Old 02-15-2002, 07:53 AM   #6
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Original Poster
Rep: Reputation: 30
DMR- Thanks! That made all the sense in the world... very similar to the way you do that in DOS...
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adduser jp_ Linux - General 6 10-18-2005 02:11 PM
adduser bally Linux - General 7 08-09-2004 01:28 PM
adduser trophy Red Hat 1 05-01-2004 09:11 AM
adduser teqno Linux - Newbie 5 12-08-2003 12:26 PM
Adduser - xmdms Linux - Newbie 3 10-23-2003 03:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:01 AM.

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