Listing previous logins through sftp

399

On CentOS 6, /var/log/secure contains output from sshd, which launches the sftp subserver. By default, you will see messages similar to the following, but not much more:

Feb 25 12:34:56 server sshd[1234]: Accepted password for user from 1.2.3.4 port 12345 ssh2
Feb 25 12:34:56 server sshd[1234]: pam_unix(sshd:session): session opened for user user by (uid=0)
Feb 25 12:34:57 server sshd[1234]: subsystem request for sftp

If you want to have more visibility into sftp actions, like which files have been transferred, modify the following line in /etc/ssh/sshd_config:

Subsystem       sftp    /usr/libexec/openssh/sftp-server

to be

Subsystem       sftp    /usr/libexec/openssh/sftp-server -f AUTHPRIV -l INFO

and then restart sshd:

# service sshd restart

Then you will have the default logs plus logs like the following:

Feb 25 12:34:56 server sftp-server[1234]: session opened for local user user from 1.2.3.4
Feb 25 12:34:56 server sftp-server[1234]: opendir "/home/user/"
Feb 25 12:34:56 server sftp-server[1234]: closedir "/home/user/"
Feb 25 12:34:56 server sftp-server[1234]: open "/home/user/test" flags READ mode 0666
Feb 25 12:34:56 server sftp-server[1234]: close "/home/user/test" bytes read 1234 written 0
Feb 25 12:34:56 server sftp-server[1234]: session closed for local user user from 1.2.3.4
Share:
399
Divya Mehta
Author by

Divya Mehta

Updated on September 18, 2022

Comments

  • Divya Mehta
    Divya Mehta almost 2 years

    I have used an easy slider and a Telerik Mega Menu on my website. The following Script is included for slider along with the reference of the jquery 1.7.1:

    Here is the code for my mega menu:

    @(
     Html.Telerik().Menu()
            .Name("Mega Menu")
            .HtmlAttributes(new { @style = "background:#000000;" })
            .OpenOnClick(true)                  
            .Items(menu =>
            {
                menu.Add().Text("Mega Menu:")
                    .ContentHtmlAttributes(new { @style = "width:550px;" })
                    .Content(@<text>
    
                            <ul>
                            <li>Group1
                                 <ul>
                                   <li>Item1</li>
                                   <li>Item2</li>
                                   <li>Item3</li>
                                   <li>Item4</li>
                                </ul>
                            </li>
                            </ul>
    
                            <ul>
                            <li>Group2
                                 <ul>
                                   <li>Item1</li>
                                   <li>Item2</li>
                                   <li>Item3</li>
                                   <li>Item4</li>
                                </ul>
                            </li>
                            </ul>
     </text>);
            }
            )
            )
    

    Using these 2 scripts my slider as well as Mega Menu function properly in Mozilla Firefox and Chrome. But in IE8 jquery1.7.1 doesn't allow the Mega Menu to work. It works only if i use jquery1.5.1. But with this jquery, my slider stops functioning in other browsers. Although, there is no such problem in the functioning of slider by using jquery1.7.1 in IE8.

    Is there any way that i can use jquery 1.7.1 for the Mega Menu to work, without disturbing the functioning of my slider on any of the browsers(Firefox, Chrome, IE7,8 and 9)?

    Thanks.