LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2005, 11:23 AM   #1
tulip4heaven
Member
 
Registered: Jan 2005
Posts: 55

Rep: Reputation: 15
login problem


Dear Fellows.

Hi

here is little question , i m login to my linux box with user name and password(not as a root user).

i m in terminal.
i want execute some commands ,commands needs to be login as a root user.

Is there any way to login in terminal as a root , while i m login to box with a simple user.

sorry for poor english

Thanks
 
Old 03-29-2005, 11:27 AM   #2
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Type su and hit enter, it will ask the root password. Type Ctrl-d to exit su.
 
Old 03-29-2005, 01:59 PM   #3
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slackware 14.2
Posts: 849

Rep: Reputation: 33
Quote:
i want execute some commands ,commands needs to be login as a root user.
To run a command without actually loggin in as root run...

Code:
su -c thecommandUwant2run
It'll prompt you for roots password, and if entered right, it'll execute the command for you.
 
Old 03-29-2005, 02:58 PM   #4
rael_kid
Member
 
Registered: Mar 2005
Location: Holland
Distribution: Ubuntu
Posts: 37

Rep: Reputation: 15
sudo

You can also give your personal account the right to execute 'root-commands'. As root run:

visudo

You'll get to see a file which contains the line:

root ALL=(ALL) ALL

simply add this line beneath that one:

myuser ALL=(ALL) ALL

and save it. Now in the terminal you can use sudo to execute 'root-commands':

sudo theCommandYouWant

You'll be promted for your userpassword (NOT your rootpassword) when you use this the first time after opening the terminal.
And if you don't use sudo for a while in an already opened terminal.

I hope I made myself clear.

Good luck!

Lex
 
Old 03-29-2005, 09:57 PM   #5
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
sudo is a good option for giving regular users access to run commands that can only be run by the superuser or another user. There are some neat security measures available within this utility. You'll want to look over the sudo and sudoers man pages to get a better idea of how it works.

Often when setting up new software or new procedures a regular user will run into roadblocks that can only be resolved by the superuser. The best way around this is to become superuser for a short time and then go back to your normal user account. This is done with the su command. I would recommend using su - over just su so that your default path gets set up properly. Otherwise programs in /sbin and /usr/sbin will not be recognized without using the full path or ./ in the directory where they are stored.

Bill
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in login linuxthebest Linux - Newbie 3 08-09-2005 09:20 PM
Login problem Frederik Valeur Linux - Software 3 06-12-2005 09:46 PM
Login Problem KAAZ Linux - Distributions 2 10-26-2004 10:56 PM
Login Problem sratz Linux - Security 1 07-15-2004 09:40 AM
Login problem with RH 7.1 bildnisse Linux - Newbie 2 01-01-2002 10:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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