Skipping Linux system disclaimer when ssh'ing


Recommended Posts

Hi all,

 

Does anyone happen to know a way of skipping a typical Linux system disclaimer -- verbiage about how super duper this server is and if you do anything we don't like then it's a one way trip to Guantanamo -- when SSH'ing to a server? Having combed my way through various "-o" switches, I have not found anything suitable. Basically, what I am trying to do is to send to send a remote command to another server via SSH with what comes back being assigned to a variable. However, together with the output of the command, the ssh login disclaimer is also being returned, which is unwanted, because working around that would create extra work. As such, is it something that can be suppressed (without being turned off at the host level)?

 

Thank you in advance.

Link to comment
Share on other sites

Isn't just the regular MOTD? That's located in /etc/motd

 

Nope, it's not MOTD. The wall of text presented when SSH'ing seems to be composed of this "private property, unauthorised access, blah blah blah", last login date and location, followed by MOTD and list of last X logins. However, when sending an SSH with a command from another host, only the first part is returned (together with command output).

Link to comment
Share on other sites

/etc/legal

 

/etc/motd

 

/etc/motd.tail

 

Are the ones that I encounter, but it's depends on the SSH and bash config per distribution.

Link to comment
Share on other sites

I think if you set up ssh keys (passwordless login), you can skip over these.

I'm curious, which distro are you seeing this on? I get the failed login one in Fedora, but otherwise I jump straight to a prompt.

Link to comment
Share on other sites

I think if you set up ssh keys (passwordless login), you can skip over these.

I'm curious, which distro are you seeing this on? I get the failed login one in Fedora, but otherwise I jump straight to a prompt.

 

I already have password-less login, but it still loads the disclaimer. I am seeing this on RHEL 6.2.

Link to comment
Share on other sites

Try catting /etc/issue.net and see if that's the text.

 

(Or /etc/issue but I think that's local logins.)

 

Bingo, the text being displayed is in /etc/issue. Can it be suppressed during when firing off an SSH or is that a setting on the host that would need turning off locally?

Link to comment
Share on other sites

you could just remove it from that file on the host

 

so ssh into the host and edit it :) if your have the privs

Link to comment
Share on other sites

you could just remove it from that file on the host

 

so ssh into the host and edit it :) if your have the privs

 

Figured out that using "-q" with the SSH command skips it. I'll mark Eric's last post as answer, because that pointed me to the right file that led to the solution. Thanks to everyone who contributed :)

Link to comment
Share on other sites

This topic is now closed to further replies.