LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 10-26-2004, 05:10 PM   #1
samsolaris
LQ Newbie
 
Registered: Aug 2003
Location: Brussels
Distribution: Solaris 9
Posts: 18

Rep: Reputation: 0
Question su with no password


Hi,

I'm trying to execute a shell with my user profile from another shell with a diffrent user (not root). Obviously it doesn't work because I have to enter my password.
Someone knows how to make so that it doesn't ask my password?

Thanxxx,

Sam
 
Old 10-26-2004, 05:34 PM   #2
serz
Member
 
Registered: Apr 2003
Location: Buenos Aires, Argentina
Distribution: Slackware, Gentoo
Posts: 397

Rep: Reputation: 30
I don't think you can do that ...
 
Old 10-26-2004, 05:48 PM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
You can write a small C program launching your shell, and set the setuid bit to it.
If you have access to the root account, just use sudo.
You can also allow the other user rsh access to your account, but this is very unsecure.
 
Old 10-27-2004, 03:27 PM   #4
samsolaris
LQ Newbie
 
Registered: Aug 2003
Location: Brussels
Distribution: Solaris 9
Posts: 18

Original Poster
Rep: Reputation: 0
HI,

I have written the C program but that does'nt work! I always have to enter the password!
I choose your second solution.
I think that it is the only solution.


Thanks a lot Jlliagre.

Sam
 
Old 10-27-2004, 04:02 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Show me your C program, and I'll fix it.
I'm positive it can be done !
 
Old 10-27-2004, 04:15 PM   #6
samsolaris
LQ Newbie
 
Registered: Aug 2003
Location: Brussels
Distribution: Solaris 9
Posts: 18

Original Poster
Rep: Reputation: 0
#include <stdio.h>
#include <stdlib.h>

main()
{
system("/PATH/TO/MY/script.sh")
}
 
Old 10-28-2004, 01:51 AM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#define TARGET_UID 1000

main()
{
  setuid(TARGET_UID);
  setgid(TARGET_UID);
  setegid(TARGET_UID);
  seteuid(TARGET_UID);
  system("/PATH/TO/MY/script.sh");
}
Replace 1000 with your userid in the define, compile the program and give the binary root suid, it should work.
 
Old 10-28-2004, 11:06 AM   #8
samsolaris
LQ Newbie
 
Registered: Aug 2003
Location: Brussels
Distribution: Solaris 9
Posts: 18

Original Poster
Rep: Reputation: 0
Yeah, that work!

Comme on dit => T'es une bête! ;-)

Sam
 
Old 10-28-2004, 11:18 AM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Thx
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
shadow password - password field ayhopkins Linux - Security 8 11-17-2005 05:25 AM
How can I change e-mail password(or linux account password) with php in website?? yusuf Programming 1 05-28-2004 09:39 AM
forgot my password ? i can change the password JrLz Linux - Security 9 04-06-2004 07:36 PM
Just change Samba password, not Unix password? sorrodos Linux - Networking 1 08-14-2003 07:52 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

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