Avatar of gudii9
gudii9
Flag for United States of America asked on

sign out issues on linux production servers

unix server keep sign out after 1 minute or so on production.

is there is a way i can run some process like

tail -f xyz.gz
to keep continuous rolling until i cancel that so that it wont sign out on me while i focus on some other work  for 30 miinutes and come back it should not signout
please advise
LinuxLinux NetworkingLinux OS DevUnix OSLinux Distributions

Avatar of undefined
Last Comment
Robert Lem

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Alan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Scott Silva

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
noci

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
i cannot change anything on prod servers
i tried
tail -f xyz.gz

problem i faced after some time that file consolidated and new file getting created and my tail is failing and server is signing out again
does watch do that continuously?
SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
$ watch -l xyz.log.20181011
watch: invalid option -- 'l'
Usage: watch [-dhntv] [--differences[=cumulative]] [--help] [--interval=<n>] [--no-title] [--version] <command>
i get above error
please advise
gudii9

ASKER
start by describing how you've logged into your production server.


i have putty
i go to the particuler server say
server6

it asks username i give like john
it asks interactive password i give my 8 digit passcode i set earlier along with rsa token code which keeps on changing every few secons
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
noci

Please check the TMOUT environment variable:

echo $TMOUT

I guess you get 60 back.
David Favor

The normal way to disable connection timeouts with ssh is to pass -o TCPKeepAlive=yes which means all connections are persistent... never timeout...

http://www.nth-design.com/2010/05/10/using-keepalive-in-putty/ shows how to enable this in Putty.
noci

@David, TCPKeepAlive is for keeping traffic so NAT tables / statefull inspection data in a firewall don't get dropped. And that mostly peters out with 20 something minutes.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Alan

Hi,

In terms of using 'watch', I missed typing 'ls' in there.  It should be:

watch ls -l xyz.log

Open in new window

However, no idea if that will work or not (in terms of keeping the session alive).

As mentioned above, 'screen' is possibly a good option.

Alan.
David Favor

I suggest you give the KeepAlive trick a try + see if that fixes your problem.

If this fails, try https://bjornjohansen.no/ssh-timeout which discusses sshd settings which effect session life.

Keep in mind. If you change sshd settings, you must restart sshd + then start new sessions for new settings be take effect.
SOLUTION
Mihai Barbos

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
noci

Did you check the TMOUT variable. If set that is the max idle time for a shel before it logs you off.
if TMOUT has been set you can just change it by setting to the right number of seconds:
TMOUT=1800   # 30 minutes
TMOUT=3600   # one hour\
TMOUT=86400 # one day

before the idle timer drops the shell.
In your case it probably is 60..
echo $TMOUT #will tell.

Please confirm it's setting ro tell here TMOUT is not set..
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
gudii9

ASKER
$ echo $TMOUT

above did not return any value
i do not have any control on these boxes except i can read those logs
any alternate trick to keep session alive all the time?
gudii9

ASKER
$ watch -l xyz.log.20181011
watch: invalid option -- 'l'
Usage: watch [-dhntv] [--differences[=cumulative]] [--help] [--interval=<n>] [--no-title] [--version] <command>
i get above error
please advise
what is wrong with above command?
SOLUTION
Robert Lem

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Scott Silva

If you are not allowed to extend the timeout I think screen might be your only option. But if you also don't have screen or aren't allowed to install it, your options will be extremely limited...

It is a bit uncommon for someone that is allowed log access to not have some influence on needed tools to do that job...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
Missing the command to watch "ls". The -l option applies to the ls command not the watch command.

Type: watch ls -l xyz.log.20181011

above command worked.

how long it keep watching
Robert Lem

It keep watching until you stop it; meaning when you do ctrl-c, it will cancel the command.