0
votes
1answer
27 views

Bash function hangs while command run perfectly without function

Following function hangs : ssh() { local RESULTS; RESULTS=$(ssh $USERNAME@$SERVER $SSH_COMMAND1); echo $RESULTS; } ssh; while if i run following commands they work fine : ...
0
votes
2answers
46 views

Access local console via SSH

I am searching for a way to interact with a local console via SSH - just as you would do with an directly connected keyboard. In my particular case I got a debian server (console only, no X system) ...
2
votes
2answers
49 views

How to keep script from swallowing all of stdin?

I have a script that reads from a pipe in a loop and runs an expect script and a normal shell script in the loop. Both scripts run ssh to another server to grab a piece of data. For example: cat ...
0
votes
0answers
442 views

rsync: getcwd(): No such file or directory (2)

I want to sync Server1 and Server2's logs to LogServer. For Server1: rsync -avz -e 'ssh -p 2188' user@server1:/usr/local/servers/logs/* /usr/local/logs/ This one works, but for Server2: rsync ...
2
votes
2answers
36 views

ssh dissable login, but allow copy-id

I have a user that's only used for a proxy, so no one can login. #passwd file entry proxyuser:x:996:99::/home/proxyuser:/bin/false but, I'd like to enable ssh-copy-id to that user How do I do ...
0
votes
2answers
278 views

How to view and kill PHP processes?

I'm very new to using SSH and am having trouble finding a way to view and kill PHP processes that are running. When I say "PHP processes," I mean PHP files that were started through the browser, but ...
2
votes
2answers
58 views

Will locally mounting root filesystems of all remote servers being managed eliminate need to share dotfiles?

I've got about 10 remote servers being managed, through SSH, and I typically just SSH into each of them for remote management tasks. This requires me to have duplicated many of my dotfiles (like ...
0
votes
1answer
67 views

Close putty connection from CentOS 6 shell script

as title says I have a centOS 6 machine which uses an dracut, initramfs preboot ssh. I want to create a shell script that at the end of it's execution it closes the console and ssh connection. How can ...
3
votes
3answers
620 views

Log commands executed over ssh

I would like to log all commands executed over SSH. Say, ssh something@server.com COMMAND I want to log "COMMAND" on server.com I did search extensively but could not find anything. There is ...
17
votes
3answers
717 views

How do I ssh on slow/flaky connections?

I am dealing with a really slow shell connection. It is in the cloud and I am very far from the server. My connection also breaks sometimes as it is over the internet and I may also be using shared ...
0
votes
2answers
93 views

How to regain an interactive shell that was disconnected via SSH?

Scenario: I am on windows, using putty to login to a root shell. It is currently running an interactive process which prompts for input to continue. Typical interactive process, its probably waiting ...
2
votes
2answers
150 views

executing .bash_profile alias via SSH

I would like to remotely execute a .bash_profile alias, but I cannot find the proper command. I tried: ssh user@host "bash -ic myalias" but it doesn't work I get: bash: cannot set terminal process ...
0
votes
2answers
407 views

Running ssh-agent from a shell script

I'm trying to create a shell script that, among other things, starts up ssh-agent and adds a private key to the agent. Example: #!/bin/bash # ... ssh-agent $SHELL ssh-add /path/to/key # ... The ...
1
vote
2answers
53 views

enabling shell access for cyrus user

My current cyrus user in /etc/passwd looks like this: cyrus:x:76:12:Cyrus IMAP Server:/var/lib/imap:/sbin/nologin I want to be able to give it shell access but restrict it to /var/lib/imap and ...
1
vote
1answer
112 views

Shell script error on filename with spaces

I have a bash script that search for every static file located under my server root and stores a gzipped version next to each file. I got it from ...
3
votes
1answer
59 views

Is it possible to attach a shell to an existing ssh tunnel?

I have a few SSH tunnels setup for auto-connection/re-connection with Shimo. Is there a way of attaching shell access to those existing tunnels and how if so? Or will I have to establish a new ssh ...
2
votes
2answers
359 views

Is there a shell to change password when connecting over SSH?

