diff --git a/components/supervisor/pkg/supervisor/ssh.go b/components/supervisor/pkg/supervisor/ssh.go index dd0105931ce32f..b39da52a3a5661 100644 --- a/components/supervisor/pkg/supervisor/ssh.go +++ b/components/supervisor/pkg/supervisor/ssh.go @@ -8,6 +8,7 @@ import ( "bufio" "context" "fmt" + "io/ioutil" "net" "os" "os/exec" @@ -229,3 +230,21 @@ func configureSSHDefaultDir(cfg *Config) { log.WithError(err).Error("write ~/.ssh/rc failed") } } + +func configureSSHMessageOfTheDay() { + msg := []byte(`Welcome to Gitpod - Always ready to code. You can use commands below to be more productive. + + gp tasks list List all your defined tasks in .gitpod.yml + gp tasks attach Attach to a workspace task + + gp ports list Lists workspace ports and their states + gp timeout extend Extend timeout of current workspace + gp top Display usage of workspace resources (CPU and memory) + gp stop Stop current workspace + +Use gp help to learn more about gp CLI. Visit also https://gitpod.io/docs`) + + if err := ioutil.WriteFile("/etc/motd", msg, 0o644); err != nil { + log.WithError(err).Error("write /etc/motd failed") + } +} diff --git a/components/supervisor/pkg/supervisor/supervisor.go b/components/supervisor/pkg/supervisor/supervisor.go index a5d2a2084242df..a7ba8b6929a0b9 100644 --- a/components/supervisor/pkg/supervisor/supervisor.go +++ b/components/supervisor/pkg/supervisor/supervisor.go @@ -1235,6 +1235,7 @@ func startSSHServer(ctx context.Context, cfg *Config, wg *sync.WaitGroup, childP return } configureSSHDefaultDir(cfg) + configureSSHMessageOfTheDay() err = ssh.listenAndServe() if err != nil { log.WithError(err).Error("err starting SSH server")