Tag Info

New answers tagged

1

Add -q to the command you use to run ssh, from the man page: -q Quiet mode. Causes most warning and diagnostic messages to be suppressed. SSH man page


0

I would identify which ssh process was yours, assuming you are doing this remotely that is, then kill all the other sessions. Perhaps you could send a broadcast to allow other users to gracefully log out: shutdown -k 5 & Then kill any other ssh sessions that you need to kill, and make your firewall changes.


2

Yes, you have to specify a destination IP and port when using local forwarding. From man ssh: -L [bind_address:]port:host:hostport Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. Clearly, only the bind address is optional. No, you can't specify a destination ...


0

You were correct, exp_internal -f passcheck-debug.log 1 pointed me to the problem of not having enough ptys. I added: close -i $spawn_id wait -nowait and it continued beyond that point. I had to add -nowait because if it doesn't have a spawn_id it will wait forever.


7

You mention that the second server is using the Andrew File System (AFS). I haven't worked with that, but from what I understand it, AFS is a Kerberos-secured filesystem which requires a kerberos ticket in order to work. That means you need to be logged to your site's Kerberos realm in order to be able to access your home directory. If you log on with ...


4

You should try to connect to server2 with: ssh -v tim@server2 and compare that with the same, connecting to server1 this will tell you exactly where the two servers differ. Most likely there is a difference in /etc/ssh/sshd_config on both machines. where server2 or your ~/.ssh has accessibility problems (not restricted enough). From the -v output you ...


1

I just ran into this problem connecting to a headless RHEL7 server. You need the xorg-x11-xauth package installed on your host in order for the DISPLAY variable to get set, and to be properly authorized. Hope I saved somebody some time.


1

This is one possible way to do what you are looking for: tmux sets environment variables in the shells it creates (example $TMUX, $TMUX_PANE), its possible to detect these and run your ssh command to inform your remote session how client has started, we are looking at two steps. First, detecting where ssh is being started, this can be done in a function, ...


0

