LinuxQuestions.org
Visit Jeremy's Blog.
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 06-20-2002, 12:30 AM   #1
MrPolite
Member
 
Registered: Jun 2002
Location: Middle of nowhere
Posts: 109

Rep: Reputation: 15
switching users?


I have Mandrake Linux 8.2, I'm wondering if it's possible to switch between users without compeletely logging out (like win xp).... I just want to run a program and I dont have root permissions. I'm using the console to run the program, is it possible to run it as root?
 
Old 06-20-2002, 12:41 AM   #2
Sfin
Member
 
Registered: Apr 2002
Location: Michigan
Distribution: Slackware 8.0
Posts: 197

Rep: Reputation: 30
If you want to run a program as root in the console window then this is what you got to do:

type: su

This will prompt you to enter the root password. Once you entered the correct pass, and hit enter, you are root in the console. SO run your program now.
 
Old 06-20-2002, 12:58 AM   #3
MrPolite
Member
 
Registered: Jun 2002
Location: Middle of nowhere
Posts: 109

Original Poster
Rep: Reputation: 15
tnx alot!!! worked
 
Old 06-20-2002, 01:45 AM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
you can also use su to login as maybe another user..
su user1
most use su to just login as root though. and another tip is to give this command to get full root rights and path's:

su -
or
su - root
 
Old 06-20-2002, 01:54 AM   #5
MrPolite
Member
 
Registered: Jun 2002
Location: Middle of nowhere
Posts: 109

Original Poster
Rep: Reputation: 15
umm tnx, but I really dont get what su - does, what do you mean to get full root paths?
Umm also why is it bad to log in as root? because it warned me when I did so, it said that I can mess up with system. Why would that possibly happen?
 
Old 06-20-2002, 02:56 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
I think (really, because I really don't know) that SU doesn't stand for SUper User like I had always thought, instead I think it stands for Switch User. That is why the su - is the command rather than simply su. And since you can do a su - <user> to change to another user. Cool, I hope that helps?
 
Old 06-20-2002, 03:02 AM   #7
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I think su stands for substitute user. Anyways the - option simulates a full login by running files like .profile and .bashrc. And it sets the current working directory to the users home directory. Usually in those .profile and .bashrc files certain environment variables get set specific to a certain user. Some of these are sometimes needed to run a program.
 
Old 06-20-2002, 03:08 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Yep, I just went to the man pages on here, checked out su and you are absolutely right.
"su - run a shell with substitute user and group IDs"
straight outta the man.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Need help with switching users in Kpilot and KpilotDeamon danishmr Linux - Laptop and Netbook 0 11-14-2005 01:03 AM
switching users in gnome mherring02 Linux - Software 1 10-12-2005 09:22 PM
No Sound when switching Users Malacandra Linux - Hardware 6 02-23-2005 02:58 PM
Switching users... Tsion_avienu Red Hat 5 01-06-2005 12:29 PM
switching users in a script NGraphiX Linux - General 7 09-25-2002 04:20 PM

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

All times are GMT -5. The time now is 05:37 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