0
votes
2answers
31 views

Bash script to enable / disable SSH

Im running ubuntu 14.04 LTS (no GUI) and im looking to write a bash script that does the following: Check to see if the ssh service is enabled or disabled If enabled, then disable, if ...
0
votes
4answers
34 views

SSH remote command execute stays without disconnect when finished execute?

I am trying to build a script/command that will restart our Asterisk/Elastix service on our PBX. The script is basically using simple command with auto log-in public key that run from Ubuntu ...
2
votes
1answer
58 views

Permission denied error after SSH login

I am having Permission denied errors after logging with non root user (which has permissions to do "sudo -i" command). I get these errors: -bash: /bin/uname: Permission denied -bash: [: =: unary ...
2
votes
1answer
57 views

Detecting 404 Somehow

I keep my PC running at home. Sometimes, when I'm at work, my PC can't load the pages that I want to load. I have to ssh to it, and reboot/restart browser. It's really annoying and I'm trying to find ...
1
vote
2answers
718 views

no tty present and no askpass program specified with `ssh -A`

I'm trying the following command: ssh -A user@server 'bash -s' < mylocalscript.sh But get the annoying sudo: no tty present and no askpass program specified when the script reaches a sudo. ...
0
votes
1answer
44 views

How to start bash process, disconnect terminal, then be able to reclaim process

Is there a way, in vanilla bash (no additional packages), to start a process, somehow detach it or send it to the background, and then pick it back up later? My specific use case is to ssh to a ...
2
votes
1answer
141 views

How do I pass complicated shell commands over SSH to be executed remotely? Mine throw syntax errors or get interpreted locally!

I have a command like this which tells me if a system has a disk that's getting full (>=70% full): if [[ -n df -PTh|column -t|awk '{print $6 $7}'|awk -F"%" '{printf "%-9s %-5s\n",$1,$2}'|grep -v -e ...
1
vote
2answers
81 views

Attempting to setup Ubuntu 12.04 SSH Server: -bash: /etc/hostname: Permission denied

Attempting to setup an SSH-server running Ubuntu 12.04. Went to "HowToForge" to scout for potentially advanced or knowledgeable advice upon how to accomplish this, then I ended up running into a ...
0
votes
2answers
86 views

Start-up / Reboot scripts for different users

I'm still trying to learn a little more about bash scripting and start-up / reboot, I have read about crontab @reboot and also just looking at other options but I just wondered if someone could maybe ...
1
vote
1answer
309 views

Running a command in a new terminal instance in a bash script

I have a bash script where I configure my proxy settings automatically. I have created some aliases in the .bash_aliases file. Now there is one command where I ssh into my remote server and do some ...
3
votes
2answers
119 views

Determining the name of the host currently connected via SSH

When logging in via SSH, I'd like to know, during the execution of .bashrc, the name of the host that is connecting. Ubuntu Server shows the prompt: Last login: Fri Feb 14 11:34:55 2014 from ...
2
votes
1answer
209 views

How can I open and close an SSH tunnel along with Firefox?

I have a proxy server which I connect to like so ssh -L 2001:localhost:8888 -N myserver.com -p 443 I then open up Firefox firefox -p "SSHProxy" (It starts Firefox configured to use port 2001). ...
0
votes
1answer
67 views

SSH alias results in SSH usage instructions

I have the following alias in my .bash_profile file: alias rlogin="ssh -l elykl33t rlogin.server" Of course this is not the actual username or server address. When I, after relaunching terminal, ...
0
votes
0answers
332 views

Ubuntu 13.10 - how to have a remote desktop initialized via command line?

I have few users remotely who using Ubuntu 13.10 and they have lot of issues cause they are new and learning Ubuntu 60+ age. As a result for free teaching i need to have remote access instantly in ...
2
votes
5answers
423 views

How to run application from terminal forever? [duplicate]

I start jenkins web server using command java -jar jenkins.war. It works great. When I close terminal the application stops. How to make it run even if I close terminal session ?
0
votes
0answers
151 views

unable to root login and may be ~/.bash problem

initially i am trying to connect with github with RSA key and it is giving error permission denied...unknown host. Then change my ~/.ssh directory permission to chmod 700 ~/.ssh chmod 600 ~/.ssh/ ...
0
votes
0answers
242 views

Issue with /bin/false then /bin/bash

I'm having some issues with locking users out of ssh command line. Here is my command sequence which is the full outcome I want: useradd testing passwd testing #set to 1(for example) mkdir ...
3
votes
1answer
238 views

How do I make Home and End work in PuTTY SSH with fish shell?

Years ago, an Ubuntu update broke this and I've never found a solution. I have fish as my default shell. Ubuntu 12.10 Locally (Gnome Terminal), Home and End keys work fine in both fish and bash. ...
0
votes
4answers
1k views

Problem with default shell and home directory

I have recently been granted access to a machine at work. However, I have been having trouble setting up my development environment. Relevant information about the machine: $ uname -a Linux ...
2
votes
1answer
215 views

how to download a link in links using axel/curl?

shortly, how can I make lynx/links use axel/curl for downloading files that i want to store in my hard-disk?? Longley: I'm a server-manager and always used my ubuntu system and putty so i could ...
0
votes
0answers
44 views

ssh login and svn update on startup

How can I write a bash script that will do the ssh login and do an SVN on server ? If I get this, I think I can add with startup applications and do it on every startup ?
0
votes
1answer
238 views

how to use expect with bash

I Have created a shell script as given below.This script will login to a remote server as a normal user then switch to root user for creating a directory.The script is as given below. ssh -t ...
0
votes
0answers
42 views

Can I store a password in a bash script? [duplicate]

Is there some way to store (for example hashed etc.) secured password in a script that will be used during connection to server? Storing password and username as clear text in code for me is quite ...
1
vote
1answer
198 views

Disabling bash history index in terminal

When I SSH into somewhere, I see something line this in the terminal: [504]% Looking it up, looks like its my bash shell history. How can I disable this index display and show the current working ...
4
votes
4answers
3k views

How can I make ssh-copy-id use a port other than 22?

How can I make ssh-copy-id use a port other than 22? I tried it with -p but I get: ssh-copy-id -p XXX XXXX@XX.XX.XX.XX Bad port 'umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ...
2
votes
2answers
4k views

How do I include a password with SSH command? (want to make shell script)

I'm trying to SSH to a server on startup with a .sh script, but that will require me to enter the password for the account on the server that I'm SSHing to. I did some RTFMing, and I see in "-o" that ...
11
votes
4answers
8k views

How do I set up an email alert when a ssh login is successful?

Does anyone have a bash script that will email or notify someone in the case of a successful login to a ssh server? I want to be notified if anyone logs into my personal box. I'm using Ubuntu 12.04 ...
3
votes
1answer
2k views

How would you go about backing up a remote Ubuntu VPS via SSH?

So, as I said I have a VPS, Raspberry Pi and a plan, but I am in need of some advice, so here goes. I have a VPS with prgmr.com which I ahve up and running nice and smoothly without any issues. I ...
1
vote
2answers
240 views

Screen with ssh to overcome disconnection

I have a script name.bash. I want to run it on the server serv@domaine with ssh but I'm afraid to run it directly and close my shell and stop execution. I read that i can run my bash on the server ...
4
votes
1answer
229 views

How to stop SSH filesystem from discarding root permissions after every command?

i have a small bash script that mounts my sshfs... problem is it ask for the server/host password for every mount... i have four mounts and i have to enter it every time for 4 times and its ...
3
votes
2answers
2k views

How to automatically run commands on SSH connection?

I have some Amazon EC2 instances that run Ubuntu 10.04.1 LTS. Every time I connect to those instances I run a couple of simple commands, like a cd <repository>, a git status etc. How can I add ...
1
vote
2answers
546 views

asked for sudo password, post login to bash shell

With 11.10 when any of my users with the bash shell login upon success they are asked to provide their sudo password e.g. Last login: Fri Jan 20 19:13:36 2012 from x.x.x.x [sudo] password for *user*: ...
1
vote
1answer
1k views

Want to write a simple SVN update bash script

I want to write a simple bash script that will update an SVN working copy in a given directory. The repository is accessed with the svn+ssh protocol. The basic process this needs to follow is: ...
1
vote
2answers
3k views

Copy file to same directory with appended filename Via SSH Bash Script

How would I copy a batch of files into the same directory with an appended filename via SSH Bash Script? For example. /path/files/file /path/files/file-20120105 The trick is for it to be a one liner ...
0
votes
3answers
11k views

Paswordless Rsync Over SSH Without Key Authentication [Un-Safe]

I want to set up an RSync job that would connect through SSH. I have my computer ( backup@myhost ) and the remote host ( test@remhost ) and I need to backup the folder ~/something with all it's ...
1
vote
1answer
983 views

How to change putty color scheme on linux user basis?

When I ssh into my server all but one of my users has the color scheme. The one that doesn't, well everything shows up as gray text. Is there a way I can change this color scheme? Also, why would ...
20
votes
7answers
32k views

Can you set passwords in .ssh/config to allow automatic login?

I'm using ubuntu 11.10. I'm using ssh for connecting to many servers daily, so i put their parameters in .ssh/config file; like this : Host Home User netmoon Port 22 HostName test.com Is there a ...
1
vote
3answers
4k views

Can I create an SSH login script?

I have to log in to my school's Linux server for homework. I would like to be able to make a script or something for my desktop to save a bit of time (using Ubuntu desktop). Currently I log in using ...
0
votes
1answer
163 views

What command runs when I SSH into a server?

When I SSH into a server, I see the MOTD then I am in BASH. What command is running that takes care of displaying the MOTD and then starts the shell?
0
votes
1answer
850 views

My SSH tunnels get interrupted because the host machine falls asleep. Bug or Feature?

My gnome-power preference is set to automatically sleep after 30 minutes of inactivity. Apparently it thinks that a ssh connection is not a valid reason to keep it alive. Is this a feature or a bug? I ...