Is there a way to log root commands from SSH on OpenVZ Node? I tried Snoopy and I was not able to exclude everything and leave only SSH commands.   @edit I want log ONLY commands sent through SSH/SFTP from remote host, because on my openvz node root is used to run many other commands locally. For example Snoopy is logging everything that happens on system (that is a lot of trash..), but I want to see what is done by any person on root by SSH/SFTP.
34963
It is company policy for admins to login to the servers via a personal username, and then run sudo -i to become root.  Upon running sudo -i, sudo will create an environmental variable called SUDO_USER, which contains the original user's username.  Is there a way to log ALL commands within syslog with something akin to the following syntax:  ${TIME/DATE STAMP}: [${REAL_USER}|${SUDO_USER}]: ${CMD}   An example entry would be:  Sat Jan 19 22:28:46 CST 2013: [root|ksoviero]: yum install random-pkg   Obviously it doesn't have to be exactly the above syntax, it just has to include a minimum of the real user (eg. root), the sudo user (eg. ksoviero), and the full command that was run (eg. yum install random-pkg).  I've already tried snoopy, but it did not include the SUDO_USER variable.
116240
I just SSH'd into root, and then SSH'd again into root on the same machine. So I have two windows open both SSH'd into root on my remote machine.  From the shell, how can I see a list of these two sessions?
86897
How can I restrict a user on the SSH server to allow them only the privileges for ? i.e. So they cannot run commands even if they log in via SSH.  My Linux servers are Ubuntu 11.04 and OpenWrt.
103929
Hi, I have a single player world which is opened to LAN to let my friends play while I am AFK. I have a lot of command blocks running in that world and those commands are all logged in the log files.  So, my question is, how to only log player commands and chat?  Correct me if I am wrong, thank you.
43042
I accidentally left an open port on my router, leaving access to one of my computers via SSH, using a rather insecure password. I noticed because I checked /var/log/auth.log and there is just one entry from the outside. There's no bash history nor anything easily noticeable. What should I check to know my computer is not compromised?
87944
I am using:  user@unknown:~$ sudo command -option &gt; log   to save the results of "command" to the file "log", but I'd like to also get the result on the terminal, is this possible?  I am using ubuntu 10.04 lts.
79534
I need to run the following command (with real parameters) after login:  ssh -f user@example.com -L 54321:example.com:54321 -N   I need it only for my user, not all users on the machine. Also, I need it to run whether I login via the GUI or via SSH to a plain shell terminal. I would even like to know how to do this on machines without a GUI installed.  Where would I put the above line to be run as explained?
116137
Is there a way to back out of all SSH connections and close  in "one shot"?  I work in Windows 7 and use PuTTY to SSH to various Linux hosts.  An example of the way I find myself working:  SSH to host1 with PuTTY... banjer@host1:~&gt; #...doin some work...ooh! need to go check something on host8... banjer@host1:~&gt; ssh host8 banjer@host8:~&gt; #...doin some work...OK time for lunch. lets close putty... banjer@host8:~&gt; exit banjer@host1:~&gt; exit Putty closes.   Per above, any way to get from host8 to closing PuTTY in one shot?  Sometimes I find myself up to 5 or 10 hosts deep.  I realize I can click the X to close the PuTTY window, but I like to make sure my SSH connections get closed properly by using the exit command.  I also realize I'm asking for tips on how to increase laziness.  I'll just write it off as "how can I be more efficient".
107683
Consider this:  $ ssh localhost bash -c 'export foo=bar' terdon@localhost's password:  declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" declare -x HOME="/home/terdon" declare -x LOGNAME="terdon" declare -x MAIL="/var/spool/mail/terdon" declare -x OLDPWD declare -x PATH="/usr/bin:/bin:/usr/sbin:/sbin" declare -x PWD="/home/terdon" declare -x SHELL="/bin/bash" declare -x SHLVL="2" declare -x SSH_CLIENT="::1 55858 22" declare -x SSH_CONNECTION="::1 55858 ::1 22" declare -x USER="terdon" declare -x XDG_RUNTIME_DIR="/run/user/1000" declare -x XDG_SESSION_ID="c5" declare -x _="/usr/bin/bash"   Why does exporting a variable within a bash -c session run via ssh result in that list of declare -x commands (the list of currently exported variables, as far as I can tell)?    Running the same thing without the bash -c doesn't do that:  $ ssh localhost  'export foo=bar' terdon@localhost's password:  $   Nor does it happen if we don't export:  $ ssh localhost bash -c 'foo=bar' terdon@localhost's password:  $    I tested this by sshing from one Ubuntu machine to another (both running bash 4.3.11) and on an Arch machine, sshing to itself as shown above (bash version 4.4.5).  What's going on here? Why does exporting a variable inside a bash -c call produce this output?
35823
I want to detect from a shell script (more specifically .zshrc) if it is controlled through SSH. I tried the HOST variable but it's always the name of the computer which is running the shell. Can I access the hostname where the SSH session is coming from? Comparing the two would solve my problem.  Every time I log in there is a message stating the last login time and host:  Last login: Fri Mar 18 23:07:28 CET 2011 from max on pts/1 Last login: Fri Mar 18 23:11:56 2011 from max   This means the server has this information.
111445
The server I am using is Ubuntu 10.10. To ensure security I want to edit the banner the server sends to the client.   If I telnet to my host on port 22 it tells me the exact version of SSH I am running (SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu4). The situation is the same with MySQL and Cyrus.  Any suggestions? At least for SSH?  Thanks
29921
Here's my situation: I'm setting up a test harness that will, from a central client, launch a number of virtual machine instances and then execute commands on them via ssh.  The virtual machines will have previously unused hostnames and IP addresses, so they won't be in the ~/.ssh/known_hosts file on the central client.  The problem I'm  having is that the first ssh command run against a new virtual instance always comes up with an interactive prompt:  The authenticity of host '[hostname] ([IP address])' can't be established. RSA key fingerprint is [key fingerprint]. Are you sure you want to continue connecting (yes/no)?   Is there a way that I can bypass this and get the new host to be already known to the client machine, maybe by using a public key that's already baked into the virtual machine image ?  I'd really like to avoid having to use Expect or whatever to answer the interactive prompt if I can.
83186
Often times I will ssh into a new client's box to make changes to their website configuration without knowing much about the server configuration. I have seen a few ways to get information about the system you're using, but are there some standard commands to tell me what version of Unix/Linux I'm on and basic system information (like if it is a 64-bit system or not), and that sort of thing?  Basically, if you just logged into a box and didn't know anything about it, what things would you check out and what commands would you use to do it?
45183
I'm trying to run a program over SSH that keeps running when I disconnect.  gave me the following command:  nohup sleep 30 &gt; foo.out 2&gt; foo.err &lt; /dev/null &amp;   Unfortunately, it doesn't seem to work. I login (ssh -Y) to a remote bash shell and execute it, disconnect, and come back within 30 seconds, but jobs shows nothing and the foo files also show nothing. Is there any other way I can run background jobs over ssh after I logout?
3813
I want to be able to login to a remote via ssh without having to enter the password all the time.   How do I set it up? Is a different command required to execute a password-less session?
83274
I use ssh on a variety of machines, mainly linux. Accounts on these machines vary in naming scheme: if my name is First Last, then I have accounts: first, flast, last_f, lastf, and sometimes I need to log in as root. For each machine I use, I would like the openssh client to know which account to use when I don't specify on the command line.  So the question is: How do I make ssh server Do The Right Thing when a username is not specified?
118186
I have configured syslog server on my linux machine like this  Linux Machine (syslog client)  -- > Linux Machine (syslog server)  I have configured it and its working properly. Now, the problem is I want to look at the logs located on remote server in a particular directory for example /var/log/host-ip/httpd.log.  One way is that I use ssh for that and then see those logs using commands like tail etc.  So is there any Browser based graphical utility which I can use on my machine in which I just give the remote folder location, ip-address etc. and the software shows me the logs present on that remote server.  Thanks.