This is a pretty odd question, but I'd like my users to be able to change their passwords for my FTPS server, which is using local accounts. Currently all these users have /bin/false set as shell, but ...
0
votes
3answers
574 views

How can I suppress the “…this does not map back…” message when using SSH?

I am writing a script that attaches to several of our machines via SSH to check some usage stats. Each time I do: ssh -i ~/.ssh/ourkeyfile.pem user@host I get the typical message: Address ...
0
votes
2answers
290 views

SSH direct stdin and stout to and from postgres client

my local can connect to remote , but it cannot connect to dbserver. remote can connect to dbserver (with psql). I want to run sql scripts from my local against the db. I am looking to a way to open ...
1
vote
1answer
237 views

w command not showing users when not root

I have multiple users logged on my server (ubuntu 12.10), with ssh. None of them has root privileges. If I log in with my admin account and type w the resulting output is: 17:21:05 up 10 days, ...
-3
votes
2answers
224 views

Simplest way to jail users for git [closed]

I'd like to create a couple user accounts on my server such that the users can check out a specific git repository. Ideally, the user would not be able to gain access to a shell or copy any files ...
1
vote
2answers
151 views

Making a user account dedicated to a single script in centos

I am trying to make a SSH login for someone on my box. But when they login I want it to auto load a perl script and for them ONLY to be aloud to see / use that perl script. I only know how to use ...
2
votes
4answers
501 views

SSH connection closes as shell fails to load

I have FreeBSd running with OpenSSH. I set up everything and the connection via SSH worked perfectly. Then I decided to get rid of some not used ports and I obviously uninstalled one that was used by ...
3
votes
2answers
1k views

Script to run chown on all folders and setting the owner as the folder name minus the trailing /

Some numpty ran chown -R username. in the /home folder on our webserver thinking he was in the desired folder. Needless to say the server is throwing a lot of wobbelys. We have over 200 websites and ...
7
votes
3answers
374 views

Custom Openssh Shell

The environment is Ubuntu Server 12.04 I would like to create a user on a server that is only able to ssh into a shell that runs tail -f on a log file and closes the session once the program ends ...
5
votes
2answers
233 views

Confusion over terminology SSH, Shell, Terminal, Command Prompt and Telnet

I don't usually use SSH if I can get away with it, but if I have to I do of course, and I've seemingly done this for years while still managing to remain slightly confused about these different terms ...
3
votes
3answers
3k views

pass a password to sudo su

I wanted to sudo to different user after ssh'ing into remote server, for this i tried the following: cat remote-test.sh ssh -t -t abcuser@test-server.net 'bash -s' << EOF /tmp/test.sh EOF ...
1
vote
1answer
32 views

Mongo is not account specific

I have mongo running on my system however I can access all my databases/collections from other peoples accounts. Can I secure specific collections? How do I block access to my collections but not cut ...
0
votes
3answers
93 views

Backing up server site as an automated process?

I am the web administrator for a small company. We host our website on our own server. The site runs on PHP and MySQL. I access the server via SSH. I am not very familiar with UNIX/LINUX commands, ...
0
votes
1answer
162 views

How can I tell what is causing a delay in ssh connection startup? [duplicate]

Possible Duplicate: ssh delay when connecting This is a toss up between superuser and serverfault but I figure it's more a serverfaulty question. I do development on a solaris box... ...
1
vote
4answers
137 views

Stripping “extra spaces” in du -sk for bash script?

I am trying to use du -sk to get the size of two folders dirsize_temp=`du -sk /folder/path/here` and then an if statement to compare the sizes. The only issue is that when you run the command, it ...
0
votes
1answer
287 views

Home folder only SFTP connection has limited access

I have configured sftp access for user using this guide: Linux shell to restrict sftp users to their home directories? I have problem though. I have taken all steps. I have chown'ed root:user the ...
3
votes
3answers
269 views

Multiple SSH sessions in a single command

I'm trying to copy a database from one server to another. I tried using the following command and it's getting tied up on entering the ssh passwords. If I put in one server's password, it complains ...
2
votes
1answer
334 views

Answering interactive questions in bash script

