Operating System - Linux
1832650 Members
3046 Online
110043 Solutions
New Discussion

Re: ss -u not putting me in my /home/ directory.

 
joseph wholey
Regular Advisor

ss -u not putting me in my /home/ directory.

I'm having a problem using sudo. When I issue ss -u , it does switch to my uname as expected, but it does not put me in my /home directory. It leaves me where I ss'ed from. I have my uname in both ssers and sslogin. Any suggestions? thx.
8 REPLIES 8
Ivan Ferreira
Honored Contributor

Re: ss -u not putting me in my /home/ directory.

I don't know the ss command, its an alias? You may try the -H option of sudo.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
spex
Honored Contributor

Re: ss -u not putting me in my /home/ directory.

Joseph,

I bet 'ss' is an alias for 'sudo su'. Try this:
$ ss -u -
or
$ sudo -u su -

The '-' makes the shell a login shell, which causes the user's startup scripts to be executed.

PCS
joseph wholey
Regular Advisor

Re: ss -u not putting me in my /home/ directory.

No... ss a link to sudoshell. ss -u logs you in as a specific user and should execute that user's profile. The problem is, I'm not being switched to the user's home directory, therefore, the profile is not being executed.
spex
Honored Contributor

Re: ss -u not putting me in my /home/ directory.

Joseph,

Check out what's new in sudoscript 2.1.2:

http://sourceforge.net/project/shownotes.php?release_id=284854&group_id=50616

New Option to sudoshell
=======================
The"-" option has been added to ss/sudoshell. This sets the $HOME
environment variable to that of the user ss will become. This causes
the shall (bash, at least) to load the target user's environment instead
of the calling user's.

Seems like what you need.

PCS
joseph wholey
Regular Advisor

Re: ss -u not putting me in my /home/ directory.

Yes... that's exactly what I'm trying to accomplish, however, it's not working... I'm issuing "ss -u " and expecting to be put in the /home directory of the target (or the uname I"m ss'ing to). Problem is, it's not putting me there.
spex
Honored Contributor

Re: ss -u not putting me in my /home/ directory.

But are you using version 2.1.2 and issuing 'ss -u -' (notice the extra '-')?

PCS
joseph wholey
Regular Advisor

Re: ss -u not putting me in my /home/ directory.

hmmm... interesting, I tried it, but that prompts me for a password. I'll have to do a little further investigation. thx.
joseph wholey
Regular Advisor

Re: ss -u not putting me in my /home/ directory.

Running out of steam on this one... here's my sudoers file, followed by my /etc/passwd, followed by /etc/group:

From user wasadmin, shouldn't I be able to "ss -u was_fps" and end up in was_fps' home directory?????? Any help would be greatly appreciated.

************************************
sudoers:
root ALL=(ALL) ALL
wasadmin rhel002=(was_fps) NOPASSWD: /usr/bin/ss -u was_fps
************************************
/etc/passwd:
wasadmin:x:200:200::/wasadmin:/bin/bash
was_fps:x:201:201::/wasadmin/was_fps:/bin/bash
************************************
/etc/group:
wasadmin:x:200:was_fps
was_fps:x:201:
ssers:x:97:wasadmin,was_fps
sslogin:x:500:wasadmin,was_fps