As it seems that the limitation is more on the user experience side (don't have to enter password again and again), the best choice here would be to enter your public key (the .pub file in your ~/.ssh folder) in the destinations ~/.ssh/authorized_keys file. Here the ~ folder stands for the home of the users that are involved on the source and destination ...


1

Shared memory is a mechanism to exchange rendered image without having to use sockets, the protocol works something like this: X client create the shared buffer, X client tell the server that's where you will find the images i create, the server "attach" itself to the shared memory and refresh whenever there is an update, this mechanism is 10x of socket ...


4

You can do it directly from the command line like this: ssh -A -t ubuntu@hostB ssh -A hostC Or by adding these lines to your "$HOME"/.ssh/config file and invoking ssh hostC in the normal manner: Host hostB User ubuntu Host hostC User ubuntu ProxyCommand ssh -q hostB nc -q0 %h %p In your scenario where hostB and hostC are ...


2

At least OpenSSH sets different TOS bits (0x16 for interactive sessions, 0x08 for bulk transfers), as discussed on quora. This can be easily exploited using rules that match those bits. It seems the highest matching QoS takes effect, make sure not to have a general rule for port 22/SSH around: OpenWRT by default ships a rule matching SSH and DNS together. ...


0

I think the problem is related to a not-found matching private key. The ssh client sequentially tries several keys (from .ssh/) which are denied by the server, until a limit is reached. Try to specify a specific identity with ssh -i .ssh/<correct key> ....


1

SSH executes the remote command in a shell. It passes a string to the remote shell, not a list of arguments. The arguments that you pass to the ssh commands are concatenated with spaces in between. The arguments to ssh are sudo, usermod, -c, New Comment and user, so the remote shell sees the command sudo usermod -c New Comment user usermod parses Comment ...


1

Personally, if the goal is to just allow the copying of files to the server, I would go the route of sftp instead of scp. scp presumes ssh access and if there is no need to provide shell access, better not to try and lock it down for just file transfers. So, sftp. Some recommendations. Disable normal FTP and instead run something that allows you to easily ...


2

If you want all setup all the limiting stuff you mention I would suggest to use ProFTPd. Using the sftp_module you are able to only allow a secure session. See http://www.proftpd.org/docs/contrib/mod_sftp.html for details about the sftp functionality. Near the bottom of the page an example configuration is listed. Using the DefaultRoot directive you can ...


1

If you change an account's UID, any existing shell will have this sort of identity crisis. Check by comparing UID from output of "id" and do a "grep whoami /etc/passwd". if changing UID, be sure to check for any crontab entries for the user!


3

for i in `cat servlist`;do echo $i;ssh $i 'sudo usermod -c "New Comment" user';done or for i in `cat servlist`;do echo $i;ssh $i "sudo usermod -c \"New Comment\" user";done


1

I didn't realise ssh-copy-id is a script and I took a look at it. I was using Ubuntu as root (via sudo -s) after logging in as a non root user, so, home was still set as /home/user So, mktemp doesn't create subfolders, and is hard coded to create a temp file as ~/.ssh/tempfile- I just created .ssh in /home/user and it worked fine. I had previously used ...


0

I'm guessing here a bit because I don't have enough info to know what's going on. But I would try something like this: fail2ban-regex --print-all-missed /var/log/secure /etc/fail2ban/filter.d/sshd.conf to see if it finds something or what lines it might be missing. I'm assuming /var/log/secure is where sshd is printing out it's login failures. It's ...


-1

you should use the command mdiag -n to check whether the nodes are idle or busy.


0

Adding this line to /etc/ssh/sshd_config fixed it for me: X11UseLocalhost yes


3

That is because the process does not exist. The $$ is being evaluated locally, and all servers are being passed the same number. A number that is not a currently used PID on the servers. All the $ stuff is done by the shell, not the commands. You need to escape it, so that it is evaluated by the shell on the server. Try \$\$ e.g. for i in $(cat ...


0

As well as the answer you got in the question comments, when things get too complex you can simply run bash and get it to execute the commands you provide on standard input: ssh user@B ssh user@C bash <<\! echo "line of text" >> ~/.profile !


0

I have the same problem on a raspberry, my quick and dirty solution was update-rc.d disable abd I put service ssh start in my rc.local. maybe in your case a service ssh enable will help,...


0

I figured it out. As I posted in my other post: Is there a specific SSH boot log? In my auth.log file, it wasn't binding to the IP address I put in for the ListenAddress parameter in /etc/ssh/sshd_config. After I changed it back to 0.0.0.0, it starts up now. Don't quite understand, I thought I could put the IP address of my computer? And I don't understand ...


0

This sounds like ssh isn't listening on all interfaces or is administratively blocked (iptables rule for example). Start by making sure that sshd is listening on all interfaces. Go to the server you are trying to connect to and run: sudo lsof -n -i -P | grep sshd This is ls for open files. The flags are -n => don't bother looking up ip names (this makes ...


0

I figured it out. In my auth.log file, it wasn't binding to the IP address I put in for the ListenAddress parameter in /etc/ssh/sshd_config. After I changed it back to 0.0.0.0, it starts up now. Don't quite understand, I thought I could put the IP address of my computer? And I don't understand why it doesn't start at boot, yet, manually, it can start.


1

First, as mentioned in the comment by Robert, your snippet isn't valid. At a minimum you need either a semicolon or new line before }. The print statements are probably not correct either. However there's enough here to guess what is going on, so I'll explain that. When you run ansi-term, it invokes a shell with the environment variable $INSIDE_EMACS ...


2

To prevent them from breaking out of the menu, set it as their shell with chsh.


1

I am reading this tutorial, and trying to create a new user with root privileges and then block root access via ssh in a CentOS 7 server. The problem is that the new user is blocked from doing root actions like nano /etc/sudoers. Also, I seem unable to remove the block of root login. So my pre-existing open root session is the only access I have to root ...


0

Assuming you have installed openssh-server , check for sshd startup symbolic links at /etc/rc{2,3,4,5} directories , run ls -l /etc/rc?.d/*ssh if no startup links there , create them by running sudo update-rc.d ssh defaults and reboot. If problem not solved yet, you may try it by placing service ssh start (before the "exit 0" line) at /etc/rc.local file ...


2

use Net::OpenSSH and let it do the quoting for you: use Net::OpenSSH; my $ssh = Net::OpenSSH->new('id@host'); my $output = $ssh->capture("/usr/message/send", -pin => $pager_num, -message => $message); $ssh->error and die "ssh failed: " . $ssh->error;


4

Of course you have to read the file, but you could ssh USER@REMOTE "cat file" | xclip -i of that still means to open a ssh connection and copy the contents of the file. But finally you don't see anything of it anymore ;) And if you are connecting from an OS X computer you use pbcopy instead: ssh USER@REMOTE "cat file" | pbcopy


0

Can I assume you are running the X Window System and some window manager (KDE/gnome/etc.)? There are a number of terminal applications (Konsole for example) that have a built in menu that allows copy/paste functions. So you could: user@machine:~$ ssh root@172.x.x.x open the file on the remote machine highlight the contents of the file with mouse and ...


0

Inspired by another answer to another question, I suggest using proxychains-ng (which is the newer version of proxychains). Download, compile, and optionally install proxychains-ng. Create a proxychains.conf file in the current directory, or at ~/.proxychains/proxychains.conf, or at /etc/proxychains.conf. Alternatively, create one file anywhere else, or ...


-1

Try this: rm $HOME/.dbus/session-bus/*


0

The following works for me (probably only on gnome-terminal): comp@home$ cat /usr/bin/ssh #!/bin/bash echo -ne "\033]0;${1}\007" ssh_bkup "$@" Where ssh_bkup command is just basic 'ssh' with a changed name, which is called right after the echo command changes the current terminal's title.


2

I suspect there's no myip recorded in /root/.ssh/known_hosts. Please try once sudo ssh root@myip interactively before running that script. Alternatively, you can disable host key checking: #!/bin/bash -v sshpass -p '<pypasswd>' scp -o StrictHostKeyChecking=no blah.img root@myip:/home/user/blah.img exit 0


1

Your root user doesn't have the same private keys that you are using when not running as root. Therefore, as root, you cannot copy the material. Try copying adding ~/.ssh/id_rsa to /root/.ssh/id_rsa (or some other private key you are using to connect to myip). Alternatively let the sudo do the other things, and change back to the "normal" user in the ...


1

Try use sshtunnel lib. Example: from sshtunnel import SSHTunnelForwarder from time import sleep with SSHTunnelForwarder( ('localhost', 2222), ssh_username="vagrant", ssh_password="vagrant", remote_bind_address=('127.0.0.1', 3306)) as server: print(server.local_bind_port) while True: # press Ctrl-C for stopping ...


0

I found that simply using -t -t as an argument to ssh made it work. I did not have to set huponexit to either the originating or remote shell. I tested this as follows: Doesn't work: ssh user@remote sleep 100 ^C This killed the ssh session, but I can see the sleep process is still running on the remote host (ps -ef | grep sleep shows it). Does work: ...


0

ssh writes that particular message as a log message at the info level. Log messages are written to standard error by default. Ssh has options to control what is logged. The configuration setting LogLevel sets the log level. Setting the level to QUIET, FATAL, or ERROR would disable the particular message which you're asking about. You can set LogLevel ...


3

Start with creating a user: useradd -m -d /home/username -s /bin/bash username Create a key pair from the client which you will use to ssh from: ssh-keygen -t dsa Copy the public key /home/username/.ssh/id_dsa.pub onto the RedHat host into /home/username/.ssh/authorized_keys Set correct permissions on the files on the RedHat host: chown -R ...


1

You could use: usermod --lock <username> From the man page: Lock a user's password. This puts a '!' in front of the encrypted password, effectively disabling the password. You can't use this option with -p or -U. Note: if you wish to lock the account (not only access with a password), you should also set the EXPIRE_DATE to 1.


1

Same answer as previous, but add +m for job control issue fix: ssh otherserver "bash -ic +m 'source .profile; some-aliased-command'"


0

If you have put this command in your cmd_ssh line, like this: cmd_ssh /usr/bin/ssh -p 22 -i /home/thelemur/.ssh/id_rsa_n900 then you have unfortunately tickled an interesting almost-bug in rsnapshot. The problem is that the cmd_ssh parameter takes the entire value - including spaces - as the ssh alternative to run, whereas what you (and previously I) ...


2

You may use the wget utility. It has a really simple syntax, and all what do you need is to: wget http://link.to.file and it will be stored in the same directory where do you run wget. If you'd like to store a downloaded file somewhere else, you may use -P option, e.g. wget -P /path/to/store http://link.to.file


3

Of course, use scp. It behaves roughly like cp. Sample: scp username@hostname:/remote/path/to/file local_path You can recursively copy directories with -r That's if you really need to download it via ssh. If they provide you just with an url (your question wasn't clear), then wget or curl will do the job, no need for ssh.


2

Use ssh to login to your server, then use for example wget to download the file wget https://provided_link



Top 50 recent answers are included