Access to different accounts logs in one login?


#1

Hi,

I´ve heard about the tail command in the ssh shell that would allow me to monitor multiple logs at the same window.

Problem is that I don´t have access to the logs for a different user login, is there a way around it, since we don´t get root access?

Decio.


Use promo code US97OFF to get maximum discounts!
Use o código de promoção US97OFF para descontos de até US50!


#2

You could perhaps try sudo’ing to a different user while logged in as another…

ie.: su username


Chips N Cheese - Custom PHP installs and the like!


#3

Another “su” trick is to ‘sudo -u USER tail /fullpath/blahblah’

-Scott


#4

From what I understood, the advantage of using tail is that I could see all the logs merged as one output.

But that won´t work with sudo, would it? As one tail command had to have access to different log folders. Can I change the access priviledge of the log folder?

Decio.


Use promo code US97OFF to get maximum discounts!
Use o código de promoção US97OFF para descontos de até US50!


#5

Since everything’s a stream in linux/unix you can always tail a tail so if you can have multiple files open in a tail you can have multiple tails open in a tail.

Wholly - Use promo code WhollyMindless for discount.


#6

How would this command be then?


Use promo code US97OFF to get maximum discounts!
Use o código de promoção US97OFF para descontos de até US50!


#7

I would try something like:
sudo -u USER1 tail /fullpath1/blahblah1 &
sudo -u USER2 tail /fullpath2/blahblah2 &
sudo -u USER3 tail /fullpath3/blahblah3 &
sudo -u USER4 tail /fullpath4/blahblah4 &

The ampersand will set it to run in background, but will continue to spew output on your screen in realtime. Do a Google search on the ‘fg’ and ‘bg’ commands to see how to manage background tasks.

-Scott


#8

If you find the lines getting mixed up on your tty, you could try redirecting output from each sudo to a different file and then tailing the multiple output files in a separate process. This might net you the nice multi-file output that tail is capable of (labeling output from each file separately, not mixing up lines of output, etc.)

extra domains and the new maximum $50 off with codes [color=#CC0000]1DOM50, 2DOM50 and 3DOM50[/color]. More Dreamhost coupons


#9

From man tail:

"Print the last 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. "

For continued spew, use watch “tail file”.

tor.eff.org
Promos: MaxTOR: Save [color=#CC0000]Maximum[/color] TOR: Save Maximum and [color=#00CC00]give $1 to TOR[/color]


#10

I think the original poster wants all lines interspersed, which is why I suggested running all in background.

Dang, I forgot to say ‘tail -f’ for each of the above commands. That will get the log to continuously spew as it’s updated.

-Scott


#11

I wasn’t sure if the output would be line-by-line or mixed up in the middle of a line with all the background processes spewing at once.

extra domains and the new maximum $50 off with codes [color=#CC0000]1DOM50, 2DOM50 and 3DOM50[/color]. More Dreamhost coupons


#12

Good point. I’m not sure. Maybe the original poster can give it a try and let us know.

-Scott


#13

Hi,

I haven’t figured out how I can enter the password for that particular user in the sudo command line. Or do I have to do that with some sort of batch script.

I really don’t know my way around linux…

Decio.