LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2004, 06:37 PM   #1
neoific
LQ Newbie
 
Registered: Nov 2004
Distribution: Fedora Core 1, Mandrake, and Knoppix
Posts: 1

Rep: Reputation: 0
Bash Coding Help


Hey im making a bash program (.sh) for my game server.
Im trying to A) make a new user [depending on the variable] B) Set the password [depending on the vavriable] and C) Login to that user, run a command, then go back to the user you were logged in as before.
I already know steps A and B but I dont know how to login as another via Bash commands. It would be nice if I knew how to do this.
 
Old 11-11-2004, 08:24 PM   #2
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
I assume this script is running as root to be able to create a new user... so you can use
Code:
su newusername -c "command to run as newusername"
 
  


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
c coding trace bruse Linux - Newbie 2 07-13-2005 05:25 PM
Coding a WM? SocialEngineer Programming 1 05-20-2005 09:32 AM
Coding Forum Pauli LQ Suggestions & Feedback 3 03-19-2005 07:38 PM
Coding a Shell Smooth Programming 4 09-19-2003 01:59 AM
irc coding nautilus_1987 General 1 12-07-2002 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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