General :: Detect Remote Logins Within Shell Script?

Apr 19, 2011

I've written a shell script that among other things, restarts network services. As such, I'd like to keep those who are remoting in via putty, etc. from executing the script. Is there a way to detect this and restrict running the script (by adding additional coding in the script) that disallows running it from unless you are logged in directly to the machine? It's written in bash.

View 1 Replies


ADVERTISEMENT

Security :: Detect All User Logins?

May 25, 2011

I would like to detect every login on my server. Not only ssh logins (virtual terminals) but also physical logins.There is a way to use nagios or a script to watch log files.But I would like to know is there a way to catch that information one step before.I thought about watching /dev/pts for changes but that is not different than log watching and everything does not appear in /dev/pts like a ssh tunnel (ssh -N user@server). These are only visible in logs because ssh tunnels do not open terminals.But I would like to be able to catch these on login.

View 8 Replies View Related

Ubuntu :: Not Allow Multiple Logins To The Shell?

May 20, 2010

Is there a way to prevent a user from being able to login more than once. Not a one-time login, but a single login. What I'm trying to do here is in moving our email system, an email user would login to this account, enter some password information, sync up their email, and have the passwords files removed, then log off. Next user can log in to the same account.

The reason for the single login is to protect the user's passwords.

View 1 Replies View Related

Security :: Setting Up Secure Remote Logins

Jun 17, 2010

I'm trying to secure the CentOS servers on our company network as the current situation is, shall we say, less-than-ideal: remote root logins with the same password across several servers (behind a firewall, on non-standard ports, but still) and several key processes running as root. My proposal to amend this consists of the following:

- setup a bare as possible SSH-gateway with only the normal user accounts to handle remote access
- disable the root login from anywhere else but LOCAL and create special accounts with root permissions for our ~4 system administrators, like admin.foo admin.bar that can only login from inside the company network, using SSH-keys.

So far my biggest obstacle seems to be creating the administrative users, how do I go about and do that? When I simply create a user adminfoo with uid=0 it will show on my shell as root, which makes it useless as a way to make our admins accountable for their actions. BTW, my initial proposal to use sudo unfortunately met with strong resistance, because it compromises usability.

View 7 Replies View Related

General :: A Shall Script For Remote Shell Execution?

Mar 26, 2011

i need to take the backup some folders encryption formate with password i used gpg encription in the script but it is not taking the password it throos errorthe syntax is#!/bin/bashtar -cvzf test.tar.gz target ; echo "test" | gpg -c test.tar.gz --stdin

View 3 Replies View Related

General :: Check If Remote Server Is Up - Shell Script?

Sep 10, 2010

I need to add something to an existing shell script that will check whether a remote server is up or not.basically (but I can't figure it out) :-

if [ -the server to check- ] ; then
echo "Server is Up"
else

[code]....

View 12 Replies View Related

General :: Use Ssh And Run Command In The Remote Machine Using Shell Script?

Apr 27, 2011

How can i do that.. Today is my first day writing a script.. and correct me if this Thread should be somewhere else..

Code:

if [ $1=$anyvariable ]; then
ssh www.a.com <Have to set few variables and give commands >

View 8 Replies View Related

General :: Move A Process From One Shell To Another (local To Remote)?

Jan 28, 2010

Is is possible to move a process from one shell to another (local to remote)

e.g.

if
my_code.sh &
#jobs
[1]- Running my_code.sh &

was started on one remote shell is it possible to move it to the foreground on another shell as root or another user?

View 5 Replies View Related

General :: Delete A File On A Remote Server Using Shell Scripting?

Jul 18, 2010

delete a file on a remote server using shell scripting.

View 14 Replies View Related

Server :: Secure Remote Server From Unwanted Ssh Logins?

Jul 2, 2010

we have a remote linux server and its /var/log/secureile is fully filled with unauthorized ssh users,of course they cannot able to log in successfully but they were making continuous ssh requests to log in, it some times results in server down problem. so how to secure our server from their ssh attempts.i know blocking unauthorized ip addresses can solve this problem and we can also change the ssh port numbers but what are the other possible ways of solving this.

View 4 Replies View Related

General :: Write A Shell Script Which Can Ready Content Of The Folder And Place Files On Remote FTP Server?

May 9, 2011

I need to write a shell script which can ready content of the folder and place files on remote FTP server. I need to make sure that a file that is already placed on remote FTP server is not attempted second time. The file names will be something like Records-2011-05-09. The files will be generated by MySQL every hour.

View 7 Replies View Related

General :: Top Causes Of Slow Ssh Logins

Jul 22, 2010

there are 2 spots where I see a range from instantaneous to multi-second delays.Between issuing the ssh command and getting a login prompt and between entering the passphrase and having the shell load.Now, specifically I'm looking at ssh details only here. Obviously network latency, speed of the hardware and OSes involved, complex login scripts, etc can cause delays. For context I ssh to a vast multitude of linux distributions and some Solaris hosts using mostly Ubuntu, CentOS, and MacOS X as my client systems. Almost all of the time, the ssh server configuration is unchanged from the OS's default settings.

What ssh server configurations should I be interested in? Are there OS/kernel parameters that can be tuned? Login shell tricks? Etc?

View 6 Replies View Related

General :: Find The Ftp Logins In System?

Aug 26, 2010

we are using "last" command to find the last logins in our system.. how to find the ftp logins in our system?

View 1 Replies View Related

Fedora Installation :: Run A Shell Script From A Remote File?

Oct 4, 2009

if I wanted to run a shell script from a remote file (say on my desktop) in which when clicked the file the shell script would run how would I do so?In other terms, the file would contain the command: sh /home/Phobos/Documents/jes-4-2-2-nojava/JES.sh

However what extension should the file have in order to run on click?

View 5 Replies View Related

Programming :: Write Shell Script To Ssh Into A Remote Computer And Run That?

Jun 26, 2010

How do i write a shell script to ssh into a remote server with password and run a script in it?

View 2 Replies View Related

Software :: Running X-Server From Remote Shell Session?

Apr 7, 2010

How do I obtain information about the running x-server from a remote shell session? I want to know things like resolution, color depth, etc. My xorg.conf is basically empty. The only thing I can think of doing is to read the Xorg.0.log file which seems inefficient.

I thought that 'xrandr' displayed some text output but that behavior has changed (?). It seems to require an X display. Is there another way? Something I could incorporate into a shell script? (This is Fedora but that shouldn't really matter)

View 1 Replies View Related

General :: Authenticate Users Logins By A Database?

Apr 8, 2010

is it possible to authenticate users logins by a database (postgres, mysql)?for instance: -user types username, pasword, at login screen -OS then connects to server with database and checks if the user is valid. if so, is it feasible to add a time lock function for each user? in the sql, postgres table ? for instance user sandra can only log onto the computer for 1hr at 5pm

View 7 Replies View Related

General :: After Some Logins 11.04 Started Disconnect From Internet

Apr 30, 2011

i have installed ubuntu 11.04 linux by wubi (windows 7 ultimate is the other operating system). after some logins it started disconnect from internet.

View 11 Replies View Related

General :: Authentication Failure For Root Logins (Fedora 12)?

Jan 20, 2010

I just got Fedora 12, and I used su root to change the bin ownership to my primary developer account. For some reason, though, all subsequent attempts to log in as root have had authentication failure, be it through su or through the startup login screen. This does NOT occur for adminstrator tools such as Groups and Users.

View 8 Replies View Related

Programming :: Shell Script To Check Whether Directory Exists On Remote Server

Jan 17, 2011

I am new to scripting, would like to have a script that tests whether a directory exists on remote host & display the message accordingly. The remote hostname can be provided by means of file containing list of hostnames. Can use rsh for connecting to remote host.I tried with couple of scripts by searching google but didn't get desired result. Please help me, below is my efforts, $file contains list of hostnames.

View 10 Replies View Related

General :: Mapping Sftp/scp As A Drive Letter Without User Logins?

Aug 24, 2011

I'm trying to find a software which could map sftp/scp services to a windows drive letter. I know there are quite a bunch of those available, but i haven't found a single one which could run with SYSTEM or Netservice privileges or have decent command line options so i could elevate the program myself. The mapped drive should be available for other services running on the same server.

Most of the programs (sftp netdrive, expandrive, etc) have only option to startautomatically only when someone logs in. Because of that they are useless to me.Their inability to handle non-interactive starts is a bummer too. FTP->SFTP wrappers don't count as solution despite of integrated windows support for ftp drives. The way they are handled in windows makes ftp mapping unusable without some external ftp drive mapper software.

View 2 Replies View Related

General :: $HOME/.bashrc Disabled When User Shell Is 'rbash' (restricted Shell)?

Jun 15, 2011

MACHINE: HP Proliant DL260G5OS: SLES 11 SP1kernel: Linux xserver 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/LinuxIt is used as remote xserver in a LAN.I have configured /usr/lib/restricted/bin/.rbashrc with some environment variables but when the users logon in the system finally is executed $HOME/.bashrc and some environment vars are overwritten.

View 2 Replies View Related

General :: Write A Shell Script Instead Of Shell Function?

Apr 27, 2011

I would like know when it is necessary or advisable to write a shell script instead of shell function ?

View 3 Replies View Related

General :: Open A New Shell From A Shell And Switch Between Them?

Jan 18, 2011

I am wondering if I can open a shell or new terminal thing from within the terminal in a unix/linux enviroment. Particularly a commandline only one where there is no GUI. Is this doable? how do I do it?

View 3 Replies View Related

General :: The KDE Login Screen Now Says "root Logins Are Not Allowed."?

Feb 20, 2010

Something has caused me to be locked out of root; the KDE login screen now says "root logins are not allowed." It's not as though I don't know the password--I set it up. I might have deleted something I'm not supposed to, because before this, root had also become invisible at the KDE login screen.

View 14 Replies View Related

General :: Root Logins Are Not Allowed \ When Try To Login As Root, After Logging Out As User, It Does Not Allow?

Dec 2, 2010

i just installed linux mandriva 2009. i set password for root and created a user account. when i try to login as root, after logging out as user, it does not allow me and gives the error "root logins are not allowed". even it does not show the root account. if i try to go to root from konsole terminal using su root, it allows to enter as a root but when i try to start the GUI with startx it gives error.not sure what to do and why i can't see my account in GUI mode

View 5 Replies View Related

Debian Multimedia :: XOrg Auto-detect Failing To Detect Max Screen Resolution

May 29, 2011

I've installed Squeeze 2.6.32-5-amd64 on my laptop (Alienware M17X R3, Intel i7 Sandybridge, ATI Technologies Inc Broadway [ATI Mobility Radeon HD 6800 Series])The screen is 17", with maximum resolution of 1920 x 1080. After a default install of the operating system, the maximum resolution I can select is 1280 x 1024.My research so far has suggested that I need to edit the /etc/X11/xorg.conf file and provide xorg with the necessary resolution.

Again, by default, the xorg.conf file is not created. This leads me to believe that xorg is scanning my hardware at startup and providing me with whatever it thinks is appropriate. I tried following these instructions to generate an xorg.conf file. This process created an xorg.conf file under /root/.

When I copy this xorg.conf file to /etc/X11, I get a blank (i.e. black) screen. Deleting this file restores the default resolution 1280 x 1024.This system is dual booting with Windows 7. Under windows I am able to get a 1920 x 1080 resolution, so I know my hardware is up to it.At this stage I have yet to install the drivers for the Radeon graphics card.What are my options regarding configuring xorg to give me a higher screen resolution?

View 6 Replies View Related

Fedora Hardware :: Endless USB Loop - Detect - Disable - Detect

May 2, 2010

I have a new F12 install, and my syslog is filling up with messages about USB. I have 2 USB devices plugged in directly to the mobo (bluetooth keyboard receiver, touchscreen), and it keeps redetecting them and then disabling the port for some reason.

A small sample of what keeps on repeating:

Quote:

View 1 Replies View Related

Debian :: Where To Find The Fw-detect Command ? (for Firmware / Wireless Detect)

Jan 12, 2010

Code...
To find the appropriate firmware without knowing the make or brand of your wireless chip, you can use the command:

#fw-detect

But apparently debian package do not offer this useful tool, well, certainly for sidux exclusively.

Is there a package of fw-detect eventually?

View 5 Replies View Related

Server :: Securing Ssh Logins ?

Sep 15, 2010

We have a public server and it can be accessed from any where through ssh.

My question is my server should not allow anyone directly to login as root user. First he should login as normal user then he should switch to root user.

I also have another questions is there any specific linux command is there to end other users ssh session without rebooting the server.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved