Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag 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
ASKER CERTIFIED SOLUTION
Avatar of Alan
Alan
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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
Avatar of 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
Avatar of noci
noci

Please check the TMOUT environment variable:

echo $TMOUT

I guess you get 60 back.
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.
@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.
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.
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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..
Avatar of 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?
Avatar of 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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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...
Avatar of 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
It keep watching until you stop it; meaning when you do ctrl-c, it will cancel the command.