So, I've been writing a system to allow users temporary access onto a system.
Essentially, there's a web server with a PHP script, the PHP script takes a Username & Password from a webform, and passes it to a script, createusr.sh.
The script looks something like this:
Basically it creates a user, using the passed parameters, and force creates their home directory. It then makes that directory only accessible to said user, before sleeping for half an hour.
After that time it deletes the user and their home directory. But I have one problem. If the user is still logged on at that point, then the user deletion has no effect, as the user can still work.
At the moment, I am thinking of using:
and then killing the bash, but I'm not sure how I can get the TTY of a user logged in through SSH?
Maybe somehow "grep" with "w" might do it, but not if the username contains something like "load" which is featured elsewhere in the output from "w".
Besides this, is there any way that I can send a message to a logged in user, saying something like "5 minutes left"?
seems like a possibility, but I'm not sure exactly how this would be implemented.
Hi Everyone,
I started looking at the possibility of making some of our bash scripts available through a web server using CGI and the simple ones works just fine. Now I need to execute remote commands using ssh but can't really get it to work. I got private keys all sorted. Must be ssh... (1 Reply)
HI
I have the following requirement
I have a script a.sh which will deploy files in multiple servers .The argument for the a.sh is abc.gz host1.conf
where abc.gz is a zip file and one.conf will contain all the database connection string .
Now I have to write a b.sh which will... (7 Replies)
Hi @ all
I have the following scenario:
As Admin of a cupple of servers I tried to write the following script to figure out, if the machine is up and available and if some directory´s were available. But my script is having some probs, while running. Maybe some of you have a better way to... (9 Replies)
Hi,
We have a requirement to do passwordless entry from one user to a different user on the same AIX server using ssh keys.
Can some one help me with this?
Thanks in advance,
Panditt (3 Replies)
This is the entry when I tail /var/log/secure when I ssh for user "nightly"...
Aug 4 03:19:48 itanium2 sshd: Illegal user nightly from ::ffff:10.91.220.35
Aug 4 03:20:10 itanium2 sshd: Failed password for illegal user nightly from ::ffff:10.91.220.35 port 32862 ssh2
What could be... (3 Replies)
Hey Guys,
I want to have a bash script on my computer (Mac OS X 10.6.8) that can ssh into my iPod and respring. I know how do this by typing in "ssh root@10.0.1.10" and then typing in the password "alpine". From there i simply type "respring". I want to possibly put this into a shell script so it... (0 Replies)
I've struggled to find a solution to this problem from searching so I thought I'd write a post to see what can be done.
I'm attempting to connect and run commands on 'server2' but because of security limitations I cannot access it directly. I can however ssh into 'server1' and then into... (7 Replies)
Hi, I was wondering how to change the prompt for my ssh login. At the moment it is like
user>
while I'd like it to be as
user@host>
It is in the .bash_profile or .ssh ??? Thanks (2 Replies)
Ok, there's been a good number of posts about this, but here goes. I want a script to log in to a system via ssh without using keys.
This will be used to log in to Cisco IOS devices.
I have tried the following, but could not get it to work:
SSH login expect shell script to supply username and... (1 Reply)
hi.
I need a bash script which can login to an other mashin via SSH and then run some commands and then return the result to my mashine.
I dont know where to begin, I think first I will need a ssh connection, dont know how to make it,
then , do I need a ftp connection between the 2 mashins to... (5 Replies)