Re: SSH Logging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thomas Kappelmueller wrote:
Thomas Kappelmueller wrote:
Mike wrote:
On Mon, 17 Mar 2008, Thomas Kappelmueller wrote:

Hallo!

Is there a easy way to log all the output of a SSH-Session?

Not only the commands but actually all the output you get in the SSH-Client. I am using Fedora and CentOS.

I've tried a few different things in the sshd_config but with no success.

Thankyou

-Tom


Is 'script' what your looking for?


Hi!

Yes thanks alot. I put the script command into .profile.

Code:
if [ -n "${SSH_CLIENT}" -a "${USER}" = "root" ]; then
    script -q ~/session_logs/$(date +%Y%m%d-%k%M%S)
fi

Cheers!
-Tom


One thing that makes it not perfectly perfect ;) is the fact that you have to exit twice.
I added an exit after the script command.

You can just "exec" the script command and avoid that.

--
Bill Davidsen <davidsen@xxxxxxx>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux