1 |
On Sunday 01 February 2015 14:17:04 Alan McKinnon wrote: |
2 |
> On 01/02/2015 02:18, Adam Carter wrote: |
3 |
> > If you've su'd to root, try 'su -' instead. |
4 |
> > |
5 |
> > Thank you, that was it? |
6 |
> > What difference does it make and why on some boxes it has to be "su |
7 |
> > -" and on others simple "su" works. |
8 |
> > |
9 |
> > Read 'man su'. I dont really understand this stuff well enough, but a |
10 |
> > 'login shell', that is, one started by /bin/login, is setup with a |
11 |
> > different environment to a shell that's started by su (or by, say, |
12 |
> > cron). This is why a shell command or script may work for you when |
13 |
> > you're logged in, but not if you run it from cron. I'm sure other's can |
14 |
> > explain it more correctly and fully. |
15 |
> |
16 |
> This stuff is complex the first time you run into it. |
17 |
|
18 |
--->8 |
19 |
|
20 |
[Much good advice] |
21 |
|
22 |
I think of it simply like this: "su" switches user, and that's all; "su -" |
23 |
gives you the full environment of the user you switch to. |
24 |
|
25 |
-- |
26 |
Rgds |
27 |
Peter. |