FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 02-18-2009, 10:58 AM
Pol
 
Default 'su' without password

How to let user1 'su' user2, without entering password?

Thank you
--Pol


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-18-2009, 10:06 PM
Smoot Carl-Mitchell
 
Default 'su' without password

On Wed, 2009-02-18 at 12:58 +0100, Pol wrote:
> How to let user1 'su' user2, without entering password?

You cannot do that with 'su'. You can do it with "sudo". Add a line
like this to the sudoers file:

user1 ALL=(user2)NOPASSWD: ALL

Then user1 can run a command as user2 by typing:

sudo -u user2 command args ...

For a shell as user2 the command would be:

sudo -u user2 -i

See "man sudoers" for all the gory details.
--
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot@tic.com
+1 480 922 7313
cell: +1 602 421 9005

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-18-2009, 10:13 PM
Nils Kassube
 
Default 'su' without password

Pol wrote:
> How to let user1 'su' user2, without entering password?

Really without entering a password only works for root. If user1 can use
sudo it would be

sudo su user2

but then user1 has to enter his own password. Otherwise it will only work
if user2 has no password.


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-19-2009, 04:28 AM
Pol
 
Default 'su' without password

Smoot Carl-Mitchell wrote:
> On Wed, 2009-02-18 at 12:58 +0100, Pol wrote:
>> How to let user1 'su' user2, without entering password?
> Then user1 can run a command as user2 by typing:
>
> sudo -u user2 command args ...

It seems that 'command' does not get the environment of the user2, this way.

I would start application of user2 (konqueor web browser) into the .kde of
user2. (konqueror complains that dcopserver of user2 has not started),
rather than .kde of user1.

Thank you
--P


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-19-2009, 03:32 PM
Smoot Carl-Mitchell
 
Default 'su' without password

On Thu, 2009-02-19 at 06:28 +0100, Pol wrote:
> Smoot Carl-Mitchell wrote:
> > On Wed, 2009-02-18 at 12:58 +0100, Pol wrote:
> >> How to let user1 'su' user2, without entering password?
> > Then user1 can run a command as user2 by typing:
> >
> > sudo -u user2 command args ...
>
> It seems that 'command' does not get the environment of the user2, this way.

That is correct. If you want to become user2 completely, you can do:

sudo -u user2 -i

which will give you a shell with user2's environment. Any command typed
at that point will be with respect to user2's environment settings.
--
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot@tic.com
+1 480 922 7313
cell: +1 602 421 9005

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-19-2009, 06:57 PM
Norberto Bensa
 
Default 'su' without password

On Thu, Feb 19, 2009 at 3:28 AM, Pol <xtekhne@gmail.com> wrote:
> Smoot Carl-Mitchell wrote:
>> sudo -u user2 command args ...
>
> It seems that 'command' does not get the environment of the user2, this way.


sudo su - user2

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 06:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org