I've got a device that supports strange "ssh". It doesn't support key auth an my problem is I don't know how to feed it username and password (-l or user@host are not working). It asks for login and ...
0
votes
1answer
381 views

SSH connection gives no prompt, unresponsive

I'm ssh'ing from my OSX laptop to an OSX server. It worked a couple of days ago. Now, when I try and connect, no text is output. My session (with -v option) looks like: ~ $ ssh myserver ... ...
0
votes
2answers
127 views

Creating a backup script involving screens and java?

Hi guys I use centOS 64bit 5.7 and I need to create a backup script What I want it to do: screen -r example command into java pause for x amount of seconds exit screen zip/rar a folder which and ...
0
votes
2answers
747 views

How to secure svn+ssh checkout users?

All our SVN repositories are hosted on a dedicated machine on which all the developers have access. Every now and then we need to checkout a repository on a machine we don't own or operate ourselves. ...
0
votes
1answer
64 views

Limitied Shell for users - Ubuntu

At my old job we had a Ubuntu 8.04 server that we SSH into. The shell was very limited (no bash history, can not tab predict commands, etc). Is there a config file to do things like that?
2
votes
2answers
1k views

ssh initial prompt hangs for 10 minutes but console login and initial prompt is very responsive - why?

I have been running an ESXi 4.0 server for months with a couple of WinServer2003 and several Ubuntu Server 10.4 VMs. The performance has been impressive on 6GB i7 Asus P6T hardware. Suddenly, a week ...
0
votes
1answer
485 views

Run Python program when user logs in using SSH

I want to have a command line program that I made in Python automatically run when a certain user logs in on my server using SSH. But the user must not be able to escape the program or run any other ...
4
votes
4answers
248 views

SSH - Run a command, then give me a shell

This question reminded me of one of my own. I want to create an alias that will ssh to a machine, runs a command (in this case, cd to a provided path) and then gives me a shell. I've run a hundred ...
0
votes
1answer
572 views

How to write a shell script for OS X to log in to a remote server via SSH and execute commands

This seems simple enough... I'm trying to write a script that I can just double click on in OS X. The script is to login via SSH to a remote server, run a git commit and exit. When I copy/paste my ...
0
votes
2answers
584 views

Rsync Push files from linux to windoes. ssh issue - connection refused

For some reason I want to run a script to move files from Linux machine to Windows. I have installed cwRsync on my windows machine and able to connect to linux machine. When i execute following ...
1
vote
3answers
223 views

Is there a way to push shell config information when SSHing to a host?

I've got a bunch of good stuff in my bash config. Normally when I get a new account, I pull this down from my GitHub repo so that I have all the aliases and features I'm used to. There are some ...
5
votes
4answers
815 views

How to check file permissions via SSH

To start out I am very new to this so please forgive me if this is extremely basic or I sound overly uninformed. I would like to check all the files in a specific directory on my VPS to ensure that ...
3
votes
4answers
2k views

Can I disable interactive shell access while tunneling web traffic through SSH?

I am looking into implementing SSH tunneling as a cheap VPN solution for outside users to access Intranet-only facing web applications. I currently am using Ubuntu Server 10.04.1 64 bit with OpenSSH ...
0
votes
2answers
2k views

How to set up a SVN without SSH/Shell access?

I want to be able to set up a private SVN for my small team that we can share code over the SVN, however I need to enable SSH/Shell access. Is there a way without using SSH/Shell access. If this is ...
2
votes
2answers
177 views

Dealing with shell commands that throw away old output

There are a bunch of shell commands that throw away old output. A couple that I have seen are Nose and Hudson. What I mean is that when the program is run, it produces a lot of textual output in the ...
2
votes
5answers
443 views

One shell question with ssh

I find one shell command can send large data to target host: dd if=/dev/zero bs=4096 count=1048576 | ssh user@ip 'cat > /dev/null' I think i can use this to test network bandwidth, but it can ...
2
votes
2answers
458 views

What is the best Android phone for remote ssh administration/scripting? [closed]

I've got a Moto Droid that I use with connectbot for remote admin on Linux webservers. However, I'm wondering if there are any Android phones out there with better hard keyboards for use with ...