Skip to main content

Quick Setup of SSH for Publisher prior to running on Centos 7

Comamnd to build Publisher
Link: https://docs.netskope.com/en/deploy-a-publisher.html


Please Note:  create another admin user in centos as when you run the pubisher command as it locks you out of root after step 3 in the link. You need to login via the other user and run the commnd below.

Login with other user via SSH user created then excute the following command

 

curl https://s3-us-west-2.amazonaws.com/publisher.netskope.com/latest/generic/bootstrap.sh | sudo bash; sudo su - $USER; exit

 

Wait up to 10 min subject to your line speed.


Setup SSH Server 

sudo yum –y install openssh-server openssh-clients
sudo systemctl start sshd
sudo systemctl status sshd


Enable OpenSSH Service
sudo systemctl enable sshd
service sshd restart
sudo systemctl status sshd
(To check Status is Active)


IF you cant SSH enable the following
Firewall Settings
sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-port=22/tcp

 


Option
sudo vim /etc/sysconfig/iptables

If only accepting from specfied IP Source
-A RH-Firewall-1-INPUT -s 1.12.13.14 -m state --state NEW -p tcp --dport 22 -j ACCEPT


sudo systemctl restart iptables


To stop the SSH daemon enter:
systemctl stop sshd

sudo systemctl disable sshd

Option to Add User via Command Line

Quick Setup of SSH for Publisher prior to running on Centos 7

Comamnd to build Publisher
Link: https://docs.netskope.com/en/deploy-a-publisher.html


Please NB create another admin user in centos as when you run the pubisher command it locks you out of root after step 3 in the link. You need to login via the other user and run the commnd below.

SSH On via user you created

curl https://s3-us-west-2.amazonaws.com/publisher.netskope.com/latest/generic/bootstrap.sh | sudo bash; sudo su - $USER; exit


Setup SSH Server

sudo yum –y install openssh-server openssh-clients
sudo systemctl start sshd
sudo systemctl status sshd


Enable OpenSSH Service
sudo systemctl enable sshd
service sshd restart
sudo systemctl status sshd
(To check Status is Active)


IF you cant SSH enable the following
Firewall Settings
sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-port=22/tcp

 


Option
sudo vim /etc/sysconfig/iptables

If only accepting from specfied IP Source
-A RH-Firewall-1-INPUT -s 1.12.13.14 -m state --state NEW -p tcp --dport 22 -j ACCEPT


sudo systemctl restart iptables


To stop the SSH daemon enter:
systemctl stop sshd

sudo systemctl disable sshd

 

Steps to Create a New Sudo User
Log in to your server as the root user.

ssh root@server_ip_address

Use the adduser command to add a new user to your system.

Be sure to replace username with the user that you want to create.

adduser username

Use the passwd command to update the new user’s password.

passwd username

Set and confirm the new user’s password at the prompt. A strong password is highly recommended!

Set password prompts:
Changing password for user username.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Use the usermod command to add the user to the wheel group.

usermod -aG wheel username

By default, on CentOS, members of the wheel group have sudo privileges.

Test sudo access on new user account

Use the su command to switch to the new user account.

su - username

As the new user, verify that you can use sudo by prepending “sudo” to the command that you want to run with superuser privileges.

sudo command_to_run

For example, you can list the contents of the /root directory, which is normally only accessible to the root user.

sudo ls -la /root

The first time you use sudo in a session, you will be prompted for the password of the user account. Enter the password to proceed.

Output:
psudo] password for username:
If your user is in the proper group and you entered the password correctly, the command that you issued with sudo should run with root privileges.


Hello 🙂

Does it work in Ubuntu?
I could not find it. netskops's doc.


hi ju571n

The following does work. just remember to create a second user and add with the wheel command as an admin.When the reboot happens then ssh from another machine to complete the process of upgrading the image or appying thepatches

 

Thansj

 


Do the following for Ubuntu

Add new users then SSH with the new user and run 

sudo curl https://s3-us-west-2.amazonaws.com/publisher.netskope.com/latest/generic/bootstrap.sh | sudo bash; sudo su - $USER; exit

How To Add User To Sudoers & Add User To Sudo Group on Ubuntu 20.xxx Lts for Publisher 

example username = admin123

 

sudo adduser admin123

usermod -aG sudo admin123

sudo usermod -aG sudo admin123

su - admin123

sudo ls -la /root    ( The following must give your a directory listing of the root directory)

 

Check admin123 in Sudoers Group

id

id admin123

 

 

 

 

 

 

 

 

 

curl https://s3-us-west-2.amazonaws.com/publisher.netskope.com/latest/generic/bootstrap.sh | sudo bash; sudo su - $USER; exit


Reply