0
votes
1answer
19 views

How do I make sure that bash (not tcsh) is used in Linux?

I have a bash script where I use ssh to connect to another server and run some commands there. I found some sites that the error (Warning: no access to tty (Bad file descriptor). Thus no job control ...
2
votes
3answers
51 views

Why is this sudo command try to run in /root?

I try to run a sudo command via SSH like this: ssh domain.com sudo -u user bash -c "cd /home/user/ && ls" (which is obiously just an example). I get back: /home/user/: line 0: cd: /root: ...
0
votes
5answers
30 views

History in bashrc on login vs manual sourcing - clearing and loading

I use a bunch of different aix machines at work and need to share users with co-workers. To make my life easier but not bother others with my customizations, I have created a .bashrc file that I copy ...
0
votes
1answer
27 views

shellinabox - How can I restrict access to certain users only?

I've got a Ubuntu 14.04 machine which I've set up with shellinabox. Now I would like to restrict access to shellinabox to only a certain user account. Nobody else should be able to log in with it. ...
0
votes
1answer
28 views

Small bootable package to enable ssh client?

I've been trying to find the smallest possible package to put on a cd/thumbdrive that will allow me to use an ssh client on a wired networked computer. I'm talking about really barebones stuff, no ...
1
vote
1answer
91 views

Why I can't use wget command in SSH shell?

I have the following problem. I am using my RaspBerry (with RaspBian installed) by SSH. My problem is that I can't use wget command because it fails. For example if I try to execute the following ...
3
votes
1answer
99 views

Why does my .bashrc get read when I run noninteractive commands over ssh

I've prepended each of my bash config files (~/.bashrc,~/.bash_profile,~/.profile) with echo NAME_OF_FILE, i.e. I get '.bashrc' when I source in ~/.bashrc. What baffles me is why I get and ...
1
vote
1answer
25 views

Background chained ssh tunnel dropped instantly

I'm trying to establish the following chained ssh tunnel: ssh -A -t gatewayuser@gatewayserver 'ssh -N -A -t -R 55520:127.0.0.1:55520 user@dbserver' & This is part of a shell script, I want the ...
0
votes
1answer
96 views

How do you run a command as another user on Linux?

I have access to a linux server where I can sudo to 'foo' like this without a password: sudo su - foo Once I am the 'foo' user I am able to run a script like this: /dir/foo_user_script.sh The ...
1
vote
0answers
52 views

Cron deamon written in shell

I'm looking for a script in bash or ksh, that would do ... more or less ... the same as crond. The situation is, that our system administrator suddenly denied the use of crontab to all regular users ...
0
votes
1answer
64 views

Log in using SSH without password

On my server, I've got openssh-server and a special account without password. I'm creating a shell script, that must be used without user input. For example $(ssh dummyUser@dummy.com) I need script ...
0
votes
1answer
128 views

SSH shell on a multicore supercomputer [closed]

I created a program on my 2 core laptop and I want to verify how my program performs when more than 2 cores are available for processing. Do anybody knows any free (or cheap) service where I can ...
1
vote
2answers
172 views

Shell script to show online users

I know it's an amateur question. I need to write a Bash shell script which count how many users are online at the moment on the SSH server. I need to ignore multiple logins and show the username and ...
9
votes
2answers
2k views

scp between two remote hosts from my local

I have two remote hostes. host1-> 10.3.0.1 host2-> 10.3.0.2 Both are installed with ssh and scp. In my scanario, ssh and scp listen to port 22 in host1 and in host2 it is port 6969. Now, using my ...
2
votes
1answer
1k views

SSH Tunnel for restricted user w/ PuTTY and no shell

so I have been using SSH tunnels to restrict access to internal sites or portions of public sites for a while now, and since only admins had SSH access at all I've been using standard non-root/sudo ...
0
votes
1answer
492 views

Specifying an alternate shell with rsync

I'm using rsync to sync up files between two computers. On one machine, my default shell is set to fish, which breaks rsync ("protocol version mismatch -- is your shell clean?"). Is there a way to ...
0
votes
2answers
180 views

Multiple SSH failing to run more than one command

When a use multiple SSH like below i am only able to run one command, if try to run more than one command its fails. This thing is failing: ssh -o UserKnownHostsFile=/dev/null -o ...
1
vote
2answers
951 views

SSH session hangs when trying to open a shell

Since this morning I cannot login normally on my server using SSH anymore. Typically, when typing this: ssh foo@bar.org The shell hangs and does not acquire shell. The last line of verbose with ...
1
vote
1answer
41 views

How to fix.. my watch --interval=60 isn't working properly

Here is the code I use in my CentOS 5 32bit. But after this I see only some of files are zipped and a lot of them isn't included in produced gzip file. nohup watch --interval=60 tar -zcvf ...
3
votes
2answers
262 views

Is setting a mail user's shell to /usr/bin/passwd in the /etc/passwd file a safe way to allow them to change their own password by simply ssh'ing?

I have a machine which is used mostly as a mail server: $ uname -a Linux myhost.com 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux and I would ...
2
votes
1answer
148 views

How to get a bash prompt in a ssh tunnel with rsa keys?

After setting client and server with the public keys and allowing PubKeyAuthentication yes, I issue the following command and get a shell that waits indefinitely. mad@amd:~> ssh -T ...
0
votes
0answers
207 views

sshd : locale not set with `UsePam no`

I even did reinstallation for this thinking something was wrong, and here's what I've found. #usepam=no Using username "sysadmin". Authenticating with public key "rsa-key-20130918" sysadmin@ubuntu:~$ ...
1
vote
1answer
48 views

Select set variable value in SSH session

I'm writing a shell script. It will run from machine A, which will SSH into machine B and prompt the user to select a build folder. It'll then copy it to machine A, but I don't know how I can have the ...
0
votes
0answers
313 views

Enable FTP disable SSH

I would like to know how enabling FTP access while disabling SSH access for all users except root and admin. I tried to change the shell : /usr/sbin/nologin is no good because disable both and ...
0
votes
1answer
108 views

Environmental variables in login shells and interactive shells

I'm sort of confused of login shells and interactive shells. If I run ssh my_remote_server 'echo $HOME' I can get /home/shawk But when I run ssh my_remote_server 'echo $ANOTHER_VAR' I got a ...
0
votes
3answers
79 views

Temporarily transferring shell settings to remote ssh session?

I am curious, frequently I would like to transfer all of my shell settings (dotfiles) over to a remote session just during my session and then have them reversed when I logout. Even better would be ...
1
vote
2answers
51 views

Remote shell account security

With a shell account like one of these http://shells.red-pill.eu, I would like to schedule chron jobs to backup from Google Drive to SugarSync. How secure are those servers? Can some obscure admin ...
3
votes
1answer
98 views

Is there any benefit to exiting nested SSH sessions, as opposed to closing the entire terminal application?

The question should hopefully sum things up, but essentially, I'm in a bunch of SSH sessions, some of which have additional SSH sessions to other hosts. Are there any negative impacts to simply ...
0
votes
0answers
55 views

libssh vs alternative root users

Here is an excerpt of the /etc/passwd file on a remote machine. root:x:0:0:root:/root:/bin/bash valid:x:0:0::/home/valid:/bin/rbash As you can see, valid is an alternative name for root. I can ...
2
votes
3answers
452 views

How to paste multiple Bash commands into a shell without losing some?

It's nice to copy-paste a series of Bash commands that you find on a website. But depending on the commands, sometimes you lose a few. Maybe they get swallowed up by programs that read from standard ...
4
votes
2answers
200 views

Wait until SSH succeeds creating a port forwarding

I am calling ssh (OpenSSH) from a OSX/Linux-C++-Application via fork/exec to create a dynamic port forwarding. This is done using batch mode (-o BatchMode=yes) and a private key which is supplied to ...
2
votes
2answers
753 views

Log in with different shell when original shell is “broken”

I managed to do something catastrophically stupid and below rookie level. Clean install on my FreeBSD VPS, then upgraded to version 9.1 (from 9). For some unusual reason, rather than installing ...
4
votes
4answers
551 views

A decent remote shell from UNIX to Windows?

Scenario I'm on Linux and develop on a Windows 7 box virtualized via VirtualBox. My usual way of developing consists in editing source files from Linux via nautilus/SMB (smb://192.168.1.4/...) then ...
0
votes
2answers
33 views

How to automatically remember the last path where I was? [*nix]

Is there any scripts or tools that can automatically remember and write down the path I am? I asked because, when I was remote accessing my campus cluster via ssh last night, they will log me out ...
6
votes
2answers
325 views

How to connect to a SSH session that was backgrounded with -f -N?

I'm doing some work where I need to pivot off a machine using proxychains so I'm connecting to a system and binding a local port like so... ssh -f -N -D 9000 user@host.com … which returns me back ...
0
votes
1answer
117 views

ssh sudo command to local machine

I have two machines master, slave. They have passwordless ssh setup between them. i.e master -> master and master -> slave I noticed the following problem user@master$ ssh master sudo whoami sudo: ...
0
votes
0answers
76 views

script on a remote machine that archive files fails

I have a simple script (Given below) on a machine that collect files from several folders into a single one and then archive it. The script works as expected on the remote machine. When I run it via ...
1
vote
0answers
83 views

Why is there a long delay when using `nohup` on Linode

I have a shell script like: for((i=1;i<500;i++)) do python get_sequence.py done I want to run it on a Linode VPS. It would take a few days to run, so I'm going to use nohup ./run.sh &, so ...
2
votes
1answer
474 views

SSH Session Started from Here Doc Does Not Exit Properly

SSH session doesn't terminate and give the tty back when executed inside a here document. Below is the code snippet that's inside my shell script: ssh -t -t root@$HOST_ADDRESS <<TERM_STRING cd ...
1
vote
3answers
3k views

How to grep logfile via SSH on multiple servers?

Sometime, I need to find out specific log content(such as api call) from log files, those log files exists in several Linux servers. I have to use SSH to login every server and use grep searching the ...
0
votes
3answers
53 views

Perform shell operation through secure shell

Is it possible to perform a shell operation from a bash script through a secure shell. Here is an example of why you may want to do this. Lets say you have a simple unix operating system that you ...
1
vote
2answers
396 views

Difference between running commands locally vs using SSH to make remote commands

I am trying to SSH into a remote machine, and run a .ksh file on a that machine to run a Java program. If SSH into the machine with a tool like Putty, and run this command: cd ...
0
votes
0answers
93 views

Running different programs via ssh

I got some problem when I tried to run different programs via SSH. The problem is, let's say I have 2 different java programs, then I would like to run them simultaneously on different JVM, in order ...
1
vote
1answer
91 views

disowning a process before it starts

Is it possible to disown a job at startup w/ out manually pausing the process? Basically the issue is, is that I'm iterating through a number of processes using a python script. I can manually disown ...
2
votes
3answers
1k views

loading local shell aliases to ssh session dynamicaly

When I log in to some machine using ssh I wish my aliases and functions are there. In other words, log in to some machine I wish I can use my command shortcuts. I need it be dynamic, every time I'm ...
1
vote
1answer
68 views

ssh starting with commands

I want to add alias that ssh to remote machine, run few commands on it and then give me back the control to continue using this machine. when I'm trying to run: ssh machine_ip 'command' the SSH ...
0
votes
1answer
243 views

Reverse SSH Tunnel Connection

If I issue a command to set up a reverse shell: grebwerd@bt:~$ ssh goldberd@whatever -R 10000:localhost:22. I was wondering, when I issue this command, it connects me to grebwerd@whatever, what ...
0
votes
2answers
146 views

ssh warning message

Is there a way to avoid ssh login warning messages while login to remote server through scripts? But I do not want to change any configurations in remote server, but in scripts or any options.
4
votes
1answer
93 views

Launch only the command if the previous one worked inside SSH, shell

I've got a SHELL script which is using a pipe to separate my two commands: ssh -oBatchMode=yes user@hostname "mysql -u yop -pyop -c yop | echo test" The problem is even if my connection to MySQL ...
1
vote
3answers
607 views

Running script on multiple ubuntu computers automatically

I have many ubuntu 10.04 computers. Is there any program that can allow me to select a shell file, and have it automatically log in to each computer of a list of computers (through say ssh), and ...